Skip to content

ci(i18n): judge lost translations against the base, with no counts to edit per PR (#19673) - #20662

Merged
mrveiss merged 4 commits into
mainfrom
issue-19673-i18n-ratchet-base
Nov 2, 2026
Merged

mrveiss merged 4 commits into
mainfrom
issue-19673-i18n-ratchet-base

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

#19673's re-measure: this one file is in 1,165 of 1,614 conflicting PR pairs, and 15 of the 20 PRs conflicting with main. It pinned an untranslated-string count per locale, and since English is the only required language, nearly every PR adding one UI string edited all ten numbers. The issue's rule is to gate against the merge base rather than keep a committed copy, and repo_tests/_ratchet_base.py already provides that.

What Changed

The counts are gone. The guard now states the rule directly, per locale: a key may be untranslated only if it already was at the base, or if en.json added or reworded it. A translation being removed, or English copied over it, fails and names the keys. A new English-only key needs no edit anywhere.

The floor loop, in the same PR: the next three files on the list are one-line floor= pins. _not_this_branch treated a guard as the branch's if its file was in the branch diff, so one repin put it there, and the gate then demanded another repin at the next growth on the base. _changed_files now leaves out a guard whose diff touches only floor= lines. Trains still repin on their merged tree. 15 of 94 open PRs touch those three files, by commits saying they repinned.

What this no longer catches, on purpose: the count isn't pinned, so translating a batch needs no number lowered. The backlog total is what scripts/list_untranslated.py reports. If the base can't be read the test errors (BaseUnavailable) rather than passing.

Effect on open PRs: any PR with a baseline bump in this file gets one conflict when this lands; the resolution is to take main's version, with no number to carry. That's the last one. Since this is what most of the queue conflicts on, it's worth landing early.

Verification

pytest repo_tests/i18n_untranslated_ratchet_test.py passes locally against the real tree and the real merge base, with dictionary positives for each case. I also removed one real French translation in memory (common.noResults) and the guard named that key. A key under the 12-character filter, such as a product name, is not counted, by the existing definition. CI runs with fetch-depth: 2, which _ratchet_base documents as what it needs; not run in CI yet.

pytest repo_tests/repin_reach_floors_19282_test.py covers the floor-only rule on sample diffs; the rule is not yet shown on a real branch push.

Model Used

Claude Opus 5.5

Refs #19673

@mrveiss mrveiss added the phase:M1.7 Docker docs and the docs close-out label Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 655489c and 750d1c4.

Files selected for processing: 8
  • CONTRIBUTING.md
  • autobot-frontend/src/i18n/__tests__/locale-parity.test.ts
  • docs/adr/011-one-frontend-admin-namespace.md
  • docs/developer/RATCHET_BASELINES.md
  • repo_tests/i18n_untranslated_ratchet_test.py
  • repo_tests/repin_reach_floors_19282_test.py
  • scripts/lift_locale_translations.py
  • scripts/repin_reach_floors.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20662 (head c923a73): changes needed.

Read against the diff and main; nothing was run. Dropping the counts is the right direction. The base lookup fails closed through _ratchet_base, CI fetches the history it needs, and git runs with a scrubbed environment. Refs #19673 is right. But the guard can pass with nothing judged.

Severity Where Finding Fix
High _at_base, if text is None: return {} A base file that isn't found reads as "nothing was translated". If a PR renames the locale directory or moves LOCALES, every locale passes with nothing judged. The old test's size floor applies only to the head tree. Assert the base en has more than 5000 keys, and that a locale existing at the base isn't empty.
Medium test_the_guard_finds_a_loss_and_allows_new_english_only_keys The control runs on dicts, so it doesn't prove base_text, flatten and lost_translations are wired together. A plumbing bug returns {} and stays green. Add a test that the base en and head en keys match on an unchanged tree, or run _at_base on a synthetic repo.
Medium Renamed or moved keys A moved key reads as new, and the old key is gone, so moving a key can lose its translation unnoticed. The count would have caught that. #19839, which moves keys under admin., is in flight. Match a moved key by its English text, with a known-positive for "removed and re-added elsewhere".
Medium CONTRIBUTING.md:184,187 It still tells contributors to lower their number in BASELINE, which no longer exists. Update it.
Low locale-parity.test.ts:27-29, lift_locale_translations.py:14, docs/adr/011-one-frontend-admin-namespace.md:99 They describe a count that's gone. Update them.
Low test_a_translation_is_never_lost It parses base en once per locale. Cache it.

Also no longer caught: English copied into a new or reworded key, and backlog growth. Growth fits the English-only ruling, and scripts/list_untranslated.py still reports the backlog, but nothing caps it now.

Not checked: the 1,165 of 1,614 conflict figure, and the per-namespace shards the issue mentions, which aren't considered here.

@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20662 (head 062006d): changes needed.

Covers the delta since c923a73, read only; nothing was run. The base floor works, with a test, and CONTRIBUTING.md is clean.

Severity Where Finding Fix
Medium lost_translations, moved_texts The move rule keys on text alone. If key a ("T") is deleted, key c ("T") stays, and an unrelated new key b ("T") is added, b is wrongly told it owes a translation. A false refusal stops an unrelated PR. Owe it only when exactly one key vanished with that text and no key still holds it. Add that case to the test.
Low _CODES Locales come from the head tree, so a locale file deleted in the branch is never judged. Use the union of base and head files.
Low locale-parity.test.ts:27-29, lift_locale_translations.py:14, docs/adr/011-one-frontend-admin-namespace.md:99 Still describe a count that's gone. Update them in this PR.

The repin fix (1e359f9) is acceptable. A branch that only hand-lowers a floor= is no longer flagged locally, but main() shows merge trains still enforce through AUTOBOT_REACH_AUDIT. Please add that to the RATCHET_BASELINES.md line. Not verified: that script's behaviour for guards outside repo_tests/.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Auto-sync: merging main into issue-19673-i18n-ratchet-base conflicts

The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base 655489c4e6. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.

repo_tests/i18n_untranslated_ratchet_test.py

side commit subject issue refs
main ba1111df9 Merge #20496 @ fe1d9af into the merge train #20496
main 62b874223 fix(company-os): a company can require board approval to raise a budget limit (#8214) #8214
this branch 750d1c48f test(i18n): only an unambiguous rename owes its translation (#19673) #19673
this branch 062006d0d test(i18n): the ratchet refuses an empty base and follows a moved key (#19673) #19673
this branch c923a738e ci(i18n): judge lost translations against the base, with no counts to edit per PR (#19673) #19673

@github-actions github-actions Bot added the sync-conflict Set by the branch sync (#19548) label Nov 2, 2026
@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20662 (head 750d1c4): approve.

Covers the delta since 062006d, read only; nothing was run.

lost_translations now owes a moved key's translation only when one key vanished with that text and no older key still holds it, so a deleted key plus an unrelated same-text key no longer refuses a PR. The stale doc lines are fixed. No false count remains in the three named files, and BASELINE is gone from them. Leaving _CODES is acceptable: the floor of 10 locales fails on a deletion today. It would need raising if a locale is added.

mrveiss added a commit that referenced this pull request Nov 2, 2026
…tion import order, SLM baseline and a test path in the merged tree (#20662)
@mrveiss
mrveiss merged commit c303eda into main Nov 2, 2026
4 of 5 checks passed
@mrveiss
mrveiss deleted the issue-19673-i18n-ratchet-base branch November 2, 2026 20:08
timothybrush pushed a commit to timothybrush/AutoBot-AI that referenced this pull request Nov 2, 2026
timothybrush pushed a commit to timothybrush/AutoBot-AI that referenced this pull request Nov 2, 2026
timothybrush pushed a commit to timothybrush/AutoBot-AI that referenced this pull request Nov 2, 2026
timothybrush pushed a commit to timothybrush/AutoBot-AI that referenced this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M1.7 Docker docs and the docs close-out sync-conflict Set by the branch sync (#19548)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant