Open Bug 2060418 Opened 3 months ago Updated 3 months ago

Continuous deployment of main to the stage environment

Categories

(Conduit :: Lando, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: shtrom, Unassigned)

References

(Blocks 2 open bugs)

Details

Objective:

  1. keep stage updated to the latest version of main for testing by other teams
  2. allow overriding main with staging for pre-merge testing on stage
  3. restore sync from 1 when done

Idea

  1. Add a workflow that tries to push to staging on pushes to main. It will work or fail depending on fast-forwards (for 2, if someone has manually pushed to staging, the workflow will not override those changes), and if it works, it will deploy to stage as a matter of course (caters for 1).
  2. add a dispatch to actively force-push main to staging to reset it when we're done bespoke testing (caters for 3)
See Also: → 2046277

We may be able to apply the same logic for bug 2057368.

Blocks: 2057368

Couple of ideas here:

  • Currently we mostly use staging as a backup dev server (in practice) even though in theory it should always have main
  • The staging cluster (including Phabricator and BMO) are usually behind or out of date, so that's something else to keep in mind
  • If we continue to use staging as a backup dev server, this may break things in the workflow when db migrations diverge, which may cause unexpected behaviour even if fast-forwards work.
  • A dispatch to actively force-push will not work without additional logic to handle DB divergences

Ideally, we couple this change with an automatic DB reset that synchronizes the schema with whatever's on production, which would alleviate most issues in this respect.

I think DEV is often used for testing by other teams, because it is a little more well configured, but improving the state of staging should encourage more usage of the staging server for its intended purpose!

I think DEV is often used for testing by other teams, because it is a little more well configured, but improving the state of staging should encourage more usage of the staging server for its intended purpose!

Yes, I think that's my key. So we can focus use dev for our own work, but let other teams essentially use main ahead of time. I'm not too worried about data being a bit out of date, as long as the environment is close enough to what's in prod.

The migrations are an issue. In my proposal, we still allow to push divergences from main to staging, at which point it will not be auto-synced until parity with main is restored. I think that would need to be a manual intervention in any case, but it might be good to see how we can automate resyncing the schemata, which is the same issue as we have in dev, so killing two stones with one bird.

You need to log in before you can comment on or make changes to this bug.