[l10n/automation] Add comment renderer and manifest validator - #941
Open
Chaitanya-Keyal wants to merge 1 commit into
Open
[l10n/automation] Add comment renderer and manifest validator#941Chaitanya-Keyal wants to merge 1 commit into
Chaitanya-Keyal wants to merge 1 commit into
Conversation
This was referenced Jun 22, 2026
Chaitanya-Keyal
force-pushed
the
l10n/comment-tools
branch
2 times, most recently
from
June 22, 2026 09:57
1432506 to
e9f135e
Compare
This was referenced Jun 23, 2026
14 tasks
wolgwang1729
reviewed
Jul 5, 2026
4 tasks
render_comment.py renders the advisory comment from a validated manifest; untrusted source strings are contained in a diff code fence, with a test proving fence-breakout is not possible. validate_manifest.py checks a manifest against the schema and the repository / head-SHA trust anchors before the trusted comment job acts on it. Includes tests. These tests rely on the diff engine's conftest for import-path setup, so merge after the diff engine.
Chaitanya-Keyal
force-pushed
the
l10n/comment-tools
branch
from
July 21, 2026 11:35
e9f135e to
e5fe6cb
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.
Note
One of the l10n source-string automation PRs (#940, #941, #942, #943, #944). The manifest schema this validates against, and the tests'
conftest, are added in #940.Description
Problem or Issue being addressed
The review manifest is produced by untrusted PR code but rendered into a PR comment by a trusted job. We need to
(a) validate the manifest before trusting it and
(b) render it without letting attacker-controlled source strings break out of the comment.
Solution
Adds two tools:
validate_manifest.py-- validates a manifest against the schema and checks two trust anchors GitHub sets authoritatively (the repository, and the head SHA the triggering run was built from). This is the security boundary between the untrusted producer and the trusted consumer.render_comment.py-- renders the advisory comment. Source strings are shown inside a```diff```fence with newlines flattened and a+/-prefix on every line, so no msgid can start a line and break the fence or inject markup. A test feeds a hostile msgid and proves no breakout.This pull request is categorized as a:
Checklist
I ran
pytestlocally(
python -m pytest l10n/automation/tests-- these tests live outside the project's defaulttestpathsand are run explicitly.)I included screenshots of any new or modified screens
I added or updated tests
I tested this PR hands-on on the following platform(s):
I have reviewed these notes: