Skip to content

Breeze: add --json output to check-translation-completeness #75772

Description

@aaiss0927

Description

breeze ui check-translation-completeness computes the canonical translation status for the 20 non-English UI locales — per-file required/missing/unused keys, TODO-aware coverage, plural-suffix handling — but renders it only as rich tables for a human terminal. I propose adding a --json flag that prints the same report as machine-readable JSON, following the pattern breeze ci verify --json established in #73241: a boolean flag, console narration suppressed (or sent to stderr), nothing but the JSON document on stdout, so piping to jq is always safe.

Illustrative shape, from a real run on main (2026-10-27); exact fields open to discussion:

{
  "languages": {
    "ko": {
      "files": {
        "dag.json": {
          "required": 253, "translated": 235, "missing": 18, "todos": 0, "unused": 13,
          "coverage": 92.9,
          "missing_keys": ["allMapIndexes", "callbacks.callback_one", "..."],
          "unused_keys": ["execution.title", "loop.iteration", "..."]
        },
        "hitl.json": { "required": 37, "translated": 37, "missing": 0, "coverage": 100.0 }
      },
      "totals": { "required": 1296, "translated": 1258, "missing": 38, "todos": 0, "coverage": 97.1 }
    }
  },
  "complete": false
}

What this intentionally does not change:

  • The default output — with no flag, rendering stays byte-identical to today.
  • Exit-code semantics — per the original design in Check if plural forms are correct for languages. #55327, missing translations deliberately do not fail the command; --json is pure output formatting, and CI gating is out of scope here.
  • The existing flags — --language, --add-missing, --remove-unused all keep working and compose with --json (e.g. report the post-modification state as JSON).
  • No new checks or policy — the flag only re-serializes data the command already computes.

The implementation is small: extract the aggregation that currently lives inside the table-rendering loop into a build_completeness_report() function, and feed either the existing rich renderer or json.dumps from the same dict (roughly 120–180 lines including tests). I plan to open the PR shortly after feedback on the field shape — working on it.

Acceptance criteria

  • --json prints a single JSON document on stdout and nothing else (narration suppressed or sent to stderr), so piping to jq is safe.
  • With no flag, output stays byte-identical to today; exit-code semantics unchanged.
  • Composes with --language, --add-missing, --remove-unused (reports the post-modification state).
  • Tests cover the report builder (missing/unused/TODO/plural cases) and JSON-mode stdout purity.

Use case/motivation

The repository already has three consumers of this report, and all of them consume it as hand-copied or screen-scraped terminal text:

  1. The release process. dev/README_RELEASE_AIRFLOW.md has release managers run this check before each RC and paste its console output into dev@ emails (the <OUTPUT_OF_I18N_COMPLETENESS_SCRIPT> placeholder appears in two templates), and the below-90%-for-two-consecutive-releases locale policy (Simplify i18n policy #65630) is applied by reading that pasted table. With --json, producing those emails and checking the policy becomes scriptable.

  2. The CI job. basic-tests.yml runs the check on every PR (job check-translation-completness) as breeze ui check-translation-completeness || true, so the per-PR report the job was added for in Check if plural forms are correct for languages. #55327 is only visible by opening the step log, and nothing consumes it. With JSON output, the job could render a compact per-language summary to $GITHUB_STEP_SUMMARY, making the report visible right on the job page — happy to wire that up in the same PR or as a follow-up, whichever is preferred. (Side observation: Fix breeze ui check-translation-completeness verification in ci #61885 showed the step can break silently for months precisely because its output has no consumer.)

  3. Agent and locale-team tooling. The in-repo translation skill (.agents/skills/airflow-translations/SKILL.md) has agents run this command repeatedly and parse the tables from terminal output, and locale-team tooling outside the repo tends to re-implement key diffing against the raw locale files — diverging from the checker on plural forms, TODO stubs and unused keys. (The ESLint check-translations-completeness rule also only checks key presence, with none of the coverage/TODO/unused semantics.) This mirrors the accepted motivation for breeze ci verify --json in Add breeze verify to list local checks for changed files #73241: structured output is cheaper and less fragile for agents and scripts than scraping tables.

Related issues

#55327 (origin and design intent of the CI job), #58637 (script → breeze command conversion), #61885 (silent CI step failure), #73241 (breeze ci verify --json precedent), #62982 (recent checker-accuracy improvements)

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:feature
    needs-triage
    on Oct 27, 2026
  2. SuryaNarayana-C-K commented on Oct 27, 2026

    @SuryaNarayana-C-K

    Hi @aaiss0927! I'd like to contribute to this issue. I can help implement and test the --json output, particularly ensuring stdout contains only valid JSON and that existing flags continue to work correctly. Are you open to contributions from others on this issue? I'd be happy to coordinate to avoid duplicating your work.

  3. aaiss0927 commented on Oct 28, 2026

    @aaiss0927
    ContributorAuthor

    Hi @SuryaNarayana-C-K — thanks a lot for asking first and offering to coordinate, much appreciated!

    As mentioned in the description, I had already started on this; my implementation is now up as #75831. It covers exactly the two points you called out — stdout carrying only valid JSON (including when the computation aborts mid-way) and composition with the existing flags — each pinned by tests.

    Heads-up that there is also a parallel implementation in #75809. Per the project's parallel-work policy that's perfectly fine — the best implementation gets merged — so if you feel like digging in, reviewing either PR is a genuinely useful way to contribute here.

    If you'd rather build something: the follow-up I sketched in the use-case section — rendering this JSON into $GITHUB_STEP_SUMMARY in the CI completeness job — is still open, and I'd be glad to review it. (No assignments in this repo by convention: if you want it, just drop a "working on it" and go.)

  4. aruadecarvalho commented on Oct 28, 2026

    @aruadecarvalho

    Hi @aaiss0927, I’d like to work on the CI-summary follow-up: rendering the JSON report as a compact per-language table in $GITHUB_STEP_SUMMARY. I’ll coordinate around whichever JSON-output PR lands. Is there a preferred layout, or should I propose one?

  5. SuryaNarayana-C-K commented on Oct 28, 2026

    @SuryaNarayana-C-K

    Thanks for the update @aaiss0927!
    I'll dive into both #75831 and #75809 to review the implementations, run some tests locally, and leave feedback there. Looking forward to seeing this land!

  6. aaiss0927 commented on Oct 28, 2026

    @aaiss0927
    ContributorAuthor

    Hi @aruadecarvalho — great, it's yours!

    No fixed layout on my side — please propose one. A few pointers that might save you time:

    • The job lives in .github/workflows/basic-tests.yml (job id check-translation-completness); today the step is breeze ui check-translation-completeness || true, i.e. log-only. Whatever the summary looks like, please keep the step non-gating — never failing the build on incomplete translations is intentional design (Check if plural forms are correct for languages. #55327).
    • What I'd personally hope for: one compact markdown table mirroring the JSON per-locale totals (locale, coverage %, missing, TODOs, unused) plus the overall complete verdict — and keep the per-key lists out of the summary or behind <details>: $GITHUB_STEP_SUMMARY is capped at 1 MiB per step and the missing-key lists can get large.
    • Schema: the "Output shape" section of Add --json output to breeze ui check-translation-completeness #75831 documents what it emits (pinned by its tests); Add --json output for breeze ui check-translation-completeness (#75772) #75809's shape differs a bit, so coordinating around whichever lands — exactly as you said — is the right call.

    Happy to review when you open the PR!

  7. SuryaNarayana-C-K commented on Oct 28, 2026

    @SuryaNarayana-C-K

    Hi @aaiss0927! I'd like to work on the GitHub Actions step-summary follow-up you mentioned. Could you please let me take this up? I'll implement the feature to display the translation-completeness report directly in $GITHUB_STEP_SUMMARY and submit a PR. Thank you!

  8. aaiss0927 commented on Oct 28, 2026

    @aaiss0927
    ContributorAuthor

    @SuryaNarayana-C-K
    I think our comments crossed: @aruadecarvalho picked this exact follow-up up a few comments above and I've already confirmed with them, so the $GITHUB_STEP_SUMMARY one is taken. Sorry for the confusion!

    A few other ways to plug in, all genuinely useful:

    • Reviewing Add --json output to breeze ui check-translation-completeness #75831 / Add --json output for breeze ui check-translation-completeness (#75772) #75809, as you offered earlier, is still the highest-value contribution right now — the comparison is what unblocks everything downstream, including the step-summary work.
    • @aruadecarvalho's step-summary PR will itself need review once it's up (layout + workflow change) — a second pair of eyes there would be very welcome.
    • If you'd rather build something solo: the other consumer from the issue's use-case list is still open — the release process pastes this script's output into the RC voting-email template (see <OUTPUT_OF_I18N_COMPLETENESS_SCRIPT> in dev/README_RELEASE_AIRFLOW.md), and a small helper rendering the JSON into that snippet would be a nice self-contained follow-up. Best started after one of the --json PRs lands (so the schema is settled) — and per repo convention no permission needed: just drop a "working on it" where you start.
  9. added a commit that references this issue on Nov 1, 2026
    6042121
  10. added a commit that references this issue on Nov 1, 2026
    eb47cc9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:featureneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions