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 cb0a1c5cb8e [feat](i18n) Launch Japanese docs with English fallback
(#4211)
cb0a1c5cb8e is described below
commit cb0a1c5cb8eb3f878e053c3f60aed5438f3511bd
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Tue Oct 13 05:58:49 2026 +0800
[feat](i18n) Launch Japanese docs with English fallback (#4211)
## Problem and resulting behavior
The Japanese locale is implemented and validated but production builds
still omit it. This publishes the existing Japanese pages now: pages
without a valid Japanese translation retain the same-version English
document and display the Japanese translation-status notice plus a link
to the English source. The four currently valid translated documents
remain available; 3,282 required Dev/4.x/community documents are still
pending translation. Translation coverage is reported separately from
reachable fallback routes.
Both production deploy workflows now enable `DORIS_ENABLE_JA=true` and
validate the built Japanese pages before either OSS upload or `asf-site`
publication. The validation checks the page language, translation
notice/state, canonical and noindex rules, sitemap and Japanese search
exclusion for fallback pages. The job-level flag can be set to `false`
in both workflows for rollback; the Japanese-only verification step then
skips.
The cron workflow previously inspected a nonexistent manual `branch`
input. On push/schedule that could skip its master deployment and enter
the branch deployment step. It now always publishes the master site. The
manual workflow checks out its requested branch, and both workflows pass
the deployed commit SHA to the publish action. Manual and cron
deployments share a concurrency group. Non-master preview deployments
now keep the live `asf-site` root instead of orphaning it; the master
deployment still replaces the whole site. Deployment workflow changes
are classified as shared build inputs; the Japanese full-build and
document-scope CI jobs run on this PR.
## Validation
- 38 i18n/build unit tests passed; workflow YAML parsed; `git diff
--check` passed.
- A full Node 20 en/zh-CN/ja build of all active versions and existing
plugins passed at rendered-source commit `05141a5520` (the final
follow-up commit only changes the manual preview publish flag) (379.9s,
392.3s, 348.8s). The same production static verifier passed on 5,874
non-draft Japanese pages; 3,286 target navigation routes passed. Dev,
4.x, 3.x, 2.1 and community fallback samples show the same-version
English page, Japanese notice, English canonical and noindex. The
Japanese search index contains only the four valid translated pages.
- Build Check, link, file-size and coverage-audit PR checks passed. The
full-memory and document/browser/search baseline checks are still
running; this PR remains draft until they pass. No deployment occurs
from the PR checks.
## Rollback
Set `DORIS_ENABLE_JA` to `false` in both production jobs, rebuild and
publish the en/zh-CN artifact to `asf-site`; its `force_orphan`
publication removes `/ja/` from the main site. OSS uses `onlyUpload`, so
old `/ja/` objects in the asset bucket require targeted deletion and CDN
invalidation if direct asset URLs must also be disabled.
---------
Co-authored-by: morningman <[email protected]>
---
.github/workflows/cron-deploy-website.yml | 27 +++++++++++----------------
.github/workflows/japanese-documents.yml | 4 +++-
.github/workflows/japanese-poc.yml | 4 +++-
.github/workflows/manual-deploy-website.yml | 23 +++++++++++++++++++++--
scripts/i18n/__tests__/t04.test.cjs | 2 ++
scripts/i18n/build-scope.cjs | 1 +
6 files changed, 41 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/cron-deploy-website.yml
b/.github/workflows/cron-deploy-website.yml
index c82af95ef81..b61fe4f1eca 100644
--- a/.github/workflows/cron-deploy-website.yml
+++ b/.github/workflows/cron-deploy-website.yml
@@ -23,6 +23,8 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: Production
+ env:
+ DORIS_ENABLE_JA: 'true'
steps:
- name: Checkout
# v4 (the pinned @master commit predates the `filter` input) with
@@ -89,7 +91,14 @@ jobs:
cp .asf-site.yaml ./build/.asf.yaml
cp versions.json ./build/
ls build
- export DORIS_COMMIT=`git rev-parse HEAD`
+ echo "DORIS_COMMIT=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
+
+ - name: Verify Japanese publishing artifact
+ if: env.DORIS_ENABLE_JA == 'true'
+ run: |
+ test -s build/ja/index.html
+ node scripts/i18n/verify-static.cjs \
+ --site build --manifest .i18n-build/manifests/ja.json
# - name: Generate PDF
# run: |
@@ -143,7 +152,6 @@ jobs:
run: rm -rf ./build/assets/files/*.pdf
- name: Deploy Website
- if: ${{ github.event.inputs.branch == 'master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
@@ -153,17 +161,4 @@ jobs:
destination_dir: ./
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- commit_message: 'Automated deployment with doris branch ${{
github.event.inputs.branch }}@${{ env.DORIS_COMMIT }}'
-
- - name: Deploy Branch
- if: ${{ github.event.inputs.branch != 'master' }}
- uses: peaceiris/actions-gh-pages@v3
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_branch: asf-site
- publish_dir: ./build
- force_orphan: true
- destination_dir: ${{ github.event.inputs.branch }}
- user_name: 'github-actions[bot]'
- user_email: 'github-actions[bot]@users.noreply.github.com'
- commit_message: 'Automated deployment with doris branch ${{
github.event.inputs.branch }}@${{ env.DORIS_COMMIT }}'
+ commit_message: 'Automated deployment with doris master@${{
env.DORIS_COMMIT }}'
diff --git a/.github/workflows/japanese-documents.yml
b/.github/workflows/japanese-documents.yml
index 8c31ded7dde..05105c0ddc6 100644
--- a/.github/workflows/japanese-documents.yml
+++ b/.github/workflows/japanese-documents.yml
@@ -18,6 +18,8 @@ on:
- 'src/theme/SearchPage/**'
- 'src/utils/tokenize.ts'
- 'static/.htaccess'
+ - '.github/workflows/cron-deploy-website.yml'
+ - '.github/workflows/manual-deploy-website.yml'
- '.github/workflows/japanese-documents.yml'
permissions:
@@ -31,7 +33,7 @@ jobs:
document-scope:
# T03 validates real Dev/4.x content, without repeating the full memory
# experiment. The complete production matrix remains in japanese-poc.yml.
- if: github.event_name == 'workflow_dispatch' ||
startsWith(github.head_ref, 'feat/japanese-doc-inventory') ||
startsWith(github.head_ref, 'feat/japanese-i18n-ci-search')
+ if: github.event_name == 'workflow_dispatch' ||
startsWith(github.head_ref, 'feat/japanese-doc-inventory') ||
startsWith(github.head_ref, 'feat/japanese-i18n-ci-search') ||
startsWith(github.head_ref, 'feat/japanese-i18n-launch')
runs-on: ubuntu-latest
timeout-minutes: 120
env:
diff --git a/.github/workflows/japanese-poc.yml
b/.github/workflows/japanese-poc.yml
index 2f19d0fa5c3..f4a1ecd742c 100644
--- a/.github/workflows/japanese-poc.yml
+++ b/.github/workflows/japanese-poc.yml
@@ -26,6 +26,8 @@ on:
- 'scripts/build-locale.cjs'
- 'scripts/__tests__/build-locales.test.cjs'
- 'translations/**'
+ - '.github/workflows/cron-deploy-website.yml'
+ - '.github/workflows/manual-deploy-website.yml'
- '.github/workflows/japanese-poc.yml'
# PR code is untrusted. This job has no deployment environment, secrets,
@@ -41,7 +43,7 @@ jobs:
full-build:
# Keep the expensive full matrix specific to the staged implementation
# branches. General translation-PR scope detection belongs to T04.
- if: github.event_name == 'workflow_dispatch' ||
startsWith(github.head_ref, 'feat/japanese-i18n-poc') ||
startsWith(github.head_ref, 'feat/japanese-i18n-status')
+ if: github.event_name == 'workflow_dispatch' ||
startsWith(github.head_ref, 'feat/japanese-i18n-poc') ||
startsWith(github.head_ref, 'feat/japanese-i18n-status') ||
startsWith(github.head_ref, 'feat/japanese-i18n-launch')
runs-on: ubuntu-latest
timeout-minutes: 180
env:
diff --git a/.github/workflows/manual-deploy-website.yml
b/.github/workflows/manual-deploy-website.yml
index 59d46636614..057b773d3f7 100644
--- a/.github/workflows/manual-deploy-website.yml
+++ b/.github/workflows/manual-deploy-website.yml
@@ -8,16 +8,26 @@ on:
required: true
default: 'master'
+permissions:
+ contents: write
+
+concurrency:
+ group: cron-deploy-website
+ cancel-in-progress: false
+
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: Production
+ env:
+ DORIS_ENABLE_JA: 'true'
steps:
- name: Checkout
uses: actions/checkout@master
with:
persist-credentials: false
submodules: recursive
+ ref: ${{ inputs.branch }}
- name: Add Chinese Fonts
run: |
@@ -60,7 +70,14 @@ jobs:
cp .asf-site.yaml ./build/.asf.yaml
cp versions.json ./build/
ls build
- export DORIS_COMMIT=`git rev-parse HEAD`
+ echo "DORIS_COMMIT=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
+
+ - name: Verify Japanese publishing artifact
+ if: env.DORIS_ENABLE_JA == 'true'
+ run: |
+ test -s build/ja/index.html
+ node scripts/i18n/verify-static.cjs \
+ --site build --manifest .i18n-build/manifests/ja.json
- name: Upload files to OSS
id: oss-upload
@@ -117,7 +134,9 @@ jobs:
with:
github_token: ${{ github.token }}
publish_branch: asf-site
- force_orphan: true
+ # Preserve the live root site while replacing this preview
+ # subdirectory. Orphaning would discard the other paths.
+ force_orphan: false
publish_dir: ./build
destination_dir: ${{ github.event.inputs.branch }}
user_name: 'github-actions[bot]'
diff --git a/scripts/i18n/__tests__/t04.test.cjs
b/scripts/i18n/__tests__/t04.test.cjs
index 7934418a964..dd334250ec4 100644
--- a/scripts/i18n/__tests__/t04.test.cjs
+++ b/scripts/i18n/__tests__/t04.test.cjs
@@ -18,6 +18,8 @@ test('PR build scope separates content locales, shared
inputs, and retired versi
assert.equal(japanese.docs_versions,'4.x');
assert.equal(japanese.enable_ja,true);
assert.deepEqual(buildScope(['sidebars.ts'],versions).locales,['en','zh-CN','ja']);
+
assert.deepEqual(buildScope(['.github/workflows/cron-deploy-website.yml'],versions).locales,['en','zh-CN','ja']);
+
assert.deepEqual(buildScope(['.github/workflows/manual-deploy-website.yml'],versions).locales,['en','zh-CN','ja']);
assert.equal(buildScope(['versions.json'],versions).need_full_build,true);
assert.deepEqual(buildScope(['versioned_docs/version-1.2/a.md'],versions).retired,['1.2']);
assert.equal(buildScope(['i18n/ja/code.json'],versions).skip_build,false);
diff --git a/scripts/i18n/build-scope.cjs b/scripts/i18n/build-scope.cjs
index 6d2e1c67604..5ea26f492b6 100644
--- a/scripts/i18n/build-scope.cjs
+++ b/scripts/i18n/build-scope.cjs
@@ -28,6 +28,7 @@ function buildScope(files, versions) {
}
} else if ((match =
file.match(/^versioned_sidebars\/version-(.+)-sidebars.json$/))) {shared();
wanted.add(match[1]);}
else if (file === 'sidebars.ts') {shared(); wanted.add('current');}
+ else if (['.github/workflows/cron-deploy-website.yml',
'.github/workflows/manual-deploy-website.yml'].includes(file)) shared();
else if (/^(blog|community|releasenotes|course)\//.test(file))
{languages.add('en'); build();}
else if (/^sidebars(Community|Releases|Course)\./.test(file)) shared();
else if (/^(src|config)\//.test(file) ||
['docusaurus.config.js','package.json','yarn.lock','tailwind.config.js','tsconfig.json'].includes(file)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]