-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bring size-diff baseline fixes to maintenance-10.x #11805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sensei-hacker
merged 2 commits into
iNavFlight:maintenance-10.x
from
sensei-hacker:feature-ci-ram-flash-diff-comment-10x
Aug 21, 2026
+99
−28
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,54 +1,98 @@ | ||
| name: CI Size Report | ||
|
|
||
| # Runs after "Build firmware" completes. Uses workflow_run (rather than | ||
| # pull_request/push directly) so that secrets are available even for PRs | ||
| # from forks — same reasoning as pr-test-builds.yml. | ||
| # Uses workflow_run (rather than pull_request/push directly) so that | ||
| # secrets are available even for PRs from forks — same reasoning as | ||
| # pr-test-builds.yml. | ||
| # | ||
| # Two jobs: | ||
| # - publish-baseline: on any branch push that triggers ci.yml (in practice, | ||
| # almost always maintenance-9.x/maintenance-10.x — see ci.yml's own push | ||
| # trigger for the exact filter), persists the size report as a release | ||
| # asset in the companion iNavFlight/pr-test-builds repo, so PR runs never | ||
| # need to rebuild the base branch to get a comparison point. Stale | ||
| # baselines for since-deleted branches aren't cleaned up automatically | ||
| # (same known limitation pr-test-builds has for old PR releases). | ||
| # - pr-comment: on PR builds, fetches that persisted baseline, diffs the | ||
| # 4 representative targets, and posts/updates a PR comment. | ||
| # Listens to two different upstream workflows, for two different jobs: | ||
| # - publish-baseline listens for "Build pre-release" (nightly-build.yml), | ||
| # NOT "Build firmware" directly. ci.yml's own `on: push:` trigger is | ||
| # broken (a branches: list with only a negative pattern matches | ||
| # nothing — confirmed empirically, zero push-triggered "Build firmware" | ||
| # runs exist). "Build pre-release" is push-triggered correctly and | ||
| # already invokes ci.yml's jobs via `uses:` (workflow_call) as part of | ||
| # building nightly releases — piggybacking here costs nothing extra, | ||
| # no second build. Persists the size report as a release asset in the | ||
| # companion iNavFlight/pr-test-builds repo, so PR runs never need to | ||
| # rebuild the base branch to get a comparison point. Only fires for | ||
| # branches nightly-build.yml's own push trigger covers (currently | ||
| # master, maintenance-9.x, maintenance-10.x, release/9.1 — see that | ||
| # file). Stale baselines for since-deleted branches aren't cleaned up | ||
| # automatically (same known limitation pr-test-builds has for old PR | ||
| # releases). | ||
| # - pr-comment listens for "Build firmware" (ci.yml) directly — PR builds | ||
| # genuinely do trigger it via `pull_request`, that part isn't broken. | ||
| # Fetches the persisted baseline, diffs the 4 representative targets, | ||
| # and posts/updates a PR comment. | ||
| # | ||
| # Requires the same repository secret PR_BUILDS_TOKEN as pr-test-builds.yml | ||
| # (Contents: write access to iNavFlight/pr-test-builds). | ||
| on: | ||
| workflow_run: | ||
| workflows: ["Build firmware"] | ||
| workflows: ["Build firmware", "Build pre-release"] | ||
| types: [completed] | ||
|
|
||
| jobs: | ||
| publish-baseline: | ||
| runs-on: ubuntu-latest | ||
| if: > | ||
| github.event.workflow_run.event == 'push' && | ||
| github.event.workflow_run.conclusion == 'success' | ||
| github.event.workflow_run.name == 'Build pre-release' && | ||
| github.event.workflow_run.event == 'push' | ||
| concurrency: | ||
| group: size-baseline-${{ github.event.workflow_run.head_branch }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| actions: read # to download artifacts from the triggering workflow run | ||
| actions: read # to download artifacts and query job conclusions from the triggering workflow run | ||
| steps: | ||
| # Don't gate on github.event.workflow_run.conclusion: "Build | ||
| # pre-release" also runs a separate Release job (nightly upload to | ||
| # iNavFlight/inav-nightly) that can fail for reasons unrelated to the | ||
| # build itself (e.g. an expired NIGHTLY_TOKEN) and drags the whole | ||
| # run's conclusion to failure even when the build succeeded and | ||
| # produced the artifacts we actually need. Check the specific job | ||
| # that produces them instead. | ||
| - name: Check build job succeeded | ||
| id: check | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RUN_ID: ${{ github.event.workflow_run.id }} | ||
| run: | | ||
| CONCLUSION=$(gh api "repos/${{ github.repository }}/actions/runs/${RUN_ID}/jobs" --paginate \ | ||
| --jq '.jobs[] | select(.name == "build / upload-artifacts") | .conclusion') | ||
|
Comment on lines
+60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Brittle job-name gate ci-size-report.yml gates baseline publishing on finding a job named exactly `"build / upload-artifacts"` in the upstream run; any caller job rename (nightly-build) or callee job rename (ci.yml) will cause proceed=false and baseline publishing will be skipped. Agent Prompt
|
||
| if [ -z "$CONCLUSION" ]; then | ||
| # Job not found at all usually means the caller/callee job names | ||
| # changed (e.g. nightly-build.yml's "build" job or ci.yml's | ||
| # "upload-artifacts" job got renamed) — that's a workflow | ||
| # structure mismatch, not an expected build failure, and is | ||
| # exactly the kind of thing that silently broke baseline | ||
| # publishing before. Warn louder than a plain failed build. | ||
| echo "::warning::build / upload-artifacts job not found in run ${RUN_ID} — job name may have changed, skipping baseline publish" | ||
| echo "proceed=false" >> "$GITHUB_OUTPUT" | ||
| elif [ "$CONCLUSION" != "success" ]; then | ||
| echo "::notice::build / upload-artifacts did not succeed (conclusion: ${CONCLUSION}), skipping baseline publish" | ||
| echo "proceed=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "proceed=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Download size report | ||
| if: steps.check.outputs.proceed == 'true' | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: size-report | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Download branch name | ||
| if: steps.check.outputs.proceed == 'true' | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: branch-name | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Publish baseline | ||
| if: steps.check.outputs.proceed == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.PR_BUILDS_TOKEN }} | ||
| run: | | ||
|
|
@@ -73,6 +117,7 @@ jobs: | |
| pr-comment: | ||
| runs-on: ubuntu-latest | ||
| if: > | ||
| github.event.workflow_run.name == 'Build firmware' && | ||
| github.event.workflow_run.event == 'pull_request' && | ||
| github.event.workflow_run.conclusion == 'success' | ||
| concurrency: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Branch coverage comment wrong
🐞 Bug⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools