Closed Bug 1513216 Opened 11 months ago Closed 10 months ago

Don't record build telemetry for `mach clang-format` when invoking it via hg

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ted, Assigned: andi)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

clang-format currently shows up as the #1 most-used mach command:
https://sql.telemetry.mozilla.org/queries/59844/source#154666

Our intent is to only capture mach commands that are actually invoked by a user. We added some checks to deal with recursive mach invocations to keep those out of telemetry, but having `mach clang-format` get invoked from inside hg is adding a lot of noise here. We should figure out a sensible way to stop recording telemetry for this command in this situation.

Someone suggested that we ought to not record telemetry when we don't detect a terminal, but that would mean we wouldn't record telemetry when someone runs mach and pipes the output to a file. It might be simpler to just make the hg-formatsource extension set a magic environment variable. We don't have one for this purpose right now but we could add one here:
https://dxr.mozilla.org/mozilla-central/rev/c2593a3058afdfeaac5c990e18794ee8257afe99/build/mach_bootstrap.py#227
Assignee: nobody → bpostelnicu
I'm gonna take care of this, :ted I think your idea of having an env variable setup by the extension when it invokes 'mach clang-format' is the way to do it. It's easy to implement and straight forward.
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/04437834f0af
Don't collect build telemetry when 'mach' is ran from hg format-source. r=sheehan
Pushed by cosheehan@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/8af6070012c0
extensions: format-source should disable the 'mach' telemetry for the commands that it triggers. r=sheehan
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.