Skip to content

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

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

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

Conversation

@mrpollo
Copy link
Contributor

@mrpollo mrpollo commented Jan 15, 2026

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):

  • Single workflow replaces 3 separate workflows (docs_deploy_aws.yml, docs_flaw_checker.yml, docs_pr_comment.yml)
  • Jobs organized in tiers (T1-T4) with clear dependency chain
  • PR flow: T1 Detect Changes → T2 PR Metadata (conditional) + T2 Link Check → T3 Build Site
  • Push flow: T2 Metadata Sync (auto-commit with [skip ci]) → T3 Build Site → T4 Deploy to AWS
  • Job-level permissions (least privilege per job)
  • Triggers on docs/** + source paths (src/**, msg/**, ROMFS/**, Tools/module_config/**)

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 Makefile target:

  • msg_docs — generates uORB message documentation

New documentation:

  • docs/en/test_and_ci/continous_integration.md — documents the docs CI pipeline

Updated metadata (236 docs files):

  • Regenerated parameter, airframe, module, message, and uORB graph docs with latest source

Deleted workflows (replaced by orchestrator)

  • docs_deploy_aws.yml
  • docs_flaw_checker.yml
  • docs_pr_comment.yml

Kept separately

  • docs_crowdin_upload.yml — separate trigger on push to main
  • docs_crowdin_download.yml — scheduled weekly translation download
  • docs_deploy.yml — manual GitHub Pages deploy

Before / After

Before After
Workflows 4 docs workflows 1 orchestrator + 3 independent
Scripts scattered per-type scripts 1 unified metadata_sync.sh
Metadata updates manual or per-script CI auto-commit on push to main
Permissions workflow-level (broad) job-level (least privilege)
Loop protection none [skip ci] on auto-commits

Test plan

  • PR triggers orchestrator (T1 Detect Changes, T2 Link Check, T3 Build Site)
  • T2 PR Metadata correctly skips when no source files changed
  • T2 Link Check posts sticky PR comment
  • T3 Build Site passes (VitePress build)
  • Push to main triggers T2 Metadata Sync with auto-commit
  • Auto-commit includes [skip ci] and does not retrigger workflow
  • T4 Deploy succeeds (AWS S3 sync)
  • Crowdin upload triggers independently on push to main

@mrpollo mrpollo force-pushed the mrpollo/docs_metadata branch 4 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
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.

@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

@mrpollo mrpollo force-pushed the mrpollo/docs_metadata branch from 0ef2051 to ae9d8a8 Compare February 9, 2026 16:14
@mrpollo mrpollo requested a review from hamishwillee February 9, 2026 18:20
@PX4 PX4 deleted a comment from github-actions bot Feb 9, 2026
@PX4 PX4 deleted a comment from github-actions bot Feb 9, 2026
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]>
mrpollo and others added 28 commits February 9, 2026 10:25
Signed-off-by: Ramon Roche <[email protected]>
test is broken

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]>
@mrpollo mrpollo force-pushed the mrpollo/docs_metadata branch from c27458a to ef9c735 Compare February 9, 2026 18:25
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
10 Security Hotspots

See analysis details on SonarQube Cloud

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