ci: unified docs orchestrator workflow and metadata sync script#26285
ci: unified docs orchestrator workflow and metadata sync script#26285
Conversation
6ec679a to
1116bb8
Compare
There was a problem hiding this comment.
@mrpollo The approach looks good, however I am unable to test it effectively locally. I think it would be great to do this suggestion #26285 (comment) and then merge this and iterate.
Approving to make that possible.
9566995 to
ef1f2f4
Compare
|
@hamishwillee I've addressed all your comments:
Let me know if you're happy to merge so we can start enjoying the benefits! 🚀 |
| run: | | ||
| cd docs | ||
| yarn install --frozen-lockfile | ||
| yarn prettier --write "en/**/*.md" |
There was a problem hiding this comment.
I think this will prettier absolutely everything, not just modified files. This will affect efficiency, but it not a bad thing.
There was a problem hiding this comment.
Thanks @mrpollo - looks good. The only "issue" I can see is that prettier runs on everything, and had not been run on this PR. So decided to do it so all changes in other PRs going forwards are deltas.
We probably should run this in v1.17 too, because it's metadata is likely to be out of date.
But, there is a depencency error https://github.com/PX4/PX4-Autopilot/actions/runs/21689629726/job/62545775038?pr=26285
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
I think we can fix this by removing the json package lock file - trying that now
0ef2051 to
ae9d8a8
Compare
context: our docs need this metadata, this script generates the metadata then
moves the files to the required destination.
docs:
update_uorb_graphs.sh — generate, compare, and sync uORB graph JSONs
Usage:
./scripts/update_uorb_graphs.sh [--test-only] [--debug]
Options:
--test-only Run generation and comparison only; exit 1 if diffs found, without copying files
--debug Echo debug info for missing or differing files
Examples:
# CI mode: fail if docs need updates
./scripts/update_uorb_graphs.sh --test-only
# Developer mode: regenerate and sync JSONs
./scripts/update_uorb_graphs.sh
Signed-off-by: Ramon Roche <[email protected]>
check if metadata needs to be rebuilt! Signed-off-by: Ramon Roche <[email protected]>
more debug tools Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
test is broken Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
Add conditional metadata generation for PRs that modify both docs and source files. This fixes broken link checker reports when a PR adds a new module and documents it simultaneously - previously the link checker would fail because metadata files are only generated on push to main. Changes: - Add docs-orchestrator.yml workflow with: - detect-changes job to check if PR touches source paths - pr-metadata-regen job that generates metadata and uploads as artifact - link-check job that downloads metadata artifact when available - build-site job for VitePress site generation - deploy-aws and crowdin-upload jobs for push events - Prettier formatting step before auto-commit on push - Add Prettier for markdown formatting: - Add prettier ^3.2.0 as devDependency in docs/package.json - Add docs/.prettierrc with prose-preserving config - Remove normalize_whitespace from metadata_sync.sh (Prettier handles whitespace normalization now) Signed-off-by: Ramon Roche <[email protected]>
Regenerate yarn.lock to include prettier dependency that was added to package.json but missing from the lockfile, causing CI to fail with --frozen-lockfile. Also add package-lock.json to .gitignore since the project uses yarn. Signed-off-by: Ramon Roche <[email protected]>
Add fetch-depth: 0 to the checkout step in docs_flaw_checker.yml. Without a full clone, tj-actions/changed-files cannot find the merge base between main and the PR branch, causing the job to fail with "no merge base". Signed-off-by: Ramon Roche <[email protected]>
adds docs Signed-off-by: Ramon Roche <[email protected]>
Pass the changed files JSON through an environment variable instead of direct interpolation to avoid shell quoting issues. Signed-off-by: Ramon Roche <[email protected]>
Signed-off-by: Ramon Roche <[email protected]>
- Add [skip ci] to auto-commit message to prevent infinite workflow loop - Add source paths (src/, msg/, ROMFS/, Tools/module_config/) to push triggers so metadata regenerates on source-only changes - Move permissions from workflow-level to job-level (least privilege) Signed-off-by: Ramon Roche <[email protected]>
After a force push, GitHub evaluates path filters against only the pushed commits, not the full PR diff. Changes to the orchestrator workflow file itself were not matching the docs/** path filter, preventing the orchestrator from running on the PR. Signed-off-by: Ramon Roche <[email protected]>
Prefix job names with T1-T4 to make the execution order and dependency chain visible at a glance in the GitHub Actions UI. Signed-off-by: Ramon Roche <[email protected]>
- Update tier numbering to match T1-T4 job names - Fix PR flow diagram to show T2 jobs running in parallel - Add [skip ci] note to push flow - Separate push vs PR path trigger tables - Add workflow file to PR path triggers - Remove Crowdin from orchestrator deploy tier (separate workflow) - Update infrastructure table with correct job names Signed-off-by: Ramon Roche <[email protected]>
c27458a to
ef9c735
Compare
|


Summary
Consolidates docs CI into a single orchestrator workflow and replaces scattered metadata scripts with a unified
metadata_sync.sh.What changed
New docs orchestrator (
.github/workflows/docs-orchestrator.yml):docs_deploy_aws.yml,docs_flaw_checker.yml,docs_pr_comment.yml)[skip ci]) → T3 Build Site → T4 Deploy to AWSdocs/**+ source paths (src/**,msg/**,ROMFS/**,Tools/module_config/**)New unified metadata script (
Tools/ci/metadata_sync.sh):--generate,--sync,--verboseNew Makefile target:
msg_docs— generates uORB message documentationNew documentation:
docs/en/test_and_ci/continous_integration.md— documents the docs CI pipelineUpdated metadata (236 docs files):
Deleted workflows (replaced by orchestrator)
docs_deploy_aws.ymldocs_flaw_checker.ymldocs_pr_comment.ymlKept separately
docs_crowdin_upload.yml— separate trigger on push to maindocs_crowdin_download.yml— scheduled weekly translation downloaddocs_deploy.yml— manual GitHub Pages deployBefore / After
metadata_sync.sh[skip ci]on auto-commitsTest plan
[skip ci]and does not retrigger workflow