morningman opened a new pull request, #4405:
URL: https://github.com/apache/doris-website/pull/4405
## Why
Admission checks ran without looking at what a PR actually changed. On the
Korean-only translation PR #4395, the five checks used ~22m30s of runner time
(on top of ~90 minutes of runner queueing), and a large part of that could not
be affected by the diff:
- `japanese-coverage-audit` scanned the 3338-page English inventory and
produced a Japanese coverage snapshot. A diff confined to `i18n/ko/**` cannot
change it.
- `check-md-links` ended with `No Markdown files added or modified in this
PR. Skipping.` — it only checks `docs/**`, zh-CN current and `ja`.
- Build Check's translation gate ran `pr-preflight` for every managed
locale. The `ja` iteration reported `checked: 0` after 2m28s, because
`check-translations.cjs` loads the full Docusaurus inventory before selecting
changed pages.
## What changed
### 1. Coverage audits only run for their own locale
`japanese-coverage-audit.yml` and `korean-coverage-audit.yml` used `i18n/**`
and `translations/**`, so every Korean PR triggered the Japanese audit (and
vice versa). The Japanese workflow originally used `i18n/ja/**`; the
locale-generic refactor widened it.
Each workflow now matches its own locale inputs plus shared routing files,
and also:
- uses `fetch-depth: 1` because the audit only reads `HEAD`;
- has a concurrency group so a force-push cancels the superseded run;
- names the Japanese job `Japanese coverage audit` instead of the bare
`audit` (neither check is required).
### 2. The audit reads blobs in one process
`scripts/i18n/audit-coverage.cjs` spawned one `git show` per page: 3338
sources plus up to ~3100 current targets. Sampling the running process showed
it blocked in `posix_spawn`. It now resolves all source, target and routing
hashes through one `git cat-file --batch` process each and keeps only the
SHA-256.
Measured on 100 paths: `git show` 2.03s vs `git cat-file --batch` 0.027s.
### 3. Build Check only gates locales that changed
`Translation gate for changed locales` runs `pr-preflight` for a locale when:
- its own translation inputs changed (`i18n/<locale>/**`,
`translations/{state,scope,glossary,inventory,protection-exceptions}/<locale>...`),
or
- a shared input changed (`scripts/i18n/`, `translations/config.json`,
`config/i18n.js`, `docusaurus.config.js`, `versions.json`, the sidebars,
`versioned_sidebars/`).
On #4395 this skips the `ja` iteration: 2m28s out of the 5m05s step. An
English-only docs PR skips both admission gates.
Build Check also switches to `actions/checkout@v4` with `filter: blob:none`
(full history metadata, no 1.7GB of historical blobs) and reuses the yarn cache
instead of clearing it.
### 4. The required lightweight checks stay, but cheap
`Build Check`, `check-md-links` and `check-file-sizes` are required status
checks, so their names and triggers are unchanged.
- `check-md-links`: blobless checkout; the changed-file lists are collected
before `setup-python`; when there is nothing to check the job exits right after
the diff. On #4395 this turns a 37s no-op into a short checkout plus one diff.
The resolver unit test now runs when its script changes rather than on every PR.
- `check-file-sizes`: `fetch-depth: 1`, then fetch the base commit with
`--depth=1 --filter=blob:none`; `--name-only` only needs the base tree.
- Both get `cancel-in-progress` concurrency groups.
### 5. Docs
`translations/README.md` now describes the changed-locale gate instead of
the old “once per configured locale” loop.
## Expected effect (Korean-only PR like #4395)
| check | before | after |
| --- | --- | --- |
| Build Check | 11m29s | ~9m |
| Korean coverage audit | 5m10s | ~3m10–3m30s |
| Japanese coverage audit | 4m38s | not triggered |
| check-md-links | 37s | ~20–30s |
| check-file-sizes | 36s | ~20s |
| jobs / queue slots | 5 | 4 |
The queue-slot reduction matters more than the per-job seconds: the
90-minute delay on #4395 was backlog from ~13 translation PRs that each opened
five jobs.
## Validation
- `node --test scripts/i18n/__tests__/multi-locale.test.cjs` — 6/6, with new
cases for both locales, `ja` only, `ko` only, no locale change, and a
shared-input change.
- `node --test scripts/i18n/__tests__/t04.test.cjs` — 12/12, including the
full-audit fixture (existing files, missing targets, routing inputs).
- A full `I18N_LOCALE=ja node scripts/i18n/audit-coverage.cjs --source-ref
HEAD ...` run exits 0 on current master; its DEV/4X/COMMUNITY counts match the
Japanese coverage artifact from #4395 (1671/1616/51 pages, 1563/1505/51
current).
- All five workflow files parse, and the three required job names are
unchanged.
## Not changed
- `check-md-links` and `check-file-sizes` could be folded into Build Check
to save another queue slot, but they are required status checks; removing their
workflow would leave the required check pending.
- `check-md-links` still does not check `i18n/ko/**` (pre-existing); Build
Check's `pr-preflight` checks links in changed Korean files. I left that
behavior alone.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]