This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new c070d866bc3e [ci](i18n) Sample shared UI registry changes in PR builds
(#4513)
c070d866bc3e is described below
commit c070d866bc3eb456faf2444f7a3837d48731d422
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Sun Oct 25 15:20:12 2026 +0000
[ci](i18n) Sample shared UI registry changes in PR builds (#4513)
Changes to `translations/shared/registry.json` were classified as
unknown inputs, forcing a full five-language publication build even when
a PR only changed landing pages or shared UI. Classify that exact path
as a shared UI mechanism and include it in JSON validation and native
content fixture selection.
These changes now select representative real documents across all
configured languages and active versions. Ordinary pages remain
compiled, and the existing complete metadata/route checks remain
enabled. Unknown inputs, dependency/version changes and explicit
`ci/full` requests continue to require full validation.
Validation:
- Two regressions failed before the fix and passed afterward; full i18n
suite: 277 passed, one existing build-fixture skip.
- Replayed the exact 76-file diff from #4511: `full` becomes `sample`,
retaining all five languages and four active versions with publication
disabled.
- Five-language sampling fixture and Chromium verification; omitted
broken modules stay outside compilation, while edited broken
document/blog imports fail compilation.
- `git diff --check` passed.
## Versions
CI policy and its validation guide only; no versioned documentation or
translated content changes.
- [ ] dev
- [ ] 4.x
- [ ] 3.x
- [ ] 2.1 or older (not covered by version/language sync gate)
## Languages
- [ ] Chinese
- [ ] English
## 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
Co-authored-by: morningman <[email protected]>
---
scripts/i18n/CI_VALIDATION.md | 8 +++++-
scripts/i18n/__tests__/ci-sampling.test.cjs | 38 ++++++++++++++++++++++++++++-
scripts/i18n/build-scope.cjs | 2 ++
scripts/i18n/ci-plan.cjs | 3 ++-
4 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/scripts/i18n/CI_VALIDATION.md b/scripts/i18n/CI_VALIDATION.md
index bebefe81d023..97671d2bf1f5 100644
--- a/scripts/i18n/CI_VALIDATION.md
+++ b/scripts/i18n/CI_VALIDATION.md
@@ -10,7 +10,7 @@ committed lockfile after source planning. Source snapshot
checks remain enabled.
| --- | --- |
| README, planning or review notes only | Configuration, move/link and
workflow security checks; no dependency installation or site build |
| CI and tooling | Unit tests, five-language native compilation fixture and
publishing/Apache/Chromium fixture |
-| Shared UI, routing, SEO, localization or sidebars | Representative real
documents in five languages and every active version; native content fixtures
for content/locale implementations, publishing fixtures for delivery/host
implementations |
+| Shared UI, shared UI registry, routing, SEO, localization or sidebars |
Representative real documents in five languages and every active version;
native content fixtures for content/locale implementations, publishing fixtures
for delivery/host implementations |
| Documentation or assets | Changed documents and import dependants, plus
representative real documents; English source changes select all five
languages, localized changes select English and the affected locales |
| Dependencies, active versions or unclassified inputs | Full five-language
publication build and verification |
| `ci/full` PR label or manual `validation=full` | Full five-language
publication build and verification |
@@ -20,6 +20,12 @@ dependency/version changes or unknown inputs from full
validation. Removing a
`ci/full` label runs the automatic policy again. Scheduled and manual
deployment
workflows still build complete publication artifacts; this PR check never
deploys.
+`translations/shared/registry.json` is a known shared UI input. Changes to its
+messages or dependency inventory select representative real documents in every
+configured language and active version, along with the native content fixture.
+Ordinary pages remain in the real build. This classification applies only to
+that exact registry path; other unknown inputs still require full validation.
+
## What a sample proves
The CI adapter first loads native Docusaurus metadata for **all documents and
diff --git a/scripts/i18n/__tests__/ci-sampling.test.cjs
b/scripts/i18n/__tests__/ci-sampling.test.cjs
index eb0aaa01b3e7..288c875663ec 100644
--- a/scripts/i18n/__tests__/ci-sampling.test.cjs
+++ b/scripts/i18n/__tests__/ci-sampling.test.cjs
@@ -3,7 +3,8 @@ const test = require('node:test'),
fs = require('node:fs'),
path = require('node:path'),
os = require('node:os');
-const {policy} = require('../ci-plan.cjs');
+const {execFileSync} = require('node:child_process');
+const {policy, plan} = require('../ci-plan.cjs');
const {prune, dependencies, stripUnbuiltAnchors, selectDocs,
chooseRepresentatives, indexedRouteMatcher} = require('../ci-sample.cjs');
const {buildLocales} = require('../../build-locales.cjs');
function directory(t) {
@@ -34,6 +35,41 @@ test('PR policy separates fixtures, real samples, full
upgrades and lightweight
assert.equal(policy(['docs/topic.md'], {forceFull: true}).mode, 'full');
assert.equal(policy([], {forceSample: true}).mode, 'sample');
});
+test('shared UI registry selects real samples and content fixtures while
unknown inputs still require full validation', () => {
+ const registry = 'translations/shared/registry.json';
+ const selected = policy([registry]);
+ assert.equal(selected.mode, 'sample');
+ assert.equal(selected.selection, 'representative');
+ assert.equal(selected.runContentFixture, true);
+ assert.equal(selected.publicationAllowed, false);
+ for (const file of ['translations/shared/unknown.json',
'unknown-input.bin', 'package.json', 'versions.json'])
+ assert.equal(policy([registry, file]).mode, 'full', file);
+ assert.equal(policy([registry], {forceFull: true}).mode, 'full');
+ assert.equal(policy([registry, 'translations/shared/unknown.json'],
{forceSample: true}).mode, 'full');
+});
+test('a registry-only commit samples all configured languages and active
versions without claiming publication coverage', t => {
+ const root = directory(t), registry = 'translations/shared/registry.json';
+ fs.mkdirSync(path.join(root, 'translations/shared'), {recursive: true});
+ fs.writeFileSync(path.join(root, 'versions.json'), JSON.stringify(['4.x',
'3.x', '2.1']));
+ fs.writeFileSync(path.join(root, registry), JSON.stringify({schemaVersion:
1, messages: {label: 'Before'}}));
+ const git = (...args) => execFileSync('git', args, {cwd: root, encoding:
'utf8', stdio: 'pipe'}).trim();
+ const commit = () => {git('add', '.'); git('-c', 'user.name=Fixture',
'-c', '[email protected]', 'commit', '-qm', 'Fixture');};
+ git('init', '-q'); commit();
+ const base = git('rev-parse', 'HEAD');
+ fs.writeFileSync(path.join(root, registry), JSON.stringify({schemaVersion:
1, messages: {label: 'After'}}));
+ commit();
+ const selected = plan({root, base});
+ assert.deepEqual(selected.files, [registry]);
+ assert.equal(selected.mode, 'sample');
+ assert.equal(selected.selection, 'representative');
+ assert.deepEqual(selected.locales,
require('../../../config/i18n').locales);
+ assert.deepEqual(selected.activeVersions, ['current', '4.x', '3.x',
'2.1']);
+ assert.equal(selected.impact.skip_build, false);
+ assert.deepEqual(selected.impact.json, [registry]);
+ assert.equal(selected.runContentFixture, true);
+ assert.equal(selected.publicationAllowed, false);
+ assert.equal(plan({root, base, event: {pull_request: {labels: [{name:
'ci/full'}]}}}).mode, 'full');
+});
test('unselected MDX modules leave the compiler graph while native layouts and
non-doc pages remain', () => {
const routes = [
{
diff --git a/scripts/i18n/build-scope.cjs b/scripts/i18n/build-scope.cjs
index 0a14e745c215..f5a46cab6a94 100644
--- a/scripts/i18n/build-scope.cjs
+++ b/scripts/i18n/build-scope.cjs
@@ -17,6 +17,7 @@ function validationScope(files) {
const workflow = files.includes('.github/workflows/build-check.yml');
const publishing = files.some(file =>
/^(scripts\/publish\/|scripts\/build-locales\.cjs$|scripts\/build-locale\.cjs$|config\/(custom-docusaurus-plugin|ssrTemplate|asset-origin)\.js$|static\/\.htaccess$|static\/js\/[^/]*bootstrap\.js$|\.github\/workflows\/(cron|manual)-deploy-website\.yml$)/.test(file));
const content = files.some(file => globalLanguageRuntime(file)
+ || file === 'translations/shared/registry.json'
|| /^scripts\/i18n\/(?!__tests__\/).*\.[cm]?js$/.test(file)
|| /^scripts\/i18n\/__tests__\/fixtures\//.test(file)
|| /^(docusaurus.config.js|config\/i18n.js)$/.test(file));
@@ -63,6 +64,7 @@ function buildScope(files, versions, managed = [],
dependencies = null) {
else if (/^(src|config)\//.test(file) ||
['docusaurus.config.js','package.json','yarn.lock','tailwind.config.js','tsconfig.json'].includes(file)
|| /^scripts\/(key-features|last-update|publish)\//.test(file) ||
/^scripts\/(patch-search-tokenize.js|build-locales.cjs|build-locale.cjs)$/.test(file)
||
/^scripts\/i18n\/(docs-plugin|status-plugin|state|structure|content-plugin|content-loader|source-groups|code-prose|protection|content-manifest|manual-state|manual-plugins|native-context|route-context|page-body|page-body-loader|sitemap|content-impact|manual-report|embedded-messages)\.cjs$/.test(file))
shared();
+ else if (file === 'translations/shared/registry.json') {shared();
json.add(file);}
else if (/^translations\/(pages|blog)\//.test(file)) {shared(); if
(file.endsWith('.json')) json.add(file);}
else if ((match =
file.match(/^translations\/(scope|glossary)\/([^/]+)\.json$/))) {
if (!locales.includes(match[2])) throw new Error(`Unconfigured
locale: ${match[2]}`);
diff --git a/scripts/i18n/ci-plan.cjs b/scripts/i18n/ci-plan.cjs
index 4b3faeabae97..941185b418d9 100644
--- a/scripts/i18n/ci-plan.cjs
+++ b/scripts/i18n/ci-plan.cjs
@@ -8,7 +8,7 @@ const {locales, localeRegistry} = require('../../config/i18n');
const {buildScope, validationScope} = require('./build-scope.cjs');
const {managedLocales} = require('./state.cjs');
const {analyzeImpact} = require('./content-impact.cjs');
-const mechanism =
/^(src\/utils\/(localizedRoute|localePreference|contentRoute|useLocalizedRoute|useLanguageItems)\.[jt]sx?$|src\/components\/Content(Route|Metadata)\.tsx$|scripts\/i18n\/(content-manifest|manual-state|manual-plugins|native-context|route-context|page-body|page-body-loader|sitemap|content-impact|manual-report|embedded-messages)\.cjs$|static\/js\/[^/]*bootstrap\.js$|static\/\.htaccess$|translations\/pages\/registry\.json$|config\/(i18n|ssrTemplate)\.js$)/;
+const mechanism =
/^(src\/utils\/(localizedRoute|localePreference|contentRoute|useLocalizedRoute|useLanguageItems)\.[jt]sx?$|src\/components\/Content(Route|Metadata)\.tsx$|scripts\/i18n\/(content-manifest|manual-state|manual-plugins|native-context|route-context|page-body|page-body-loader|sitemap|content-impact|manual-report|embedded-messages)\.cjs$|static\/js\/[^/]*bootstrap\.js$|static\/\.htaccess$|translations\/(pages|shared)\/registry\.json$|config\/(i18n|ssrTemplate)\.js$)/;
const runtime =
/^(src\/|config\/|docusaurus\.config\.js$|sidebars[^/]*\.(ts|json)$|versioned_sidebars\/|scripts\/i18n\/(docs-plugin|status-plugin|state|structure|content-plugin|content-loader|source-groups|code-prose|protection|content-manifest|manual-state|manual-plugins|native-context|route-context|page-body|page-body-loader|sitemap)\.cjs$)/;
const content =
@@ -23,6 +23,7 @@ function policy(files, {forceFull = false, forceSample =
false} = {}) {
const unknown = files.filter(
file =>
!runtime.test(file) &&
+ !mechanism.test(file) &&
!content.test(file) &&
!/^((scripts|\.github|plan-doc|review-docs|\.agents)\/|translations\/CONTENT_MANIFEST\.md$|README\.md$|AGENTS\.md$|LICENSE$|NOTICE$)/.test(
file,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]