Skip to content

ci: unified docs orchestrator workflow and metadata sync script#26285

Open
mrpollo wants to merge 35 commits intomainfrom
mrpollo/docs_metadata
Open

ci: unified docs orchestrator workflow and metadata sync script#26285
mrpollo wants to merge 35 commits intomainfrom
mrpollo/docs_metadata

Conversation

@mrpollo
Copy link
Contributor

@mrpollo mrpollo commented Jan 15, 2026

Summary

Consolidates 7 docs-related workflows into a single orchestrator and replaces 6 metadata scripts with a unified metadata_sync.sh.

Architecture

PR Flow:

Link Check → Build Site → DONE

Push Flow (main/release branches):

Regenerate Metadata → Build Site → Deploy to AWS → Crowdin Upload
        ↓
  (auto-commit if changes)

Changes

New unified metadata script (Tools/ci/metadata_sync.sh):

  • Handles all 6 metadata types: parameters, airframes, modules, msg_docs, uorb_graphs, failsafe_web
  • Modes: --generate, --sync, --verbose
  • Pinned Emscripten to 3.1.64
  • Consistent whitespace normalization

New docs orchestrator workflow (.github/workflows/docs-orchestrator.yml):

  • PR flow: Link checking → VitePress build validation
  • Push flow: Metadata regeneration → auto-commit → VitePress build → AWS deploy → Crowdin upload
  • All jobs on runs-on infrastructure (2cpu/4cpu with s3-cache)
  • ccache for SITL builds (250MB, compression level 6)
  • node_modules caching for VitePress

New Makefile target:

  • msg_docs - generates uORB message documentation

New documentation:

  • docs/en/test_and_ci/continous_integration.md - Documents the Docs CI pipeline

Deleted workflows (replaced by orchestrator):

  • docs_deploy.yml, docs_deploy_aws.yml, docs_flaw_checker.yml
  • docs_pr_comment.yml, docs_crowdin_upload.yml, docs_metadata_check.yml
  • failsafe_sim.yml

Deleted scripts (replaced by metadata_sync.sh):

  • metadata_parameters.sh, metadata_airframe.sh, metadata_modules.sh
  • metadata_msg_docs.sh, metadata_uorb_graph.sh, metadata_failsafe_web.sh

Kept: docs_crowdin_download.yml (separate scheduled trigger for translations)

Benefits

Before After
8 workflows 2 workflows
6 scripts 1 unified script
Manual metadata updates Auto-commit on push
Mixed infrastructure All runs-on with s3-cache

Test plan

  • PR triggers link-check job and posts comment
  • PR triggers build-site job (validates VitePress build)
  • Push to main triggers metadata-regen with ccache
  • Auto-commit created if metadata changes
  • VitePress build completes with node_modules caching
  • AWS S3 deploy succeeds
  • Crowdin upload succeeds

@github-actions
Copy link

Link Check Results

No broken links found!

@mrpollo mrpollo force-pushed the mrpollo/docs_metadata branch 3 times, most recently from 6ec679a to 1116bb8 Compare January 15, 2026 22:41
@mrpollo mrpollo requested a review from hamishwillee January 15, 2026 22:56
@mrpollo mrpollo marked this pull request as ready for review January 15, 2026 22:58
@github-actions
Copy link

No flaws found

hamishwillee
hamishwillee previously approved these changes Jan 29, 2026
Copy link
Contributor

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

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 <mrpollo@gmail.com>
check if metadata needs to be rebuilt!

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
more debug tools

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
metadata_msg_docs.sh — generate and sync uORB message reference documentation

Usage:
  Tools/ci/metadata_msg_docs.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying files
  --debug       Show full make output and debug info for file comparisons

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
metadata_parameters.sh — generate and sync PX4 parameter reference documentation

Usage:
  Tools/ci/metadata_parameters.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying file
  --debug       Show full make output and debug info for comparison

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
metadata_airframe.sh — generate and sync PX4 airframe reference documentation

Usage:
  Tools/ci/metadata_airframe.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying file
  --debug       Show full make output and debug info for comparison

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
metadata_modules.sh — generate and sync PX4 module reference documentation

Usage:
  Tools/ci/metadata_modules.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying files
  --debug       Show full make output and debug info for file comparisons

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
test is broken

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
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 <mrpollo@gmail.com>
@mrpollo
Copy link
Contributor Author

mrpollo commented Feb 4, 2026

@hamishwillee I've addressed all your comments:

  1. ✅ Prettier formatting step added before auto-commit
  2. ✅ Conditional metadata generation for PRs that touch both docs and source files
  3. ✅ Tested the version path logic locally - works correctly for main and release/* branches

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will prettier absolutely everything, not just modified files. This will affect efficiency, but it not a bad thing.

hamishwillee
hamishwillee previously approved these changes Feb 4, 2026
Copy link
Contributor

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants