Release Notes
v1.3 (website compatibility)
In v1.3.x, rendering is consistent for new features introduced in 2025 for PingCAP documentation website.
v1.3.2
Release date: September 5, 2025
Support replacing variables with actual values before a preview deployment.
(Internal) Fix the test utility to handle dependencies correctly.
(Internal) Refactor the
commit_changes()function insync_pr.shandsync_mult_prs.shto support custom and multiple Git commit operations.(Internal) Update unit test cases to match the changes introduced in this release.
v1.3.1
Release date: September 3, 2025
(Internal) Fix the issue that the
run_tests.ymlworkflow does not report an error when unit tests fail.(Internal) Update the unit test case for "Sync scaffold from a commit" to match the change introduced in v1.3.0.
v1.3.0
Release date: August 26, 2025
Support syncing
TOC-*.mdfiles, such asTOC-tidb-cloud-starter.mdandTOC-tidb-cloud-essential.md, when you run thesync_scaffold.shscript.This update fixes preview failures on sites with multiple tables of contents (TOCs) and improves compatibility with the multi-TOC feature in PingCAP documentation website.
v1.2 (advanced usage)
In v1.2.x, you can use some advanced features to streamline your usage.
v1.2.0
Release date: July 11, 2024
Support pruning merged preview branches using
prune_branches.ymlorprune_preview_branches.sh.Usage
Automatically prune merged preview branches
To keep your fork clean, you can automatically prune merged preview branches using
prune_branches.ymlorprune_preview_branches.sh.In your fork, manually trigger the
prune_branches.ymlworkflow for themainbranch. After the workflow runs, merged preview branches will be deleted from the remote repository.Prerequisites
Make sure that you have met the following requirements:
Install
jq.Generate a GitHub personal access token with the repo scope and set it as the
GITHUB_TOKENenvironment variable value.
Execute the
prune_preview_branches.shscript in your fork.To prune locally merged preview branches:
export DELETE_BRANCHES="local" ./prune_preview_branches.shTo prune branches in the remote repository:
export DELETE_BRANCHES="remote" ./prune_preview_branches.sh
v1.1 (scheduler management)
In v1.1.x, you can use pingcap-docsite-preview to manage preview schedules.
v1.1.0
Release date: December 6, 2023
Support maintaining continuous synchronization with pull requests using the
sync_scheduler.ymlworkflow in GitHub Actions. (close #32)Usage
Perform periodic updates
You can use the
sync_scheduler.ymlGitHub workflow to periodically update the preview content from a pull request and multiple pull requests.Suppose you have created a branch
preview/pingcap/docs/1234to preview a PR and created a branchmulti-pr-previewto preview multiple PRs. To periodically updatepreview/pingcap/docs/1234every 1 hour andmulti-pr-previewevery 6 hours, configure thesync_scheduler.ymlworkflow in your default branch as follows:name: Sync docs on schedule on: schedule: - cron: "0 */1 * * *" # every 1 hour - cron: "0 */6 * * *" # every 6 hours jobs: sync_scheduler: runs-on: ubuntu-latest permissions: contents: write actions: write env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout current repo uses: actions/checkout@v3 - name: Sync preview branch every 1 hour if: github.event_name == 'schedule' && github.event.schedule == '0 */1 * * *' run: | gh workflow run sync_pr.yml --ref preview/pingcap/docs/1234 - name: Sync preview branch (multiple PRs) every 6 hours if: github.event_name == 'schedule' && github.event.schedule == '0 */6 * * *' run: | gh workflow run sync_mult_prs.yml --ref multi-pr-previewFor more information, refer to Workflow syntax for GitHub Actions.
v1.0 (consistent rendering)
In v1.0.x, you can use pingcap-docsite-preview to preview documents with rendering that matches the PingCAP documentation website.
v1.0.0
Release date: December 5, 2023
Enhance the document rendering to maintain consistency with the PingCAP documentation website by removing all
{{< copyable "..." >}}strings in Markdown files. (close #30)
v0.4 (deployment)
In v0.4.x, you can use pingcap-docsite-preview to build the documentation website for preview.
v0.4.0
Release date: December 5, 2023
Support deploying the documentation website using the
build.shscript.Methods for deployment
To deploy your preview documentation website, you can choose one of the following methods:
Deploy your website using a cloud service, such as Vercel, Cloudflare Pages, and Netlify:
Deploy your website locally on your machine:
v0.3 (multiple pull requests preview)
In v0.3.x, you can use pingcap-docsite-preview to update the documents from multiple pull requests. This feature applies to pull requests from the following repositories:
v0.3.2
Release date: December 4, 2023
(Internal) Support running unit tests using the
run_tests.ymlworkflow in GitHub Actions. (close #26)
v0.3.1
Release date: December 4, 2023
(Internal) Support concurrently executing tests using the
test/test.pyscript. (close #24)
v0.3.0
Release date: December 4, 2023
Support synchronizing documents from multiple pull requests using the
sync_mult_prs.shscript or thesync_mult_prs.ymlworkflow in GitHub Actions. (close #18)Usage
Update from multiple pull requests
You can automatically update the preview content from multiple pull requests by creating a new branch and configuring it.
Create pull requests to the following repositories:
In your fork, create a new branch from the
mainbranch. Do not include apreviewprefix in the branch name.Update the configuration in the
sync_mult_prs.shscript:To preview the following pull requests:
pingcap/docs/1234for TiDB,pingcap/docs-cn/1234for TiDB,pingcap/docs/5678for TiDB Cloud, andpingcap/docs-tidb-operator/1234for TiDB Operator, configure as follows:./sync_pr.sh preview/pingcap/docs/1234 ./sync_pr.sh preview/pingcap/docs-cn/1234 ./sync_pr.sh preview-cloud/pingcap/docs/5678 ./sync_pr.sh preview-operator/pingcap/docs-tidb-operator/1234By default, pull requests are previewed in their respective base branches. To preview in a different version, such as v1.0, when the base branch of these pull requests is
master, configure as follows:rsync -av markdown-pages/zh/tidb/master/ markdown-pages/zh/tidb/release-1.0/ rsync -av markdown-pages/en/tidb/master/ markdown-pages/en/tidb/release-1.0/ rsync -av markdown-pages/en/tidb-in-kubernetes/master/ markdown-pages/en/tidb-in-kubernetes/release-1.0/ rsync -av markdown-pages/zh/tidb-in-kubernetes/master/ markdown-pages/zh/tidb-in-kubernetes/release-1.0/Manually trigger the
sync_mult_prs.ymlworkflow formulti-pr-previewbranch. Then, the workflow updates the content from these pull requests.
Prerequisites
Make sure that you have met the following requirements:
Install
jq.Generate a GitHub personal access token with the repo scope and set it as the
GITHUB_TOKENenvironment variable value.
Create pull requests to the following repositories:
In your fork, create a new branch from the
mainbranch. Do not include apreviewprefix in the branch name.git clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview git checkout -b multi-pr-previewUpdate the configuration in the
sync_mult_prs.shscript:To preview the following pull requests:
pingcap/docs/1234for TiDB,pingcap/docs-cn/1234for TiDB,pingcap/docs/5678for TiDB Cloud, andpingcap/docs-tidb-operator/1234for TiDB Operator, configure as follows:./sync_pr.sh preview/pingcap/docs/1234 ./sync_pr.sh preview/pingcap/docs-cn/1234 ./sync_pr.sh preview-cloud/pingcap/docs/5678 ./sync_pr.sh preview-operator/pingcap/docs-tidb-operator/1234By default, pull requests are previewed in their respective base branches. To preview in a different version, such as v1.0, when the base branch of these pull requests is
master, configure as follows:rsync -av markdown-pages/zh/tidb/master/ markdown-pages/zh/tidb/release-1.0/ rsync -av markdown-pages/en/tidb/master/ markdown-pages/en/tidb/release-1.0/ rsync -av markdown-pages/en/tidb-in-kubernetes/master/ markdown-pages/en/tidb-in-kubernetes/release-1.0/ rsync -av markdown-pages/zh/tidb-in-kubernetes/master/ markdown-pages/zh/tidb-in-kubernetes/release-1.0/Execute the
sync_mult_prs.shscript to update the content from these pull requests../sync_mult_prs.shThis script automatically synchronizes document changes from pull requests and commits them to the current branch. To update the remote branch with these changes, be sure to push the commits.
v0.2 (single pull request preview)
In v0.2.x, you can use pingcap-docsite-preview to update the documents from a pull request. This feature applies to pull requests from the following repositories:
v0.2.2
Release date: November 29, 2023
Fix the issue that
sync_pr.shfails to work when theTESTenvironment variable is unset. (close #21)
v0.2.1
Release date: November 29, 2023
Support synchronizing documents from a pull request using the
sync_pr.ymlworkflow in GitHub Actions. (close #19)Usage
Create a pull request to one of the following repositories:
In your fork, create a new branch from the
mainbranch following these naming conventions:Documentation
Branch naming convention
preview/pingcap/docs/{PR_NUMBER}preview/pingcap/docs-cn/{PR_NUMBER}preview-cloud/pingcap/docs/{PR_NUMBER}preview-operator/pingcap/docs-tidb-operator/{PR_NUMBER}The
sync_pr.ymlworkflow is automatically triggered to update the content from the pull request.
v0.2.0
Release date: September 21, 2023
Support synchronizing documents from a pull request using
sync_pr.sh. (close #16)Usage
Prerequisites
Make sure that you have met the following requirements:
Install
jq.Generate a GitHub personal access token with the repo scope and set it as the
GITHUB_TOKENenvironment variable value.
Create a pull request to one of the following repositories:
In your fork, create a new branch from the
mainbranch following these naming conventions:Documentation
Branch naming convention
preview/pingcap/docs/{PR_NUMBER}preview/pingcap/docs-cn/{PR_NUMBER}preview-cloud/pingcap/docs/{PR_NUMBER}preview-operator/pingcap/docs-tidb-operator/{PR_NUMBER}git clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview git checkout -b preview/pingcap/docs/{PR_NUMBER}Execute the
sync_pr.shscript to update the content from the pull request../sync_pr.shThis script automatically synchronizes document changes from the pull request and commits them to the current branch. To update the remote branch with these changes, be sure to push the commit.
v0.1 (scaffold synchronization)
In v0.1.x, you can use pingcap-docsite-preview to synchronize the scaffold from pingcap/docs-staging.
v0.1.7
Release date: September 21, 2023
(Internal) Refactor the test framework to support testing shell scripts using a configuration file
test_config.toml. (close #12)Usage
To test a shell script, follow these steps:
Define the test configuration in
test_config.toml. For example, to test thesync_scaffold.shscript, configure as follows:[sync_scaffold] diff_command = "diff -qrs data actual --exclude temp --exclude '*.log' --exclude sync_scaffold.sh" test_target = "sync_scaffold.sh" [[sync_scaffold.test_cases]] name = "Sync scaffold from a commit" args = "265874160aec258f9c725b0e940bc803ca558bda" directory = "test/sync_scaffold/"Run the test using
python3 test/test.py:$ python3 test/test.py Running Tests... 100%|█████████████████████████████████████████████████████████████████████████████| 1/1 [00:18<00:00, 18.78s/it] --------------------------------------------------Test Results-------------------------------------------------- ✅ Test Sync scaffold from a commit passed successfully Tests passed: 1 of 1 18.80s ----------------------------------------------------------------------------------------------------------------
v0.1.6
Release date: September 1, 2023
Fix the issue that the "failed to push some refs" error is reported in GitHub Actions when multiple workflows are queued. This issue is fixed by adding
concurrencyand introducing a newgit_push.shscript. (close #13)
v0.1.5
Release date: August 21, 2023
Support synchronizing the scaffold from a specified branch or a commit to ensure the test repeatability. (close #5)
Usage
git clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview ./sync_scaffold.shgit clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview ./sync_scaffold.sh $BRANCHgit clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview ./sync_scaffold.sh $COMMIT
v0.1.4
Release date: August 21, 2023
Introduce the
TESTenvironment variable to control whether to ignore thegit commitcommand in thesync_scaffold.shscript. This enhancement aims to avoid unnecessary commits during test script execution. (close #6)(Internal) Support setting environment variables in the test framework
test_util.py. (close #7)Exclude empty directories when executing
sync_scaffold.shusing thersync --prune-empty-dirsoption. (close #8)
v0.1.3
Release date: July 2, 2023
Fix the "fatal: not in a git directory" error that occurs when executing the
git config user.namecommand during step 4 of thesync_scaffold.ymlworkflow. (fixed by #3)Fix the issue that the
git add .command exits with an error "The following paths are ignored by one of your .gitignore files". This command is now modified togit add . || true, allowing it to continue even if it encounters ignored files. This effectively bypasses the error and prevents the command from terminating unexpectedly. (fixed by #4)
v0.1.2
Release date: July 2, 2023
Support synchronizing the scaffold using the
sync_scaffold.ymlworkflow in GitHub Actions.Usage
Update the scaffold in GitHub Actions
In your fork, the
sync_scaffold.ymlworkflow can be manually triggered (workflow_dispatch) or automatically triggered every 15 days (0 0 */15 * *) by default.on: workflow_dispatch: schedule: - cron: "0 0 */15 * *"To modify the schedule event or add more events to trigger the workflow, you can adjust the value of
onin thesync_scaffold.ymlfile.For more information, see Events that trigger workflows.
v0.1.1
Release date: July 2, 2023
(Internal) Introduce a test framework
test_util.pyto enhance the reliability and efficiency ofpingcap-docsite-preview.Key features
DocSitePreviewTest._setup_test_env(): clean up the test environment, copy the target script to the test environment, and ensure that the script can be executed.DocSitePreviewTest.execute(): execute the target script in the test environment and save the output in thetest/.../actualdirectory.DocSitePreviewTest.verify(): compare the actual output (test/.../actual) with the expected output (test/.../data).
For more details, see this blog.
Add a specific test for the
sync_scaffold.shscript:Expected output:
test/sync_scaffold/data/Test program:
test/sync_scaffold/test_sync_scaffold.py
v0.1.0
Release date: July 2, 2023
Support synchronizing the scaffold with the latest version of
pingcap/docs-stagingusing thesync_scaffold.shscript.Concept
In the
pingcap-docsite-previewcontext, scaffold refers to a specific set of elements synchronized frompingcap/docs-staging. These elements are crucial for the structure and navigation of the documentation website. It contains the following elements:Version selection: the
docs.jsonfileTable of contents: all
TOC.mdfiles in themarkdown-pagesdirectoryIndex pages: all
_index.mdfiles in themarkdown-pagesdirectoryHomepage: all
_docHome.mdfiles in themarkdown-pagesdirectory
Usage
After executing the
sync_scaffold.shscript, it updates themarkdown-pages/directory and thedocs.jsonfile.git clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview git checkout v0.1.0 ./sync_scaffold.shCloning into 'temp/docs-staging'... remote: Enumerating objects: 13567, done. building file list ... done created directory markdown-pages ./ en/ en/tidb-in-kubernetes/master/TOC.md en/tidb-in-kubernetes/master/_index.md en/tidb-in-kubernetes/release-1.2/TOC.md en/tidb-in-kubernetes/release-1.2/_index.md en/tidb/master/TOC.md en/tidb/master/_docHome.md en/tidb/master/_index.md en/tidb/release-4.0/TOC.md en/tidb/release-4.0/_index.md en/tidbcloud/master/TOC.md ja/ ja/tidb/release-5.4/TOC.md ja/tidb/release-5.4/_index.md ja/tidbcloud/master/TOC.md zh/ zh/tidb-in-kubernetes/master/TOC.md zh/tidb-in-kubernetes/master/_index.md zh/tidb/master/TOC.md zh/tidb/master/_docHome.md zh/tidb/master/_index.md sent 2054843 bytes received 5750 bytes 1373728.67 bytes/sec total size is 2032431 speedup is 0.99 98 files changed, 37294 insertions(+) create mode 100644 docs.json create mode 100644 markdown-pages/en/tidb-in-kubernetes/master/TOC.md ... create mode 160000 temp/docs-stagingThis script modifies the repository as follows:
$ tree . . └── sync_scaffold.sh 0 directories, 1 file$ tree . -L 4 . ├── docs.json ├── markdown-pages │ ├── en │ │ ├── tidb │ │ │ ├── master │ │ │ ├── release-4.0 │ │ │ ├── release-5.0 │ │ │ ├── release-5.1 │ │ │ ├── release-5.2 │ │ │ ├── release-5.3 │ │ │ ├── release-5.4 │ │ │ ├── release-6.1 │ │ │ ├── release-6.5 │ │ │ ├── release-7.1 │ │ ├── tidb-data-migration │ │ │ └── release-5.3 │ │ ├── tidb-in-kubernetes │ │ │ ├── master │ │ │ ├── release-1.2 │ │ │ ├── release-1.3 │ │ │ ├── release-1.4 │ │ └── tidbcloud │ │ └── master │ ├── ja │ │ ├── tidb │ │ │ ├── release-5.4 │ │ │ ├── release-6.1 │ │ │ ├── release-6.5 │ │ │ └── release-7.1 │ │ └── tidbcloud │ │ └── master │ └── zh │ ├── tidb │ │ ├── master │ │ ├── release-4.0 │ │ ├── release-5.0 │ │ ├── release-5.1 │ │ ├── release-5.2 │ │ ├── release-5.3 │ │ ├── release-5.4 │ │ ├── release-6.1 │ │ ├── release-6.5 │ │ ├── release-7.1 │ ├── tidb-data-migration │ │ └── release-5.3 │ └── tidb-in-kubernetes │ ├── master │ ├── release-1.2 │ ├── release-1.3 │ ├── release-1.4 ├── sync_scaffold.sh └── temp └── docs-staging ├── ... 65 directories, 15 files
