Patch set: hardcoded enum/ID values drift on every Chromium roll
Problem
Several patch files insert entries into shared enum/ID lists using absolute numbers. Every Chromium roll shifts those lists, so the same numeric values silently conflict with new upstream entries and the patch either lands on the wrong value or fails to apply with context drift.
Concrete drift observed while rebasing this patch stack from the public pin (155.0.8059.26 / 16c3e5547) to 158.0.8127.18:
chrome/app/chrome_command_ids.h: BrowserOS used40306-40308. Chromium 158 addedIDC_SHOW_TTC_MENU 40306, so the three IDs had to move to40307-40309.chrome/browser/ui/toasts/api/toast_id.h:kBrowserOSToast = 59. Chromium's tail grew tokEnterpriseCopyFailClosed = 64, so the value had to move to65.extensions/common/mojom/api_permission_id.mojom:kBrowserOS = 275. Chromium 158 took275, so it had to move to276.extensions/browser/extension_function_histogram_value.h: the comment// Chromium owns 1978..1988was accurate at 155 and stale at 158 (Chromium reached1993), forcing the BrowserOS entries to be renumbered and the comment to be rewritten by hand.components/infobars/core/infobar_delegate.h: BrowserOS used140/141at 155. Chromium 158 addedCONTEXTUAL_CUE_INFOBAR_DELEGATE_IOS = 140, so they had to move to141/142; they still sit directly after the upstream tail, so the next delegate collides again.- The histogram/permission mirrors under
tools/metrics/**(enums.xml,histograms.xml,actions.xml) must be re-synced by hand in lockstep;LINT.ThenChangeonly pins the file relationship, not the values.
Net effect: a version bump is not just "resolve patch conflicts". A missed renumber compiles and records the wrong enum value, and upstream has no automated way to notice.
Suggested fix
- A scheduled CI job that dry-run applies the full patch stack against the next Chromium snapshot (canary / pinned roll candidate) and fails on rejected hunks, fuzzy offsets, and "inserted value already used upstream" for command IDs, toast IDs, infobar delegates, mojom permissions, and histogram enums.
- A lightweight pre-submit check that parses the patch files for inserted absolute values and compares them against the list tails at the target pin, instead of relying on hand-maintained reserved-range comments that drift.
- Longer term, prefer append-at-end markers that the roll tooling rewrites (or a reserved sentinel range), so the patch does not hardcode absolute values.
I can share the exact per-file collision list from the rebase above as reference data if useful.
Eight days on, with repo evidence instead of a plain ping.
- The numbers in the report are still the numbers on
main:packages/browseros/CHROMIUM_VERSIONis155.0.8059.26,chromium_patches/.store.yamlbase_commitis16c3e55476d3564bea713314b2fff638749ce3e6, andchromium_patcheshas had no commit since #2805 (2026-10-02), so nothing has been renumbered or re-checked in the meantime. - The only version guard in the tree is release-only and compares declared versions, not patch values:
bos_build/config/BROWSEROS_RELEASE_MIN_CHROMIUM_VERSIONreads158.0.8127.18, andvalidate_release_chromium_versionmerely rejects a selected source below that floor. bos-build-tests.ymltriggers onbos_build/**andchromium_files/products/**but not onchromium_patches/**, so editing a patch that renumbers an enum produces no CI signal at all.
If you want the pre-submit half of the proposal first, I can prototype a standalone check that extracts the inserted absolute values from the patch files and diffs them against the target pin's list tails, and open it as a small PR once the expected failure output is agreed on.