Repository navigation
Reuse source inventory while checking present translations - #949
Merged
Merged
Conversation
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
The two integration cases share a path and namespace. A row written by one case can enter the other case's exact result assertion when test order changes. Keep every assertion and pass a separate registered org through each case. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
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.
Changelog category
Changelog entry
Reuse the English source inventory within one check of present translations while checking live source paths and link targets at each use.
Why
The translation validator prepares the English source for each present output when checking retained headings and labels. Each preparation repeats discovery of every tracked source, including when the page has no links.
Scope and risk
Pass one ordered inventory and its membership set through the existing preparation and link-rewrite functions for one validation call. Standalone calls still discover sources afresh; an explicitly empty inventory stays empty. No inventory or file contents persist between calls.
Recheck the prepared source before reading it, the referenced English target before selecting its translated route, and the translated target and anchor at use. Regular untracked sources remain valid inputs to standalone preparation. Membership is a per-call snapshot; tracked-name changes appear in the next call. Existing source hashes, models, origin rules, per-link English fallback reads, publisher behavior and generated translations are unchanged.
Two stored-page test fakes accept the new optional inventory keyword; their existing preservation and tampering assertions are unchanged.
The regression establishes fewer inventory scans, not the cause of a hosted test timeout or a measured full-corpus speedup. No timeout, worker, retry, skip or CI assertion changes.
Compatibility, rollout and rollback
Tests
The focused results below are historical. The production translation code and stored-page fakes are unchanged; the test repository is nested inside each test’s temporary directory. No local tests were repeated on this head.
pytest tests/unit/test_i18n_present_inventory.pyand actual Markdown parsers in temporary repositories.AI assistance in the code
AI-generated: Codex diagnosed the repeated discovery, implemented per-call reuse and checked the path, byte and link boundaries.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist