Closed Bug 2029056 Opened 7 months ago Closed 4 months ago

Enable autoformatting on uplift trains

Categories

(Conduit :: Lando, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sheehan, Assigned: sheehan)

References

(Blocks 1 open bug)

Details

(Keywords: leave-open)

Attachments

(2 external files)

We currently only enable autoformatting for landings to autoland. We should be able to enable autoformatting on beta/release/esr* as well.

OTOMH, we may need to account for a lack of mach format on older branches, probably by allowing each train to define an autoformatting command, or by uplifting mach format.

Ryan, I'd like to try turning autoformatting on for landings to beta. We can let it bake for a short while to determine if there are any issues, and then make a decision about further rollout to release/esr. There may be some extra work to enable on esr/release (potential backport of mach format, or completing bug 1932005). Roll back can happen at any time by flipping a config knob in the Lando admin panel.

Is there a optimal time in the next little while where we could make this switch?

Depends on: 1932005
Flags: needinfo?(ryanvm)

302 Donal as Beta will be under his purview for the upcoming cycle starting next week.

Flags: needinfo?(ryanvm) → needinfo?(dmeehan)

:sheehan, I'm ok with trying it in the next beta cycle.
You can enable it whenever you like, since there won't be any beta uplifts until next week.

Flags: needinfo?(dmeehan) → needinfo?(sheehan)

I started poking at this and ran into a few hurdles:

  • We run mach bootstrap to install formatters, however by default mach bootstrap uses the user's homedir for mozbuild state.
  • Since we use the homedir by default, running autoformatting on an uplift train would use the autoland formatter versions, which aren't guaranteed to be backward compatible with newer versions.
  • We also have the problem of bug 2030921, and the suggested fix of running rustup install stable will install the toolchain globally.

We can work around this issue by using a per-checkout MOZBUILD_STATE_PATH directory when running mach commands in the landing worker. That way toolchains are installed in a per-checkout location. Alex also suggested using ./mach artifact toolchain --from-build linux64-rust to install rust at our desired version - perhaps we could apply this approach to all our required toolchains for consistency.

I think the next steps are as follows:

  • Add a custom MOZBUILD_STATE_PATH to our current autoland-based formatting.
  • Add a mach artifact toolchain to worker setup to handle bug 2030921 on autoland.
  • Enable autoformatting on non-autoland branches as previously described.
Flags: needinfo?(sheehan)
Depends on: 2030921
Assignee: nobody → sheehan

Discussing with :shtrom, it would be ideal if we had a mechanism to force an update of the toolchains from the admin interface. Something like a flag on the Worker model that when flipped will cause the toolchains to be refreshed the next time a job for a specific repo is picked up.

Authored by https://github.com/cgsheeh
https://github.com/mozilla-conduit/lando/commit/374daeb05fb5229748cdd6d3188ab9a653b96140
[main] repo: create srcdir-specific MOZBUILD_STATE_PATH and pass to mach commands (Bug 2029056) r=shtrom,zeid

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---

Authored by https://github.com/cgsheeh
https://github.com/mozilla-conduit/lando/commit/724e15eaaf654a457a167803714208770ae1e5b5
[main] repo: add configurable autoformat setup command sequence (Bug 2029056) r=shtrom,zeid

:dmeehan, the pieces are in place for us to try enabling autoformatting on beta. Can you give me the OK to enable it?

We can disable it at any time if problems arise, it's controlled by a config flag in the Lando admin.

Flags: needinfo?(dmeehan)

302 to RyanVM for awareness, now that 152 is in beta

Flags: needinfo?(dmeehan) → needinfo?(ryanvm)

Go for it, I guess

Flags: needinfo?(ryanvm)

Okay, autoformat is enabled on beta. We will let it bake and then we can try on release/esr.

Heads up: I'm planning to enable this on release/esr as well, starting tomorrow.

We now have autoformatting running on all uplift trains.

Bug 2046117 added better tracking of changes made by autoformatting, and once bug 2046251 is landed we will have that data available in BigQuery.

Status: REOPENED → RESOLVED
Closed: 5 months ago → 4 months ago
Resolution: --- → FIXED

I had to disable autoformatting on ESR* due to differences in mach format that hadn't been uplifted yet. Deployed Bug 1932005 to work around them, it seems to have worked for esr140 but esr115 is still having trouble. I've disabled on esr115 for now, and will fix that in a follow-up.

See Also: → 2069493
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: