Commit Graph
79 Commits
Author SHA1 Message Date
Jacob Dahl e1c28e2755 feat(ci): post the AI review as a verdict and one line per finding
The AI review on #29008 ran to about 900 words for two process gaps and three nits, and its "changes suggested" verdict came from the process gaps alone, so a maintainer could not tell whether the code needed anything. The PR now gets a verdict decided by code findings only and one sentence per posted finding. The evidence, the model's summary, the checklist and nits stay in the job summary, which the review links to.

Assisted-by: Claude:claude-opus-5-5
2026-10-10 13:58:21 +02:00
Jacob Dahl a4697ed08e ci(clang-tidy): stop false positives in the inline review comments (#29013)
* ci(clang-tidy): stop false positives in the inline review comments

Of the 828 inline comments the clang-tidy job posted on 98 PRs since May, only 328 were unique: COMMENT reviews can't be dismissed, so every push posted every finding again. Most of the rest were artifacts of how the diff step runs:

- It parses against the test build dir, which is only configured, so the uORB, events and parameter headers don't exist and every TU stops at a missing include. clang-tidy then reports on the half-parsed AST: events::send<T>(...) as a chained comparison, sizeof on uORB arrays as sizeof of a pointer.
- It parses every changed .h on its own as C++, including board configs, NuttX headers and headers shared with C. The gating run never lints .h.
- .clang-tidy disabled macro-parentheses, incorrect-roundings and misplaced-widening-cast under their old misc- names, which clang-tidy 18 no longer knows, so all three were on.

Generate the test dir's headers, skip .h and board/NuttX files, drop clang-diagnostic-error (the build jobs report real compile errors), skip findings already posted on the PR, and disable four checks that only produced noise: googletest underscore names, virtual-class-destructor on gtest fixtures and singletons, suspicious-call-argument, and not-null-terminated-result on binary packet buffers.

Assisted-by: Claude:claude-opus-5-5

* ci(clang-tidy): keep the gating checks and skip the fuzztest header

.clang-tidy also configures the gating run, which enabled incorrect-roundings, macro-parentheses and virtual-class-destructor on purpose, with code fixes. Drop the stale misc- names instead of renaming them, and turn virtual-class-destructor, suspicious-call-argument and not-null-terminated-result off for the inline comments only.

Header generation also built fuzztest's json_grammar.h, which pulls in abseil and the antlr4 runtime: 336 ninja edges and 39 s in CI instead of 22 edges and 4 s.

Match already-posted comments on the line too, so a second finding with the same message elsewhere in a file is still posted. Drop only headers under boards/ and platforms/nuttx/, so SITL's own board sources are still linted.

Assisted-by: Claude:claude-opus-5-5
2026-10-06 19:52:54 -06:00
Ramon Roche a9a86dad76 feat(ci): show the AI review among the PR's checks
Comment-triggered runs belong to main, so GitHub never lists them in the
PR's checks and the only sign of a running review is a reaction on the
comment. Set an informational "AI PR Review" commit status on the PR
head, linking to the run: pending when the gate accepts, then success or
error. A run cancelled by a newer review of the same commit leaves the
newer run's status alone.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 19:38:09 -07:00
Ramon Roche 1ca4506927 feat(ci): show the cost of each AI review on the PR
The review footer now ends with the run's cost, model, number of model
calls and wall time, for example "Cost: $7.42 · Claude Opus 5.5 · 12
model call(s) · 22 min"; a refusal notice shows what was spent before
the refusal. The cost is Claude Code's own estimate at list prices,
which matched a recomputation from token counts on Bedrock. Making the
price visible on every review also discourages casual re-runs.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 16:33:32 -07:00
Ramon Roche 95e2802baf feat(ci): add the AI pull request review tool
Tools/ci/ai_review reviews a PR with Claude Code on Amazon Bedrock and
writes a pr-review artifact for pr-review-poster.py.

- Pipeline: gather (metadata, linked issues, commits, CI status, per-file
  patches, earlier comments), a reviewer pass returning line findings,
  PR-level findings and a contribution checklist, an independent
  validator pass per finding, and code-owned routing: inline only at high
  confidence, otherwise a before-merge list or a collapsed section. No PR
  is skipped for size; generated files are listed but not diffed.
- Trust: the PR is untrusted data. The agent runs --bare --restricted
  with read-only tools. Code it writes to check its math runs only in a
  px4-dev container (no network, no credentials, read-only checkout,
  gVisor in CI), and `harden` blocks the runner's metadata service first.
  Output containing a credential is never written.
- A model refusal produces no review and passes the provider's exact
  reason, category and request ID through.
- Models and per-role defaults live in models.json; models-check verifies
  access before switching.
- Process checks (tests, description, upgrade notes, docs) live in a
  CI-only prompt so the interactive skill stays lean.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 15:50:14 -07:00
Ramon Roche 5bcf3fc2ac feat(ci): add opt-in summary and supersede modes to the PR review poster
Two optional manifest fields for producers that need them:

- post_without_comments posts the summary as a COMMENT review even when
  there are no inline comments.
- supersede_previous replaces the body of the producer's earlier COMMENT
  review with a superseded note, keeping the old text collapsed, since
  GitHub cannot dismiss COMMENT reviews.

Both default to false, which is the behaviour clang-tidy relies on. Adds
the poster's first unit tests, including ones that pin the defaults.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-10-02 15:50:14 -07:00
Jacob Dahl 42ce28a986 ci(labeler): apply at most one scope label per PR (#28965)
actions/labeler adds every scope whose globs match any changed file, so a PR touching a test, a param file and a board config collects a pile of scope labels (2.6 per PR on average over the last 300, up to 20) and nobody reads them. A scope label is only useful when it names the core of the PR.

The title's conventional-commit scope already states that core, so the scope label now comes from it, resolved to an area of the tree; the diff decides only when the title names nothing. Each file belongs to one scope, and labels this workflow added earlier are removed when they stop matching. scope:testing, scope:uorb, scope:middleware and scope:logging are no longer applied.

Assisted-by: Claude:claude-opus-5-5
2026-10-01 20:42:03 -06:00
Jacob Dahl d5223850dd docs(contributing): discourage force-pushing during review (#28931)
* docs(contributing): discourage force-pushing during review

A force-push after review has begun erases the commits a reviewer has read, so they cannot see what changed since. The guidance told contributors to squash and reword instead, which contradicts the commit and pr agent skills. PRs are typically squash-merged, so branch history does not need cleaning up before merge.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* ci(workflows): remove commit message check

PRs are squash-merged under the PR title, which is still checked. Flagging the individual commits pushed contributors to rewrite history mid-review.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-30 11:04:19 -06:00
Ramon Roche ec2687abc3 ci(usb-ids): check board USB IDs on PRs that change them
The workflow triggers on pull requests that touch a board defconfig or
the USB ID tooling, and checks only the defconfigs the PR adds or
modifies. The file list comes from diffing the checked-out PR merge
commit against its base parent, so no API call or token is needed. A PR that changes the tooling itself is checked against every
board, so a checker change is proven on the real tree and not only by
its unit tests. A test keeps the tooling list and the workflow paths
filter in sync.

A manual run checks every board. There is no push or scheduled run: the
registry repo checks its own changes against PX4 main, and board
changes reach main only through PRs.

The mypy and flake8 step for the checker and runner lives in
python_checks.yml with the other Python tooling checks.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 14:44:48 -07:00
Ramon Roche 89549434e8 ci(usb-ids): add a checker for board USB IDs against the Dronecode registry
Boards that ship the Dronecode USB vendor ID 0x3643 must use a product
ID allocated in the Dronecode/usb-ids registry, and nothing in the tree
enforces that. A board reusing another board's PID, or picking an
unallocated one, becomes ambiguous to host tools that identify boards
by VID/PID.

The contract is the registry mapping: a defconfig under
boards/<vendor>/<board>/ using VID 0x3643 must use a registered PID
whose px4_board is exactly <vendor>/<board>. The USB vendor string is
deliberately not checked, since the registry does not govern it. Boards
on other vendor IDs are ignored.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 14:44:48 -07:00
Ramon Roche 89c68cd37f ci(build-all): build two targets per job concurrently
Each build job compiled its group one target at a time, and the serial
parts of every build (configure, the NuttX make, linking) left the 4-vCPU
runners about half idle. Two concurrent builds keep them around 80% busy
and cut total build-step time about 24% and runner cost about 17%.
Larger runners and more slots were measured and cost more than they save.

build_all_runner.py replaces build_all_runner.sh. NuttX compiles inside
its source tree, so each extra slot is a git worktree under .build_slots/.
All submodules are fetched once before building, each slot clones them
locally from the checkout, and builds run with GIT_SUBMODULES_ARE_EVIL=1
so CMake's per-configure submodule check does not sync and update them
concurrently on the shared .git/config. Targets that write the same
build/ directory (<board>_deb with <board>_default, the metadata targets
with px4_sitl_default) always share a slot, and the runner refuses a plan
that would split them. Every target is built even after a failure. Build
output streams with a [seconds|slot target] prefix, each target prints its
memory usage or, on failure, the excerpt from the first error, and a Build
Logs step prints each target's full log as one collapsed group. Slot build
directories are moved into build/, so packaging is unchanged.

The matrix now carries targets as a list plus a slot count from
build_all_config.yml; the comma-joined string existed only because
workflow expressions could not pass an array to a shell command, which
join() now does. The scan job runs new tests for the generated matrix and
the slot assignment.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-28 09:45:09 -07:00
Ramon Roche a8b0e91ebe feat(setup): install macOS Gazebo from a locked conda-forge environment
Homebrew rebuilds and drops the gz bottles whenever homebrew-core bumps
protobuf or abseil, which breaks the macOS Gazebo install until the pins
catch up. conda-forge keeps every package it has published, so
Tools/setup/macos/pixi.toml and its lock install the same gz, protobuf,
abseil, OpenCV and GStreamer binaries until the lock is updated on
purpose. OpenCV is the headless build, and GStreamer brings the good,
bad and ugly plugin sets the gz camera plugin's pipeline uses.

macos.sh installs the environment with pixi and loads it from the venv
activation through a small script, since pixi shell-hook would export
the installing shell's PATH. The build and the gz launch do not depend
on that activation: CMake searches the environment like it pins the
.venv Python, and px4-rc.gzsim sources gz_env.sh before it looks for
gz, which loads the environment when it is not already active and puts
its lib dir ahead of Homebrew's in the dyld fallback path.
conda-forge's gz-transport13 does not pull in cppzmq, so the manifest
lists it.

The osrf/simulation pin, the protobuf pin and the weekly bot that
refreshed them are removed. The homebrew-core commit moves into
homebrew-pins.txt unchanged.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-26 15:12:00 -07:00
Jacob Dahl 253479bbeb feat(ci): report flash and RAM use against capacity, analyze fmu-v2 (#28838)
* feat(ci): report flash and RAM use against capacity, analyze fmu-v2

The size comment showed only the delta, which does not say how close a target is to its limit. Capacity comes from the board's own linker script, because the flash-analysis build links against an oversized flash region so that a change which overflows still gets a report.

fmu-v2 adds an F4 next to the F7 and H7 targets, and with 1 MB of flash it is the FMU that overflows first.

Assisted-by: Claude:claude-opus-5-5

* fix(ci): shorten the size comment's usage columns

Five columns with capacities spelled out made the table too wide to read at a glance.

Assisted-by: Claude:claude-opus-5-5
2026-09-24 17:54:56 -06:00
Jacob Dahl 2ec03ff1c3 fix(ci): skip the flash comment for sub-30 B deltas and agent-doc changes (#28806)
The commit hash compiled into px4_firmware_version_binary() changes its code size, so a PR with no code change reported -8 B on v6x and got a comment. Changes that only touch agent instructions also no longer build the targets.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-22 17:52:55 -06:00
Jacob Dahl 1d761cdf2e fix(ci): report flash and static RAM usage separately (#28789)
* fix(ci): report flash and static RAM usage separately

Bloaty's VM total includes zero-initialized RAM and understates the combined cost of data and code copied from flash into RAM. Report the flash load image and static RAM allocations independently so the PR headline reflects each resource's actual change.

Assisted-by: Codex

* docs(ci): trim memory analysis comment

Assisted-by: Codex

* fix(ci): diff PR flash usage against the merge commit's base

The base branch tip is fetched when the job runs, so a PR merged while its job was queued was compared against itself and reported a near-zero change, and commits landed in the meantime showed up as reverted.

* fix(ci): measure flash image from section headers

ld maps the ELF header into the first LOAD segment when its max page size exceeds the flash origin's alignment (binutils 2.34 defaults to 64 KiB), so segment-based accounting rejected valid firmware as outside the flash region.

* feat(ci): flag notable flash and RAM changes

Growth over 100 B and 1000 B gets yellow and red markers, savings over 100 B green, so reviewers can spot size regressions without reading the numbers.

* refactor(ci): derive flash and RAM totals without per-target constants

The matrix duplicated each board's flash-analysis linker region, which would drift silently. Section headers alone distinguish code executing in place (VMA == LMA) from data copied to or reserved in RAM, and the image span matches objcopy -O binary.

* fix(ci): limit the bloaty breakdown to VM sizes

Debug, symbol and string table rows only change the file size and made up most of the comment.

* fix(ci): post flash analysis only when size changes

A push that puts flash and static RAM back to zero was still rewriting the sticky comment, so a PR with no size change carried a zero report. Remove that comment instead. Fork tokens cannot delete it, so those PRs hand a delete artifact to the poster.

Assisted-by: Grok:grok-4.7
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ci): retain zero-delta flash analysis comments

Existing reports can be updated when size deltas return to zero, avoiding a separate privileged deletion path.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Assisted-by: Codex:gpt-6

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-22 16:56:58 -06:00
Jacob Dahl fbfc1386ee ci(macos): install from pinned Homebrew commits
The job ran brew update and then installed whatever Homebrew was publishing, except Gazebo, which stayed on one commit. Those were built against different protobufs, so a release upstream failed the build with no commit here. Check the package repos out at commits recorded in the tree and do not update them. Run on macos-15 only, so the OS label cannot move either.

Assisted-by: Grok:grok-4.7
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-21 16:55:31 -07:00
Jacob Dahl 49339b843f ci(macos): remove the MacOS workflows
The build runs brew update and then pours Gazebo from one pinned tap commit while the rest of the install, including protobuf, comes from current Homebrew. A release in either repo fails the check with no commit here, and the GitHub-hosted image moves on its own, so the job cannot be a closed set. Drop the build and the weekly pin refresh. The setup script, the pins, and the refresh script stay for local use.

Assisted-by: Grok:grok-4.7
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-21 16:55:31 -07:00
Julian Oes 1d7b23e198 build(macos): pin protobuf to what the gz bottles need (#28774)
Every gz .pb.h refuses to compile against anything but the exact protobuf
its gencode came from, so the bottles gz-tap-pin.txt holds osrf/simulation
at only build against the protobuf homebrew-core shipped the day OSRF built
them. homebrew-core moves protobuf on its own schedule and OSRF rebuilds
days later, so `make px4_sitl` has been failing on macOS on every branch
since homebrew-core shipped protobuf 36.2.

Pin protobuf as well, to the homebrew-core revision that installs the
version the pinned gz bottles carry, and derive that pin from the bottles
themselves so the two can never disagree. A protobuf release then becomes a
no-op here instead of days of red CI while OSRF catches up.

The pinned install has to run after the other simulation packages and with
the dependents check off: opencv@4 depends on protobuf too, brew resolves a
dependency against the versions recorded in the dependent's bottle, and it
reinstalls dependents whose linkage it has just broken. Pinning the formula
with `brew pin` is not an option either, brew then refuses to install
anything that depends on it.

Assisted-by: Claude:claude-opus-5

Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-22 10:15:13 +12:00
Ramon Roche 6f93287fdd ci(macos): rewrite gz tap pin refresh in Ruby under brew ruby
The bash version spent most of its lines on plumbing: parsing a report
back out of a per-commit `brew ruby` child, awk and herestrings for set
logic, bash 3.2 workarounds, and a trap to restore the tap. The job
itself is small and lives inside Homebrew anyway, so run the whole thing
under Homebrew's Ruby and call its tap, formula and bottle APIs directly.

One process instead of one Homebrew startup per candidate commit, the
tap checkout restored by ensure, tarballs checked with Net::HTTP, and no
second language embedded in a string. Formulary.clear_cache and
Tap#clear_cache between checkouts keep each candidate's formulae fresh.
GITHUB_OUTPUT still arrives because brew forwards GITHUB_* whenever CI
is set. Same walk, same exemption for formulae unbottled at the pin,
same outputs; verified to pick the same commit as the bash version.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-04 13:26:30 -07:00
Ramon Roche 045f249929 ci(macos): move gz tap pin refresh into a script that checks bottles
The weekly refresh workflow carried its logic inline, compared only the
tap SHA against the pin, and duplicated the --sim-tools package list.
`brew install --dry-run` never prints "from source", so its bottle check
could not fire.

Tools/ci/refresh_gz_tap_pin.sh now owns the job and the workflow calls
it. It reads the osrf/simulation formulae from macos.sh, walks the tap
from HEAD back to the pin, asks Homebrew at each commit whether every
formula in the runtime closure has a bottle for the host, HEAD-requests
each tarball, and rewrites the pin to the first commit that passes.
Formulae with no bottle at the current pin (the gz-harmonic
meta-formula, which OSRF never bottles) are not required.
peter-evans/create-pull-request opens or updates the bot PR from the
script's outputs, so an unmerged bump is refreshed instead of duplicated.

The job runs on macos-15, the oldest macOS in compile_macos.yml, because
Homebrew pours an older macOS bottle onto a newer one, not the reverse.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-04 13:26:30 -07:00
Jacob Dahl 9338031b11 fix(ci): attach FMU bootloader .bin to GitHub releases (#28495)
* fix(ci): attach FMU bootloader .bin to GitHub releases

Releases only shipped `_bootloader.px4`, the USB uploader envelope. SWD recovery needs the raw `.bin` at 0x08000000.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ci): do not attach unused bootloader .px4

USB flashing would write it into the application slot. SWD uses the raw .bin.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ci): omit bootloader SBOMs from GitHub releases

GitHub Releases glob artifacts/**/*.sbom.spdx.json. Bootloader metadata dirs are not a recovery artifact.

*_bootloader_* variants (e.g. bootloader_secureboot) stay omitted: those images are baked with in-tree test keys.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* docs(bootloader): point SWD recovery at the release .bin

Match the cannode pre-built blurb. The .px4 envelope is not the SWD image.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* docs(bootloader): scope release .bin to SWD programmers

gdb load needs ELF program headers. The release image is a raw .bin for ST-Link / CubeProgrammer / OpenOCD, and only in-tree *_bootloader targets are attached.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-01 14:41:26 -06:00
Jacob Dahl 3969a1b8ff fix(ci): publish flashable CAN node firmware (#28445)
* fix(ci): publish flashable CAN node firmware

Release packaging only collected .px4 files, which the DroneCAN bootloader cannot flash.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ci): attach canbootloader .bin as the SWD image

The cannode bootloader is a raw .bin for st-flash, not a .px4 envelope.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ci): drop cannode.zip from release assets

The target-named .uavcan.bin and _canbootloader.bin files are the flashable images; the zip only duplicated them.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-28 22:17:34 -06:00
Ramon Roche d0487fc844 ci(build-all): seed ccache only for chip families with cold caches (#28278)
* ci(build-all): seed ccache only for chip families with cold caches

Measured across recent runs, the seeder stage contributes nothing in
steady state: all 264 build-job cache restores in the 8 most recent
successful runs came from group-level caches, zero from seeder caches,
yet the stage gates the build matrix for ~3.4 min of every run's
critical path and burns ~22 8cpu-runner-minutes warming caches nobody
reads. Its fail-fast value is similarly thin: 2 of the last 40 failed
runs failed at seed stage; the other 34 passed seeding and failed in
the matrix anyway.

Probe each family's ccache namespace in the RunsOn cache bucket from
the group_targets job and emit only cold families into the seed
matrix. Warm runs skip the stage entirely (the matrix starts right
after the scan); a cold family still seeds first and gates the matrix,
which is the one case the warmup pays for. The probe fails open: if
the bucket env, the listing, or the assumed object layout is wrong,
every family reads as cold and the workflow behaves exactly as before.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci(build-all): fail open when seeder probe output is unparseable

The has_cold computation ran unguarded under bash -e: malformed probe
output would fail the whole workflow instead of falling back to the
full seeder matrix. Guard it so every failure path degrades to seeding
everything, on RunsOn and on downstream forks without it alike.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci(build-all): move seeder probe logic into the helper script

The probe step carried fail-open shell logic inline in the workflow.
Move output writing, has_cold computation, and all fail-open handling
into filter_cold_seeders.py; the workflow step is now a single script
invocation. The script always exits zero and degrades every failure
(missing bucket env, aws error, unparseable input) to the full seeder
matrix.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci(build-all): probe the magic cache's real object layout

The first probe guessed cache/{key} for the magic-cache object layout
and read every family COLD, degrading to unconditional seeding. The
real layout is cache/v1/{org}/{repo}/{ref}/{version-hash}/{cache-key};
the version hash is the actions/cache digest and not knowable a
priori, so list the default-branch scope once (main-scope caches are
visible to every ref) and match cache-key basenames. Verified locally
against the live bucket: all 10 families read warm and the seed stage
skips.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci(build-all): single-source ccache key roots in the matrix generator

The ccache key convention was encoded three times: hand-assembled in
the workflow's restore/save steps, again in the seeder's
cache-key-prefix argument, and a third time in the probe script. Drift
between them is silent thanks to the probe's fail-open design: a
renamed key scheme would read every family COLD forever and quietly
revert to unconditional seeding.

Mint the namespace root once in generate_board_targets_json.py as
cache_prefix on every group and seeder matrix entry, with seeders
occupying the reserved 'seeder' group inside their family namespace.
The workflow composes {cache_prefix}-{group}-{ref}-{sha} from matrix
fields only, and the probe greps the root it is handed, knowing
nothing of the format. Composed keys are byte-identical to the old
scheme (asserted for all 33 groups and 10 seeders), so no cache is
invalidated.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-08-18 13:36:37 -07:00
Ramon Roche f8e1d1a899 ci(build-all): drop per-job pynacl install, bump container to v1.18.0-beta2
The pynacl install step from #27237 was a stopgap until the build
container shipped pynacl preinstalled. That happened in #27237 itself:
it added pynacl to Tools/setup/requirements.txt, which dev_container.yml
bakes into the image, so v1.18.0-beta1 and later already ship it. Only
the v1.17.0-rc2 pin here kept the step alive: 30+ unpinned PyPI pulls
per workflow run that already cost us a matrix job to PyPI 502s.

Verified by building px4_fmu-v6x_secureboot locally in
px4io/px4-dev:v1.18.0-beta2: the signing step runs against the baked-in
pynacl with no pip install. The voxl2 container keeps its own pin and
needs no fallback since only CONFIG_BOARD_SECUREBOOT targets (NuttX
platform only) invoke the signing script.

Expect one cold ccache run after merge: the new container's compilers
invalidate all caches at once via compiler_check = content.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-08-18 09:44:18 +09:00
Ramon Roche 9e3f88f7ef fix(ci): align voxl2 group chip family with its seeder cache key
The voxl2 build group carried chip_family 'native' while its seeder
carried 'voxl2', so the group restored/saved under
ccache-native-x64-voxl2-0-* while the seeder saved under
ccache-voxl2-x64-seeder-*. The restore-keys chain can never cross that
namespace gap: the seeder's warm cache is discarded every run, and cold
builds fall back to the SITL seeder cache (host gcc objects, zero
possible hits against aarch64-linux-gnu-gcc or hexagon-clang). Present
since #27050.

Give the voxl2 group chip_family 'voxl2' so it shares the seeder's key
namespace, drop the now-redundant voxl2 special-casing in seeder
generation, and size the voxl2 cache at 800M since it holds objects for
two toolchains (aarch64-gnu + hexagon-clang) and already sits near the
400M limit.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-08-18 08:24:06 +09:00
Eric Katzfey 570af388f6 feat(tools): add ELF dynamic import checker
Add a host-side utility that reads strong undefined dynamic symbols
from an ELF. Validate imports against symbols supplied by provider
files and ELFs, and reject imports matching configured ownership
prefixes.

Assisted-by: OpenAI:Codex
2026-08-08 16:11:33 -07:00
Ramon Roche eba76cbb69 fix(ci): restore board target matrix generation after zenoh Kconfig change
Since b11e615810 src/modules/zenoh/Kconfig sources the generated topic
catalog through ZENOH_KCONFIG_TOPICS, which only cmake exports, so every
standalone Kconfig parse crashed and build_all_targets produced an empty
build matrix on every run while the scan job still reported success.

Add Tools/kconfig/loadconfig.py as the single entry point for parsing
the Kconfig tree outside cmake: it generates the topic catalog exactly
like cmake/kconfig.cmake and provides shared board/target enumeration
and config loading. Port generate_board_targets_json.py (CI matrix) and
updateconfig.py (make updateconfig) to it; both were independently
broken and each reimplemented board scanning on its own.

Harden the workflow so the next failure of this class is loud: run the
generator as a standalone assignment, so bash -e fails the step (the
previous echo "matrix=$(...)" form masked the exit code), and write
the JSON outputs through the heredoc GITHUB_OUTPUT form.

Matrix output verified byte-identical to the pre-b11e6158101 baseline
in all three modes; updateconfig output verified identical against the
same baseline.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-07-20 20:24:10 -04:00
FarhangandRamon Roche 8859bf44a2 ci(dev-call): weekly Discourse post automation (#27087)
---------

Signed-off-by: FARHANG <farhang.nba@gmail.com>
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2026-06-30 12:36:13 -07:00
Jukka Laitinen 839b7a470f fix(CI): Prerequisites for nuttx update (#27509)
* src/drivers/cdcacm_autostart: Include posix.h for px4_close

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

* platforms/nuttx/CMakeLists.txt: Fix linking of nuttx libaries for memalign

This fixes memalign not found in linking step for some boards

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

* Add "flock" to macos.sh setup script

"flock" is not standard on macOS, and a dependency was missing from the
macOS setup path.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

* Fix clang-tidy errors in Bitset.hpp and in src/lib/matrix

Fix the "bugprone-dynamic-static-initializers" linter errors.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

* systemlib/hardfault_log: Fix clang-diagnostics error

Fix for
"[error] clang-diagnostic-error [error]
 use of undeclared identifier XCPTCONTEXT_REGS".

XCPTCONTEXT_REGS is defined in nuttx irq.h, so include that.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

* uORB: Fix clang-tidy error "bugprone-dynamic-static-initializers"

Fix the clang-tidy error appearing on uORBManager _Instance variable by
adding a getter for the reference to the _Instance and using that instead.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

* CI: Add default ubuntu mirrors as fallback

In case of specified aws mirror doesn't have the package idicated by the
metadata, a the default ubuntu mirror as a backup.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>

---------

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-02 11:27:50 -06:00
Jacob Dahl b4b36a2748 fix(nuttx): unblock multi-board and protected builds (#27360)
* fix(ci): wipe NuttX submodule state between boards in build_all_runner

NuttX .o and lib*.a live in the shared submodule trees under
platforms/nuttx/NuttX/{nuttx,apps}, not in per-board build/<board>/.
NuttX's recursive make doesn't treat PX4's per-board defconfig changes
as a reason to recompile, so consecutive board builds in one workspace
were linking stale objects from an earlier board (e.g. stm32_spi.o from
fmu-v2 linked into fmu-v4pro, which doesn't enable SPI4).

Run git clean -dXf on both NuttX submodules between iterations to drop
gitignored build state. This mirrors what make clean already does for
submodules and preserves the incremental-build wins for single-board
use.

* fix(cmake): isolate kernel mm/libc objects with BINDIR=kbin

mm and libs/libc compile the same sources for both the kernel and user
passes in protected builds. Without separate output dirs the kernel
objects clobber bin/*.o and the user-mode libmm.a/libc.a end up pulling
in kernel-only symbols (nxsem_wait, g_current_regs, nx_read, nx_write,
g_mmheap, ...) at link time. Matches NuttX's own tools/LibTargets.mk.
2026-05-17 16:00:06 -06:00
Ramon Roche 540218857a ci(clang-tidy): drop 'file not found' diagnostics from PR review
These fire when clang-tidy analyzes a header whose including TU is not
in the active compile_commands.json (e.g. board-specific NuttX headers
against the SITL clang build), producing spurious line-anchored review
comments on every new-board PR. Real missing includes are caught by the
build_all_targets matrix, which fails the build loudly. Filter the
class of finding at the producer so it never reaches the poster.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-22 10:25:26 -07:00
Ramon Roche 1cf7d75525 fix(ci): lint test files on PRs without breaking push-to-main
The pr-review-poster was flagging `gtest/gtest.h file not found` on any
PR that added or modified a test file, because clang-tidy-diff-18.py
ran against files that weren't in the compilation database. PR #27004
and PR #26233 both hit this. The root cause is that test TUs only
enter compile_commands.json when BUILD_TESTING is ON, which the
historical clang-tidy build does not enable.

This PR fixes both halves of the problem:

1. Add a second make target `px4_sitl_default-clang-test` that configures
   a separate build dir with -DCMAKE_TESTING=ON. Test TUs land in its
   compile_commands.json with resolved gtest/fuzztest include paths.

2. Add an umbrella `clang-ci` target that depends on both
   `px4_sitl_default-clang` and `px4_sitl_default-clang-test` so the PR
   job prepares both build dirs with one make invocation.

3. On PR events the workflow uses `make clang-ci`, installs
   libclang-rt-18-dev (needed so fuzztest's FUZZTEST_FUZZING_MODE flags
   do not fail the abseil try_compile with a misleading "pthreads not
   found" error), and routes the clang-tidy-diff producer at the
   test-enabled build dir.

4. Push-to-main is left entirely alone: same single build dir, same
   `make px4_sitl_default-clang`, same `make clang-tidy`. Test files
   are not in that DB so run-clang-tidy.py keeps ignoring them exactly
   as before. This preserves green main while ~189 pre-existing
   clang-tidy issues in test files remain untouched; fixing those is
   out of scope for this change.

5. Replace the fragile `:!*/test/*` pathspec filter (which missed flat
   `*Test.cpp` files in module roots) with
   `Tools/ci/clang-tidy-diff-filter.py`, which reads the compilation
   database and drops any changed source file that is not a TU.
   Headers always pass through. Production code that happens to use
   test-like names (src/systemcmds/actuator_test, src/drivers/test_ppm,
   etc.) stays analyzed because those are real px4_add_module targets.

Verified in the ghcr.io/px4/px4-dev:v1.17.0-rc2 container and on the
real CI runner:
- cmake configure with CMAKE_TESTING=ON succeeds after installing
  libclang-rt-18-dev (Found Threads: TRUE)
- compile_commands.json grows from 1333 to 1521 TUs
- Modifying HysteresisTest.cpp with a new `const char *p = NULL`
  correctly flags hicpp-use-nullptr and
  clang-diagnostic-unused-variable on the new line, while pre-existing
  issues on other lines of the same file stay suppressed by
  clang-tidy-diff-18.py's line filter ("Suppressed ... 1 due to line
  filter")
- No gtest/gtest.h false positives
- Push-to-main path unchanged, still green

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-11 10:03:51 -06:00
Ramon Roche c515f81298 fix(ci): stop pr-review-poster from spamming REQUEST_CHANGES on every push
Branch protection rules block the GITHUB_TOKEN from dismissing reviews
(HTTP 403), so every push added another undismissable REQUEST_CHANGES
review. PR #27004 accumulated 12 identical blocking reviews.

Switch to COMMENT-only reviews. Findings still show inline on the diff
but don't create blocking reviews that require manual maintainer
dismissal. The CI check status (pass/fail) gates merging, not the
review state.

Also enable CMAKE_TESTING=ON in the clang-tidy build so test files get
proper include paths in compile_commands.json. Without this,
clang-tidy-diff runs on test files from the PR diff but can't resolve
gtest headers, producing false positives.

Fixes #27004

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-10 20:33:34 -06:00
Ramon Roche c0a45cef70 ci(build-all): MCU-based groups, cache seeders, build infra overhaul (#27050)
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-10 18:49:53 -07:00
Ramon Roche 9e93fd753e ci(pr-review-poster): add line-anchored review poster and migrate clang-tidy (#27028)
* ci(pr-review-poster): add line-anchored review poster and migrate clang-tidy

Adds a generic PR review-comment poster as a sibling of the issue-comment
poster from #27021. Replaces platisd/clang-tidy-pr-comments@v1 in the
Static Analysis workflow with an in-tree, fork-friendly producer + poster
pair so fork PRs get inline clang-tidy annotations on the Files changed
tab without trusting a third-party action with a write token.

Architecture mirrors pr-comment-poster: a producer (clang-tidy.yml) runs
inside the px4-dev container and writes a `pr-review` artifact containing
manifest.json and a baked comments.json. A separate workflow_run-triggered
poster runs on ubuntu-latest with the base-repo write token, validates the
artifact, dismisses any stale matching review, and posts a fresh review
on the target PR. The poster never checks out PR code and only ever reads
two opaque JSON files from the artifact.

Stale-review dismissal is restricted to reviews authored by
github-actions[bot] AND whose body contains the producer's marker. A fork
cannot impersonate the bot login or inject the marker into a human
reviewer's body, so the poster can never dismiss a human review. APPROVE
events are explicitly forbidden so a bot cannot approve a pull request.

To avoid duplicating ~120 lines of HTTP plumbing between the two posters,
the GitHub REST helpers (single-request, pagination, error handling) are
extracted into Tools/ci/_github_helpers.py with a small GitHubClient
class. The existing pr-comment-poster.py is refactored to use it; net
change is roughly -80 lines on that script. The shared module is
sparse-checked-out alongside each poster script and is stdlib only.

The clang-tidy producer reuses MIT-licensed translation logic from
platisd/clang-tidy-pr-comments (generate_review_comments,
reorder_diagnostics, get_diff_line_ranges_per_file and helpers) under a
preserved attribution header. The HTTP layer is rewritten on top of
_github_helpers so the producer does not pull in `requests`. Conversation
resolution (the GraphQL path) is intentionally dropped for v1.

clang-tidy.yml now produces the pr-review artifact in the same job as
the build, so the cross-runner compile_commands.json hand-off and
workspace-path rewriting are no longer needed and the
post_clang_tidy_comments job is removed.

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

* ci(workflows): bump action versions to clear Node 20 deprecation

GitHub has deprecated the Node 20 runtime for Actions as of
September 16, 2026. Bump the pinned action versions in the three poster
workflows to the latest majors, all of which run on Node 24:

  actions/checkout         v4 -> v6
  actions/github-script    v7 -> v8
  actions/upload-artifact  v4 -> v7

No behavior changes on our side: upload-artifact v5/v6/v7 only added an
optional direct-file-upload mode we do not use, and checkout v5/v6 are
runtime-only bumps. The security-invariant comment headers in both
poster workflows are updated to reference the new version so they stay
accurate.

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

* ci(pr-posters): skip job when producer was not a pull_request event

Both poster workflows previously ran on every workflow_run completion of
their listed producers and then silently no-oped inside the script when
the triggering producer run was a push-to-main (or any other non-PR
event). That made the UI ambiguous: the job was always green, never
showed the reason it did nothing, and looked like a failure whenever
someone clicked in looking for the comment that was never there.

Gate the job at the workflow level on
github.event.workflow_run.event == 'pull_request'. Non-PR producer runs
now surface as a clean "Skipped" entry in the run list, which is
self-explanatory and needs no in-script summary plumbing.

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

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-09 10:54:29 -07:00
Ramon Roche 8c4b703103 ci(pr-comment-poster): add generic PR comment poster and migrate producers
Adds a stand-alone workflow that posts or updates sticky PR comments on
behalf of any analysis workflow, including those triggered by fork PRs.
The poster runs on `workflow_run` in the base repo context, which is the
standard GitHub-sanctioned way to get a write token on events that
originate from untrusted forks without ever checking out fork code.

All validation, GitHub API interaction, and upsert logic lives in
Tools/ci/pr-comment-poster.py (Python 3 stdlib only, two subcommands:
`validate` and `post`). The workflow file itself is a thin orchestrator:
sparse-checkout the script, download the pr-comment artifact via
github-script, unzip, then invoke the script twice. No inline jq, no
inline bash validation, no shell-interpolated marker strings. The
sparse-checkout ensures only Tools/ci/pr-comment-poster.py lands in the
workspace, never the rest of the repo.

Artifact contract: a producer uploads an artifact named exactly
`pr-comment` containing `manifest.json` (with `pr_number`, `marker`, and
optional `mode`) and `body.md`. The script validates the manifest
(positive integer pr_number, printable-ASCII marker bounded 1..200
chars, UTF-8 body under 60000 bytes, mode in an allowlist), finds any
existing comment containing the marker via the comments REST API, and
either edits it in place or creates a new one.

The workflow file header documents six security invariants that any
future change MUST preserve, most importantly: NEVER check out PR code,
NEVER execute anything from the artifact, and treat all artifact
contents as opaque data.

Why a generic poster and not `pull_request_target`: `pull_request_target`
is the tool people reach for first and the one that most often turns
into a supply-chain vulnerability, because it hands a write token to a
workflow that is then tempted to check out the PR head. `workflow_run`
gives the same write token without any check-out temptation, because
the only input is a pre-produced artifact treated as opaque data.

Producer migrations
===================

flash_analysis.yml:
- Drop the fork gate on the `post_pr_comment` job.
- Drop the obsolete TODO pointing at issue #24408 (the fork-comment
  workflow does not error anymore; it just no-ops).
- Keep the existing "comment only if threshold crossed or previous
  comment exists" behaviour verbatim. peter-evans/find-comment@v3
  stays as a read-only probe (forks can read issue comments just fine);
  its body-includes is updated to search for the new marker
  `<!-- pr-comment-poster:flash-analysis -->` instead of the old
  "FLASH Analysis" heading substring.
- Replace the peter-evans/create-or-update-comment@v4 step with two
  new steps that write pr-comment/manifest.json and pr-comment/body.md
  and then upload them as artifact pr-comment. The body markdown is
  byte-for-byte identical to the previous heredoc, with the marker
  prepended as the first line so subsequent runs can find it.
- The threshold-or-existing-comment gate is preserved on both new
  steps. When the gate does not fire no artifact is uploaded and the
  poster no-ops.

docs-orchestrator.yml (link-check job):
- Drop the fork gate on the sticky-comment step.
- Replace marocchino/sticky-pull-request-comment@v2 with two new steps
  that copy logs/filtered-link-check-results.md into pr-comment/body.md,
  write a pr-comment/manifest.json with the marker
  `<!-- pr-comment-poster:docs-link-check -->`, and upload the directory
  as artifact pr-comment.
- The prepare step checks `test -s` on the results file and emits a
  prepared step output; the upload step is gated on that output. In
  practice the existing link-check step always writes a placeholder
  ("No broken links found in changed files.") into the file when empty,
  so the guard is defensive but not load-bearing today.
- Tighten the link-check job's permissions from `pull-requests: write`
  down to `contents: read`; writing PR comments now happens in the
  poster workflow.

The poster's workflows allowlist is seeded with the two active
producers: "FLASH usage analysis" and "Docs - Orchestrator".
clang-tidy (workflow name "Static Analysis") is not in the list because
platisd/clang-tidy-pr-comments posts line-level review comments, a
different REST API from issue comments that the poster script does not
handle. Extending the poster to cover review comments is a follow-up.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-08 23:49:56 -06:00
Ramon Roche eb9a76cfaf ci(actions): add composite actions and clang-tidy PR helper
Add four reusable building blocks that upcoming CI optimization PRs will
consume. No existing workflow is modified; these files are dormant until
referenced.

- .github/actions/setup-ccache: restore ~/.ccache with content-hash keys,
  write ccache.conf with compression and content-based compiler check
- .github/actions/save-ccache: print stats and save the cache under the
  primary key produced by setup-ccache
- .github/actions/build-gazebo-sitl: build px4_sitl_default plus the
  Gazebo Classic plugins with ccache stats between stages
- Tools/ci/run-clang-tidy-pr.py: compute the translation units affected
  by a PR diff and invoke Tools/run-clang-tidy.py on that subset only,
  exiting silently when no C++ files changed

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-08 13:14:16 -06:00
Ramon Roche 60db79f35e ci(apt): extract AWS apt mirror swap into shared script
The mirror swap was duplicated across two workflows. Move it into
Tools/ci/use_aws_apt_mirror.sh and call the script from each workflow
after checkout but before any heavy apt work like Tools/setup/ubuntu.sh.

The script no-ops outside runs-on (RUNS_ON_AWS_REGION unset), so it is
safe to call from forks, self-hosted runners, or local container runs
without changing behavior there. The region is read from the runs-on
environment instead of being hardcoded, so future region changes only
need updating where the runner is provisioned.

The bootstrap 'apt install git' step keeps the default mirror because
git is one package and is unlikely to hit the dep11 desync issue that
broke ubuntu.sh.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-07 20:01:55 -06:00
Ramon Roche 039ec78d35 fix(ci): copy events metadata to top-level artifact directory
The packaging script only placed all_events.json.xz in an events/
subdirectory, but the firmware advertises the metadata URI at the
board directory top level. New build targets added after the
Jenkins-to-GHA migration had no legacy top-level copy, causing
QGC to get a 404 when fetching component metadata.

Fixes #26963

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-02 23:04:54 -06:00
Ramon Roche 685f9248e4 fix(sbom): fix false positives in monthly license audit
Three issues caused the monthly audit to report already-resolved submodules:

1. The audit workflow grepped for "NOASSERTION" anywhere in the output,
   matching the Detected column even when the Final column had a valid
   override (e.g. libtomcrypt detected as NOASSERTION but overridden to
   Unlicense). Changed to grep for "<-- UNRESOLVED" marker instead.

2. Submodules with an explicit NOASSERTION override in license-overrides.yaml
   (like libfc-sensor-api, which is proprietary) were still counted as
   failures. Now treated as "acknowledged" since someone intentionally
   added the override entry.

3. Added missing BSD-3-Clause override for sitl_gazebo-classic (PX4 org
   project with no LICENSE file in repo).

Fixes #26932

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-04-02 11:15:30 -06:00
Onur Özkan 0d18be5049 fix(scripts): replace hardcoded /bin/bash shebangs
Several helper scripts assumes bash is available at /bin/bash. That breaks on systems
such as NixOS, where bash is resolved from PATH instead of a fixed /bin location and
causes failures like `bad interpreter` during `make format`, e.g., on my host machine:

```sh
$ make format

/PX4-Autopilot/Tools/astyle/check_code_style.sh: /PX4-Autopilot/Tools/astyle/fix_code_style.sh: /bin/bash: bad interpreter: No such file or directory
```

This change switches these entrypoints to `#!/usr/bin/env bash` so they locate bash properly.

No functional changes intended.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
2026-04-01 12:25:28 -08:00
Ramon Roche b243398231 feat(build): add SPDX 2.3 SBOM generation for builds (#26731) 2026-03-31 17:06:51 -06:00
Ramon Roche adb2df5ca7 feat(boards/modalai/voxl2): add Debian packaging framework
Add a scalable .deb packaging framework for VOXL2, built on the
existing cmake/package.cmake CPack infrastructure. The framework
handles multi-processor boards by having the POSIX (_default) build
own the .deb and pull in the companion SLPI build's artifacts.

Board-specific files:
- cmake/package.cmake: CPack variable overrides (name, deps, version)
- cmake/install.cmake: install() rules for all .deb contents
- debian/postinst: px4-* symlinks, DSP signature, directory setup
- debian/prerm: service stop, symlink cleanup
- debian/voxl-px4.service: systemd unit (after sscrpcd)

Infrastructure changes:
- cmake/package.cmake: hook for board-specific CPack overrides
- platforms/posix/CMakeLists.txt: hook for board install.cmake
- Makefile: %_deb pattern rule (build _default, then cpack -G DEB)
- CI: auto-discover _deb targets, collect .deb artifacts, upload
  to GitHub Releases

Future boards: add cmake/package.cmake + cmake/install.cmake and
CI discovers it automatically. No new file formats or tools needed.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-03-18 08:51:27 -07:00
Ramon Roche 9901b3c156 ci(boards): filter companion targets from CI build groups
Read companion_targets files from board directories and exclude those
targets from CI grouped builds. The parent target builds them via
Make prerequisite, avoiding redundant CI jobs.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-03-18 08:51:27 -07:00
Ramon Roche a9f2e0e44e fix(ci): correct metadata artifact paths in package_build_artifacts.sh
airframes.xml and all_events.json.xz on the px4-travis S3 bucket have
been stale since October 2025 because package_build_artifacts.sh had
wrong paths for both files after the migration from metadata.yml to
build_all_targets.yml.

- airframes.xml: SITL builds produce it under docs/, not at the build
  root (only NuttX does that). Use explicit file checks to try both.
- all_events.json.xz: was copied flat into artifacts/$build_dir/ but
  the _general section expected it under events/. Preserve the
  subdirectory so the copy to _general/ actually finds the file.
- Remove duplicate cp lines that were misleadingly commented as
  "ROS 2 msgs".
- Fail with an error when critical _general metadata files are missing
  rather than silently producing incomplete artifacts.

Also uploaded fresh metadata to S3 manually to unblock Flight Review.

Fixes #26713

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-03-12 20:16:05 -07:00
Ramon Roche 4da97eb4fd ci(workflows): add commit message and PR title quality checks
Add CI enforcement of conventional commit format for PR titles and
commit messages. Includes three Python scripts under Tools/ci/:

- conventional_commits.py: shared parsing/validation library
- check_pr_title.py: validates PR title format, suggests fixes
- check_commit_messages.py: checks commits for blocking errors
  (fixup/squash/WIP leftovers) and advisory warnings (review-response,
  formatter-only commits)

The workflow (.github/workflows/commit_checks.yml) posts concise
GitHub PR comments with actionable suggestions and auto-removes them
once issues are resolved.

Also updates CONTRIBUTING.md and docs with the conventional commits
convention.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-03-06 17:51:54 -08:00
Jacob Dahl c424edd055 ci: sort board scan order to fix VOXL2 build ordering
os.scandir() returns entries in non-deterministic order, which caused
voxl2-slpi to sometimes build before voxl2_default (which it depends
on). Sort all os.scandir() calls lexicographically by name so the
shorter prefix voxl2 always precedes voxl2-slpi.
2026-02-26 17:08:55 -08:00
Ramon Roche 9048a40277 msg_docs: fix IndexError crash and camel_to_snake regex (#26546)
Fix generate_msg_docs.py IndexError when a .msg file declares a single
topic that does not match the camel_to_snake default (e.g.
AuxGlobalPosition.msg). The error message referenced self.topics[1]
(out of bounds) instead of self.topics[0].

Fix camel_to_snake() regex to correctly convert names like
"AuxGlobalPosition" to "aux_global_position". The previous regex
produced "aux_globalposition" because it failed to insert an underscore
between a lowercase letter and an uppercase letter mid-word.

Also remove stderr redirection (2>&1) from all make targets in
metadata_sync.sh so that errors are visible in CI logs even in
non-verbose mode, making failures easier to diagnose.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-20 22:24:21 -08:00
Ramon Roche 731d754a15 ci: enable VOXL2 CI builds with private Docker container
Remove modalai_voxl2 and qurt from CI exclusion lists and add
container overrides to use the private ghcr.io/px4/px4-dev-voxl2
image which contains the Qualcomm Hexagon SDK.

- Add voxl2 build group with x64 runner for cross-compilation
- Add GHCR credentials to workflow for private container pull
- Add packages:read permission to workflow
- Auto-build libfc_sensor.so stub during cmake configure
- Handle missing .px4/.elf gracefully in artifact packaging

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 12:00:25 -08:00
Ramon Roche 42b0061217 ci: comprehensive docs-orchestrator audit and fixes
- Add safe.directory + fetch-depth: 0 for container jobs
- Support workflow_dispatch in metadata-regen and deploy-aws
- Guard PR comments against fork PRs
- Add ccache save to pr-metadata-regen
- Use metadata_sync.sh --generate --sync instead of manual steps
- Fix msg_docs source path in metadata_sync.sh
- Guard set-version against non-release branches
- Clean up build-site needs list

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 13:46:44 -08:00