ci: auto-run the hardware-lab release-QA on each firmware PR - #1908
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 427a85a0a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| steps: | ||
| - name: Dispatch the hardware-lab release-QA (coredevices/unicorn) | ||
| env: | ||
| GH_TOKEN: ${{ secrets.UNICORN_DISPATCH_TOKEN }} |
There was a problem hiding this comment.
Keep the cross-repository token out of PR-controlled workflows
Because this workflow runs on pull_request, a same-repository PR passes the repository check while its version of this YAML still controls the run step. Such a PR can replace the command with one that exfiltrates GH_TOKEN, gaining the token's cross-repository Actions write access to Unicorn; filtering out forks does not protect against compromised or malicious internal branches. Perform the secret-bearing dispatch from workflow code loaded from the trusted default branch, such as a carefully validated workflow_run workflow.
Useful? React with 👍 / 👎.
| concurrency: | ||
| group: release-qa-dispatch-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true |
There was a problem hiding this comment.
Enforce per-PR cancellation in the remote workflow
When two pushes reach this job far enough apart for the first dispatch command to finish—the normal case because each run first rebuilds firmware—there is no longer a local job for this concurrency group to cancel. gh workflow run only creates the remote workflow_dispatch event and returns, so the already-dispatched Unicorn run remains queued or running in the other repository and obsolete hardware-lab runs accumulate despite the stated one-in-flight behavior. Deduplication or cancellation needs to be enforced in Unicorn, or this job must explicitly cancel the prior remote run.
Useful? React with 👍 / 👎.
|
Added an org-member gate: |
jplexer
left a comment
There was a problem hiding this comment.
squash and fix compliance checks before merging, otherwise lgtm
After build-qa-firmware produces the dual-slot artifact, dispatch coredevices/unicorn's one-off-pebbleos-test against this run's qa-firmware-<board> (erase -> PRF -> pair -> OTA -> functional pass on a real phone + watch), using the most recently tagged coreapp release. The unicorn run posts a unicorn/release-qa commit status back on the PR commit. Gated to org members / collaborators (author_association OWNER/MEMBER/COLLABORATOR) on internal PRs only, so an outside contributor can't spend the single hardware lab. Per-PR concurrency so a newer push supersedes the older dispatch. Requires UNICORN_DISPATCH_TOKEN (a PAT with actions:write on coredevices/unicorn); without it the job no-ops with a warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Eric Migicovsky <eric@repebble.com>
c24ba23 to
e54858c
Compare
What
After
build-qa-firmwarebuilds the dual-slot artifact, a newdispatch-release-qajob kicks off the hardware-lab release-QA in coredevices/unicorn against this run'sqa-firmware-<board>— the full erase → PRF → pair → OTA → functional pass on a real phone + watch — and the unicorn run posts aunicorn/release-qacommit status back on the PR commit.Needs
UNICORN_DISPATCH_TOKENin this repo's secrets — a PAT withactions:writeon coredevices/unicorn (same pattern coreapp uses to trigger unicorn smoke). Without it the job no-ops with a warning, so this PR is safe to merge before the secret exists; the QA just won't fire until it's added.The lab has a single phone+watch and unicorn serializes runs (
firmware-labconcurrency). Every internal firmware-PR push triggers a ~25 min run, so on a busy day these queue. If that's too much, we can gate it to a label (e.g.hw-qa) or ready-for-review instead of every push — easy follow-up.🤖 Generated with Claude Code