Repository navigation
i18n CI: diff a push against the tip before it, not against itself - #2329
Merged
Merged
Conversation
ryanbr
force-pushed
the
docs/i18n-workflow-comment
branch
from
September 19, 2026 01:16
c528da2 to
5b0aded
Compare
#524 made `--ci` exempt any violation already present at the base ref, which is what stops a regression on main red-flagging every open PR. It also made the base ref decide the verdict, and the push path was still resolving it the old way. On a push, `github.base_ref` is empty and the fallback resolved to `origin/main`, which IS the pushed commit. That run compared the tree against itself and could never fail. This is not abstract. The push trigger exists, per this file's own header, because a RELEASE pushes straight to main with no PR and `appchangelog-gen.py` emits the What's New title as a raw Kotlin literal that has to be localized by hand. Auditing the push is how that gets caught the moment it lands. Simulated exactly that, using the real 11.8.0 title as the planted literal: base = origin/main (the pushed commit) exit 0 slips through base = github.event.before exit 1 FAIL 1 new hardcoded literal android/.../SleepScreen.kt: 'A gym log book on your wrist, a Coach you can switch off' So a push now diffs against `github.event.before`, the tip before the push, which spans every commit the push carried rather than only the last one. A pull request is unchanged: it still diffs against the branch it targets. `event.before` is all zeros on a branch's first push and absent on a manual run. Neither can be diffed, so both fall back to `HEAD~1`: narrower, but still a real comparison rather than a self-comparison. All three paths exercised locally. The comment now describes the behaviour as fixed rather than as broken, so main never carries a note saying this run is inert.
ryanbr
force-pushed
the
docs/i18n-workflow-comment
branch
from
September 19, 2026 01:18
5b0aded to
b4f454d
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.
Follow-up to #524, which made
--ciexempt any violation already present at the base ref. That is what stops a regression on main red-flagging every open PR, and it also made the base ref decide the verdict. The push path was still resolving it the old way.The problem
On a push,
github.base_refis empty and the fallback resolved toorigin/main, which is the pushed commit. That run compared the tree against itself and could never fail.Not abstract. Per this file's own header, the push trigger exists because a release pushes straight to main with no PR, and
appchangelog-gen.pyemits the What's New title as a raw Kotlin literal that has to be localized by hand. Auditing the push is how that gets caught the moment it lands.I simulated exactly that, planting the real 11.8.0 What's New title as the literal:
The change
A push now diffs against
github.event.before, the tip before the push, which spans every commit the push carried rather than only the last one. A pull request is unchanged: it still diffs against the branch it targets.event.beforeis all zeros on a branch's first push and absent on a manual run. Neither can be diffed, so both fall back toHEAD~1: narrower, but still a real comparison rather than a self-comparison. All three paths were exercised locally.On the comment
This started as a comment-only PR saying the push run was inert. Merging that and fixing the behaviour separately would have left main carrying a comment that was false the moment the fix landed, which is the exact failure this PR set out to correct. So the fix and its description travel together, and the comment now describes the behaviour as it is.
It also records that
fetch-depth: 0is load-bearing: the audit reads the base throughgit show, so a shallow clone misses every lookup. Verified that direction fails safe, by committing a violation and running with a deliberately broken ref: nothing is exempt, so the gate fails loudly rather than passing.