morningman opened a new pull request, #4284: URL: https://github.com/apache/doris-website/pull/4284
## Summary A Japanese content change rebuilt English, Chinese and Japanese. `scripts/i18n/build-scope.cjs` already works out which locales a diff can reach, but the build step ignored that and fell back to every enabled locale as soon as Japanese was involved, so a one-file Japanese PR paid for three locale builds. `build:locales` now accepts `--locales <csv>` and narrows the configured plan to that selection: - The configured order is preserved, so a selection containing the default locale still builds it first and keeps the root control files. - A selection **without** the default locale assembles an empty root and leaves every built locale beneath its own prefix, rather than promoting one language to the root. `.i18n-build/build-result.json` records the request. - Unknown, empty or duplicated selections fail before any build starts. - Omitting the option builds every enabled locale, which is what publishing requires. Cron and manual deployment are unchanged. `verify-static` gains `--partial` for those subset artifacts. Assertions about the current locale itself — status notice, body language, canonical, sitemap and search-index membership, noindex, heading IDs — are unchanged. A counterpart page the subset did not build is counted as skipped instead of read, and the count is reported. `build-scope.cjs` now reports whether a build covered every configured locale, so the pull-request check relaxes only the cross-locale comparison it cannot make. Measured on a GitHub `ubuntu-latest` runner (`DOCS_VERSIONS=current`): en 128s, zh-CN 128s, ja 103s. A Japanese-only PR drops from 359s to 103s of locale build time, about 71%. ## Validation - `node --test scripts/__tests__/build-locales.test.cjs`: 9 passed. New cases cover a locale-only subset, a subset containing the default locale, configured-order selection, and rejection of unknown/empty/duplicated selections before any child build starts. - `node --test scripts/i18n/__tests__/*.test.cjs`: 8 files passed, including the `build-scope` cases extended with `partial_build`. - Real subset build at `5fda1b3f19` (`DORIS_ENABLE_JA=true DOCS_VERSIONS=current`): `build:locales --locales ja` built only Japanese, 6,816 pages, and assembled a correct locale-only tree with its own `sitemap.xml`, `robots.txt` and search index; `success: true`, `requested: ["ja"]` in `build-result.json`. - `verify-static --site <subset> --manifest .i18n-build/manifests/ja.json --partial`: 1,778 verified, 696 skipped, exit 0. Without `--partial` the same artifact still fails with `Missing counterpart page (source heading IDs)`, so strict verification is preserved. - `build-check.yml` parses; the build step selects the detected locales and passes `--partial` only when the scope detector reports a subset. ## Not covered The full three-locale build was not re-run locally after the assembly change; the pre-existing unit tests still assert that the default locale contributes the root controls and that each other locale fills exactly one prefix, and the deployment path keeps building every locale. ## Versions - [x] dev - [x] 4.x - [x] 3.x - [x] 2.1 or older (build tooling only, no content) ## Languages - [x] Chinese - [x] English - [x] Japanese (build scoping only, no content change) ## Docs Checklist - [x] Checked by AI - [x] Test Cases Built - [x] Updated required version and language counterparts, or explained why not - [x] If only one language changed, confirmed whether source/translation counterparts need sync 🤖 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]
