[l10n/automation] Advisory source-string diff comment on PRs#942
Open
Chaitanya-Keyal wants to merge 1 commit into
Open
[l10n/automation] Advisory source-string diff comment on PRs#942Chaitanya-Keyal wants to merge 1 commit into
Chaitanya-Keyal wants to merge 1 commit into
Conversation
Adds the read-only producer and the trusted follow-up consumer: - l10n-pot-diff.yml runs on pull_request with no secrets and a read-only token; it extracts the catalog from the base and the PR-head source, diffs them, and uploads a schema-constrained manifest artifact. - l10n-pot-comment.yml runs on workflow_run from default-branch code; it validates the manifest (schema + repository/head-SHA trust anchors, with an authoritative PR-number to head-SHA binding) and maintains a single advisory comment. Depends on the contract, diff engine, renderer, and validator changes.
6 tasks
This was referenced Jun 23, 2026
8 tasks
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). It uses the schema and tools from #940 and #941. It needs no bot fork, secrets, or configuration: these workflows run in this repo on the built-in
GITHUB_TOKEN.Description
Problem or Issue being addressed
There is no automated way to see what source strings a PR adds, removes, or changes. Reviewers either skip translation impact entirely or manually diff catalogs.
Solution
Adds the two-workflow advisory comment pipeline:
l10n-pot-diff.yml-- triggers onpull_request(the untrusted path, no secrets). It regenerates the catalog from the base branch and the PR head separately, callspot_diff.pyto build a review manifest, and uploads it as a workflow artifact. Running untrusted PR code here is safe because the job has onlycontents: readand no secrets to leak.l10n-pot-comment.yml-- triggers onworkflow_run(the trusted path, default-branch code only). It downloads the artifact, validates it viavalidate_manifest.py(schema plus trust anchors), renders the comment viarender_comment.py, and upserts a single advisory comment per PR. Theworkflow_runtrigger guarantees this job always runs the code from the default branch, never the PR, so the write-capable GITHUB_TOKEN is never in the untrusted execution context (pwn-request-safe split).Both jobs are SHA-pinned, use
persist-credentials: false, run with minimal permissions, and have atimeout-minutes: 10guard.Additional Information
Demo PR: Chaitanya-Keyal#2
This pull request is categorized as a:
Checklist
I ran
pytestlocally(No Python code is added here; the unit tests for the code these workflows invoke are in #940 and #941.)
I included screenshots of any new or modified screens
I added or updated tests
(The workflows are validated end-to-end on a fork; there are no unit-testable parts in this PR.)
I tested this PR hands-on on the following platform(s):
I have reviewed these notes: