Skip to content

Only consume artifacts from the real firmware workflow - #11930

Open
Raffi1202 wants to merge 4 commits into
iNavFlight:masterfrom
Raffi1202:fix/artifact-consumer-workflow-path
Open

Raffi1202 wants to merge 4 commits into
iNavFlight:masterfrom
Raffi1202:fix/artifact-consumer-workflow-path

Conversation

@Raffi1202

@Raffi1202 Raffi1202 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Both ci.yml and non-code-change.yaml are named "Build firmware". When the non-code stub succeeds, pr-test-builds.yml still runs and fails with Artifact not found for name: pr-number, because the stub uploads no artifacts. All 37 failed PR Test Builds runs among the last 100 (2026-09-21 to 2026-09-24) came from the stub, e.g. https://github.com/iNavFlight/inav/actions/runs/35958044484 after stub run https://github.com/iNavFlight/inav/actions/runs/35957880882. ci-size-report.yml already survives this through the step guard from #11878; there the new condition only skips the job earlier.

Both consumer jobs now also require github.event.workflow.path == '.github/workflows/ci.yml', next to the existing pull-request and success checks. A path rather than a workflow ID keeps forks working. workflow.path is part of the workflow_run payload and holds the plain file path; pytorch/pytorch runs the same guard in claude-issue-triage-run.yml (e.g. https://github.com/pytorch/pytorch/actions/runs/35978025124). A missing or different path skips the job.

workflow_run workflows execute from the default branch, currently maintenance-10.x, so the change takes effect once it reaches that branch.

Validation: node --test .github/scripts/artifact-workflow-filter.test.js passes 11 tests, also on CRLF checkouts. They read the conditions from both YAML files and cover firmware runs, the same-name stub, a misleading workflow_run.path, unsuccessful and push runs, missing and unknown paths, and that ci.yml exists. Artifact download and release publication with the final filter have not run end to end, since consumer changes only execute from the default branch.

Firmware code and the baseline-publishing job are unchanged.

@github-actions

Copy link
Copy Markdown

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@Raffi1202
Raffi1202 marked this pull request as ready for review September 11, 2026 15:18
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Restrict artifact consumers to the firmware CI workflow

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Restricts artifact consumers to successful pull-request runs from .github/workflows/ci.yml.
• Prevents same-named placeholder workflows from causing missing-artifact failures.
• Leaves pre-release baseline publishing unchanged.
Diagram

graph TD
  F["Firmware CI"] --> G{"ci.yml PR success?"} -->|Yes| S["Size report"]
  P["Placeholder workflow"] --> G
  G -->|Yes| T["Test builds"]
  G -->|No| K["Jobs skipped"]
  N["Pre-release build"] --> B["Baseline publish"]
Loading
High-Level Assessment

The workflow path guard is the most direct and reliable approach because workflow display names are not unique. It preserves existing workflow_run triggers while preventing artifact consumers from accepting runs that cannot provide the required artifacts.

Files changed (2) +2 / -0

Bug fix (2) +2 / -0
ci-size-report.ymlLimit PR size reports to the real firmware workflow +1/-0

Limit PR size reports to the real firmware workflow

• Adds a workflow_run path condition to the PR comment job so only '.github/workflows/ci.yml' runs can consume size-report artifacts. Baseline publishing from the pre-release workflow remains unchanged.

.github/workflows/ci-size-report.yml

pr-test-builds.ymlLimit test-build publishing to the real firmware workflow +1/-0

Limit test-build publishing to the real firmware workflow

• Requires successful pull-request runs to originate from '.github/workflows/ci.yml' before downloading and publishing firmware artifacts. This excludes successful placeholder runs sharing the 'Build firmware' name.

.github/workflows/pr-test-builds.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Valid firmware builds are skipped ✓ Resolved 🐞 Bug ≡ Correctness
Description
Both consumer jobs now require github.event.workflow_run.path to equal the firmware workflow path,
but no repository fixture or convention establishes that this property is populated for
workflow_run events. When the property is absent, the condition evaluates false and valid
pull-request builds are skipped, preventing both artifact consumers from publishing their reports or
builds.
Code

.github/workflows/pr-test-builds.yml[19]

+      github.event.workflow_run.path == '.github/workflows/ci.yml' &&
Evidence
The changed guards make both jobs depend on workflow_run.path. The repository's consumers
otherwise identify the run by workflow name, event, and conclusion, while ci.yml is the
pull-request workflow that uploads the artifacts consumed downstream; no repository fixture or
documentation verifies that workflow_run.path is available in this event payload.

.github/workflows/pr-test-builds.yml[8-20]
.github/workflows/ci-size-report.yml[42-45]
.github/workflows/ci-size-report.yml[138-142]
.github/workflows/ci.yml[5-19]
.github/workflows/ci.yml[126-139]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The consumers require `github.event.workflow_run.path`, but the repository does not establish that this property is present in `workflow_run` event payloads. An absent property makes the condition false, so valid pull-request firmware runs do not reach the artifact consumers.
## Fix Focus Areas
- .github/workflows/pr-test-builds.yml[17-20]
- .github/workflows/ci-size-report.yml[138-142]
## Recommended Fix
Replace the path-based guard with a reliably available identifier for the real firmware workflow, such as its workflow ID or another supported discriminator. Preserve the existing pull-request and successful-conclusion checks, and ensure both consumers reject `non-code-change.yaml` without excluding valid `.github/workflows/ci.yml` runs.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/pr-test-builds.yml Outdated
@sensei-hacker sensei-hacker added this to the 9.1.1 milestone Sep 20, 2026
@Raffi1202

Copy link
Copy Markdown
Contributor Author

/agentic_review

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit be6fe1d

@Raffi1202

Copy link
Copy Markdown
Contributor Author

/agentic_review

The remaining path-guard finding is contradicted by executed workflow evidence: the guard is present on the fork default branch at ac6fbcd, and the pr-comment job completed artifact downloads and publication in https://github.com/Raffi1202/inav/actions/runs/34614556238 and https://github.com/Raffi1202/inav/actions/runs/34616048856. Those jobs would have been skipped if workflow_run.path were absent. The second consumer has the identical expression; its upstream-only repository guard means it was checked by inspection, not executed in the fork. Please reassess this finding against those runs.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit be6fe1d

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

RAM / Flash usage vs. base commit bbc0553 — commit 5a9e797

Target Flash Δ RAM Δ
MATEKF405 +232 B (+0.04%) ±0 B (±0.00%)
MATEKF722 +184 B (+0.04%) ±0 B (±0.00%)
MATEKF765 +216 B (+0.03%) ±0 B (±0.00%)
MATEKH743 +216 B (+0.03%) ±0 B (±0.00%)

See RAM/flash optimization guide for techniques to reduce usage.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Test firmware build ready — commit 5a9e797

Download firmware for PR #11930

245 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants