i18n CI: make the coverage gate diff-scoped again, not a full-tree invariant#524
Open
digitalerdude wants to merge 1 commit into
Open
i18n CI: make the coverage gate diff-scoped again, not a full-tree invariant#524digitalerdude wants to merge 1 commit into
digitalerdude wants to merge 1 commit into
Conversation
This was referenced Jul 16, 2026
digitalerdude
force-pushed
the
fix/452-i18n-diff-scoped-gate
branch
2 times, most recently
from
July 17, 2026 10:45
4ec4221 to
e3275f4
Compare
digitalerdude
marked this pull request as ready for review
July 17, 2026 10:46
digitalerdude
force-pushed
the
fix/452-i18n-diff-scoped-gate
branch
from
July 19, 2026 13:35
e3275f4 to
af3ac81
Compare
…variant ci_check() audited the whole merged tree unconditionally once the ryanbr#453 backlog closed, ignoring base_ref entirely. That means a transient regression on main (the 9.0.1 release generating a raw AppChangelog.kt literal, fixed by ryanbr#514) red-flagged every open PR whose diff never touched the offending file — and those PRs stayed red, since a pull_request-triggered workflow doesn't re-run just because main changed. ryanbr#508 and ryanbr#506 are still showing that stale failure right now, over 5 hours after ryanbr#514 fixed main. Restores the base_ref diff (Android side already had the git_show/ literals_at_ref scaffolding for this, just unused) across every check: hardcoded literals, missing-translation keys, and format-string mismatches, on both platforms. A violation already present on base_ref isn't this PR's fault and no longer fails it; existing debt is still printed for visibility. Today that's zero everywhere, so the practical behavior on a healthy main is unchanged — this only changes what happens when main itself regresses.
digitalerdude
force-pushed
the
fix/452-i18n-diff-scoped-gate
branch
from
July 25, 2026 14:17
af3ac81 to
77de488
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ci_check()inTools/i18n_audit.py(#452) originally audited the whole merged tree unconditionally once the #453 backlog closed —base_refwas accepted on the CLI but never actually used. That means a transient regression onmainred-flags every open PR, including ones whose diff never touched the offending file.That's exactly what happened: the 9.0.1 release generated a raw literal into
AppChangelog.kt(fixed by #514), and it broke the gate on #507, #512, #513 — then #514 fixedmain, but #508 and #506 kept showing the stale failure for hours afterward, because apull_request-triggered workflow doesn't re-run just because the base branch changed.(#509 independently re-implemented the same
AppChangelog.ktfix as #514, which had already landed — it didn't touch this underlying issue.)Since this PR was opened, #558/#581 landed a much-improved literal scanner (catches literals hidden behind if/else/when/.let, and contentDescription inside a semantics{} lambda) plus a baseline (
Tools/i18n_audit_baseline.json) to exempt the ~250-entry backlog that scanner surfaced. The baseline solves a different problem than this PR, though: it's a fixed snapshot, so a new regression onmainafter the snapshot (the same class of incident as #514) would still red-flag every unrelated open PR until someone manually updates the baseline.What
ci_checknow exempts a violation on either of two independent grounds:base_ref— so this PR didn't cause it, regardless of whether it's made it into the baseline yet.Locale-gap and format-mismatch checks (missing translations, printf-argument mismatches) aren't covered by the baseline at all — the
base_refdiff is their only exemption. On a healthymainthis is a no-op: the gate behaves identically to before. It only changes what happens whenmainitself regresses — that regression now stays scoped to whoever caused it, instead of spreading to every other open PR, independent of whether the baseline has caught up yet.Verification
python3 Tools/i18n_audit.py --ci HEADon the current tree → exit 0 (192 Android + 64 iOS pre-existing findings correctly reported as exempt, not failures).base_refto the pre-i18n: localize the 9.0.1 What's New title (unblock the coverage gate) #514 commit (still carrying the brokenAppChangelog.ktliteral) → reported as pre-existing, exit 0. Under the gate as it stood before this PR, that same state hard-fails (confirmed against Clarify phone heart-rate broadcast copy #508/Restore recognizable Android dashboard metric icons #506's actual CI logs at the time).--ci HEAD→ still exit 0, proving thebase_refexemption works independently of the baseline (this is the actual value of the PR: a future regression not yet in any baseline still won't spread to unrelated PRs).Text(...)call not present in the baseline or onbase_ref→ correctly caught, exit 1; reverted, exit 0 again.<plurals>(i18n: real <plurals> instead of hand-rolled singular/plural pairs #541) and Applevariations.plural(i18n: teach the Apple audit about xcstrings plural variations #542) regressions (deleted a real translated plural / broke placeholder parity on a synthetic multi-form plural) → both still correctly caught after merging with this PR's diff-scoping.python3 Tools/i18n_audit.py(plain report mode) and--platform ios/android --fulland--update-baselineall still run correctly and match the committed baseline exactly (no drift).Scope
Python-only change to
Tools/i18n_audit.py, no workflow YAML changes needed. No app code touched.