Fix publish-baseline never firing due to unrelated Release job failures - #11801
Conversation
The Release job (nightly upload to iNavFlight/inav-nightly) can fail for reasons unrelated to the build itself and drags the whole run's conclusion to failure even when the build succeeded and produced the size-report/branch-name artifacts. Confirmed live: the 2026-08-20 push to release/9.1 had every build job succeed but Release fail with "Bad credentials" (NIGHTLY_TOKEN), so publish-baseline never ran and no baseline has ever been published — which is why PR iNavFlight#11800 still shows "No size baseline is available yet". Check the specific build/upload-artifacts job's conclusion instead of the aggregate run conclusion.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoFix size baseline publishing by gating on build job success, not run conclusion
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Multi-match conclusion mishandled
|
| CONCLUSION=$(gh api "repos/${{ github.repository }}/actions/runs/${RUN_ID}/jobs" --paginate \ | ||
| --jq '.jobs[] | select(.name == "build / upload-artifacts") | .conclusion') |
There was a problem hiding this comment.
1. Multi-match conclusion mishandled 🐞 Bug ≡ Correctness
Check build job succeeded captures all matching job conclusions into a single variable, but then compares it as if it were a single scalar value. If more than one build / upload-artifacts job entry is returned, CONCLUSION becomes multi-valued and the step will incorrectly skip baseline publishing even when the relevant job succeeded.
Agent Prompt
### Issue description
The workflow stores the output of a jq filter that can emit multiple results into `CONCLUSION`, then compares it to the string `success`. If multiple matches exist, the comparison fails and baseline publishing is skipped.
### Issue Context
This job is intended to be a robust gate for baseline publishing; it should deterministically select exactly one conclusion (e.g., the latest/most relevant matching job) and/or explicitly detect and handle multiple matches.
### Fix Focus Areas
- .github/workflows/ci-size-report.yml[60-73]
### Suggested fix
Update the jq query to return exactly one value (or explicitly error/warn on multiple), for example:
- Use jq to select the most recent matching job (e.g., `max_by(.completed_at)` or similar) and output only its `.conclusion`, or
- Collect matches into an array and:
- if length==0: warn + proceed=false
- if length>1: warn about ambiguity, choose the latest deterministically
- else: use the single conclusion
This ensures `CONCLUSION` is always a single scalar (`success`, `failure`, `skipped`, etc.) before the string comparison.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Test firmware build ready — commit Download firmware for PR #11801 244 targets built. Find your board's
|
|
RAM / Flash usage vs. base branch — commit
See RAM/flash optimization guide for techniques to reduce usage. |
Summary
publish-baseline(inci-size-report.yml, part of the RAM/flash size-diffPR comment feature) never actually published a baseline, even on branches
that were pushing and building successfully. PR #11800 (based on
release/9.1) still showed "No size baseline is available yet" despiteCI having run successfully for days.
Root Cause
publish-baselinegated ongithub.event.workflow_run.conclusion == 'success'for the entire "Build pre-release" (nightly-build.yml) run.But that workflow also runs a separate
Releasejob that publishes anightly build to
iNavFlight/inav-nightlyusingNIGHTLY_TOKEN— a jobcompletely unrelated to producing the size report. When that job fails
(confirmed live:
Bad credentialsfrom an invalid/expiredNIGHTLY_TOKENon a real
release/9.1push), it drags the entire run's conclusion tofailure, even though every build job — including the one that producesthe
size-report/branch-nameartifactspublish-baselineneeds —succeeded. As a result,
publish-baselinesilently never ran, and nosize-baseline-*release has ever existed iniNavFlight/pr-test-builds.Changes
.github/workflows/ci-size-report.yml:publish-baselineno longergates on the aggregate
workflow_run.conclusion. It now queries thespecific
build / upload-artifactsjob's conclusion viagh api repos/{repo}/actions/runs/{run_id}/jobsand only proceeds if that jobsucceeded — decoupling baseline publishing from the unrelated
Releasejob's reliability.
job names) from "job failed", warning louder on the former since that's
a workflow-structure mismatch rather than an expected build failure —
and is the same silent-failure class as the bug this PR fixes.
Testing
gh run viewon the actual failingrelease/9.1push run showed every build job (build (0)..build (14),upload-artifacts, etc.) assuccessand only theReleasejobas
failure("Bad credentials"), confirming the aggregate-conclusiongate was the root cause.
size-baseline-release/9.1orsize-baseline-masterrelease exists yet in
iNavFlight/pr-test-builds, consistent withpublish-baselinenever having successfully run.python3 -c "import yaml; yaml.safe_load(...)").workflow_run-triggered workflow locally; willconfirm live once merged and a subsequent push to
release/9.1(ormaster, sinceworkflow_runalways uses the default branch's copy ofthis file) triggers it.
Code Review
Reviewed with the
inav-code-reviewagent — approved, with two minorobservability suggestions (both addressed): clarified the
actions: readpermission comment, and upgraded the "job not found" case to a warning
instead of a notice.
Related
Continues the size-diff PR comment feature from #11791/#11794/#11795/#11796/#11797.