Skip to content

ci(start-wrt): detect changes and upload rerun-safely like the other products - #4779

Merged
dr-bonez merged 2 commits into
masterfrom
ci/start-wrt-shared-change-detection
Nov 18, 2026
Merged

dr-bonez merged 2 commits into
masterfrom
ci/start-wrt-shared-change-detection

Conversation

@helix-red

@helix-red helix-red commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

StartWRT change detection now matches the other products.

  • start-wrt.yaml no longer has paths: filters. Every push and pull request runs a short "Detect StartWRT changes" job, which runs .github/scripts/classify-event.sh start-wrt.yaml. build-products.yaml now calls the same script for its own products; it holds the logic that workflow ran inline.
    • A pull request is classified by its files, including a renamed file's previous path.
    • A push is classified by its diff from that workflow's last successful push build on the branch, searching at most 10 pages of runs.
    • Any other event, or a branch with no such build, rebuilds everything.
  • The fix: GitHub keeps one pending run per concurrency group, so a newer master push can drop a queued one. A dropped push no longer leaves its StartWRT changes unbuilt and unpublished, because the next run's diff includes them. Before, paths: looked only at the triggering push's own commits.
  • .github/scripts/changed-products.mjs lists StartWRT with the paths and push-only release paths its filters had.
    • It records which workflow builds each product, and --workflow limits a run's output to that workflow's products. build-products.yaml's products= stays the four products that share the compile.
    • A product's own workflow file, the classifier and the shared script count as its inputs automatically.
  • Visible changes:
    • Every pull request now shows the detection check, and StartWRT's build jobs show as skipped when it isn't affected (before, the workflow didn't run).
    • When a pull request's base changes, StartWRT now builds only if the pull request touches it. Before, it always built.

Rerun-safe uploads.

  • scripts/s3-put-once.sh owns the S3 upload rule: an existing key fails the upload unless it already holds the same bytes, or the dispatch sets force-overwrite. StartOS's deploy legs and StartWRT's deploy both call it.
  • StartWRT behavior change: re-running a failed StartWRT deploy now skips the images it already uploaded instead of failing on them. Different bytes still fail. Its upload step also carries on past one failed image and fails at the end.
  • Where the script comes from: the StartOS deploy leg checks the script out from the commit the publish workflow runs on, not from the build commit it publishes, which can be older. A build already queued when this merges, or a deliberate republish of an older build, still finds the script. @helix-white's review caught that the first version took it from the build commit.

Also:

  • Permissions: pr-retarget.yml grants StartWRT's reusable-workflow call pull-requests: read and actions: read, which the new job needs. check-pr-retarget-workflows.py asserts it.
  • Publish-only path: a push that touches only scripts/s3-put-once.sh republishes StartOS and StartWRT. A pull request touching it builds nothing.
  • Docs: root AGENTS.md, StartWRT's AGENTS.md and StartWRT's build.mk header now name the shared product list instead of StartWRT's own filter.

Implementation diff: +198 / −138 lines in 7 files (excludes lockfiles, tests, docs, release notes, and changelog). I counted check-pr-retarget-workflows.py, a CI assertion script, as a test. The comment-only edits to startos-iso.yaml and StartWRT's build.mk count as docs.

Approach

  • This reuses perf(ci): build every product's binaries once per target #4763's classifier and push-diff logic instead of giving StartWRT copies. The logic moved into one script whose only parameter is the workflow name.
  • StartWRT keeps its own workflow rather than becoming a fifth job in build-products.yaml:
    • Its image build takes hours, and its deploy would hold the Build Products run open. The alpha apt publish waits for that run to finish.
    • Its binary can't share perf(ci): build every product's binaries once per target #4763's riscv64 compile anyway. It targets the K1 chip without vector instructions, while StartOS's riscv64 build enables them.
  • StartWRT's image and deploy gating is unchanged (dispatch, alpha registry variable, integration pull requests).

Testing

All 167 .github/actions tests pass locally on e7ef26274, along with the release-notes script tests and check-pr-retarget-workflows.py.

  • Classify steps: the tests run both workflows' real classify steps against fake gh and git. They cover pull request files, renames, a push diffed from the last successful run, recovery of a superseded push's changes, the 10-page search and dispatch. The StartWRT cases also check that it searches start-wrt.yaml's own runs.
  • Upload: StartOS's four upload cases now run through the shared script. A new StartWRT case checks that an image an earlier attempt uploaded is skipped and that different bytes are refused.
  • Script checkout: a new check evaluates both checkouts with different workflow and build commits. The upload script follows the workflow commit, and image assembly follows the build commit. It fails against the previous version of the workflow.
  • Lint: actionlint, run directly from its container because the repo has no recipe for it, reports only an info-level ls note in the migration-payload step, unchanged from master.
  • CI on e7ef26274 passed: 35 checks passed and 21 were skipped by design. The skipped ones are the deploy and publish jobs, which don't run on pull requests; migration images for platforms that have none; the OpenWrt image; and the retarget workflow's calls.
    • Both detection jobs ran the shared script. Build Products reported its four products and os-image=true, with StartWRT absent from products=. "Detect StartWRT changes" reported start-wrt=true and products=start-wrt, and StartWRT's riscv64 build then ran and passed.
    • The per-architecture and macOS builds, all nine images, the migration images and every test job passed. "Formatting & Lockfiles", which runs the .github/actions tests, passed as well.
  • Not exercised end to end:
    • The push path of the new job. The first master push after merge diffs from start-wrt.yaml's last successful push run, which predates this job.
    • StartWRT's deploy, which runs only on a dispatch or once STARTWRT_ALPHA_REGISTRY is set.

Neighbors

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

…products

StartWRT is a product like every other, so it now uses the CI mechanisms
#4763 built for StartOS and the debs instead of older copies of them:

- .github/scripts/classify-event.sh holds the event logic build-products.yaml
  ran inline: a pull request's files, or a push's diff from the workflow's
  last successful push build. start-wrt.yaml's new changes job runs it in
  place of its paths: filters, so a superseded queued push's StartWRT
  changes still build.
- changed-products.mjs lists StartWRT and records which workflow builds
  each product; --workflow limits its output to that workflow's products.
- scripts/s3-put-once.sh is StartOS's skip-identical-bytes S3 upload, now
  shared with StartWRT's deploy, so re-running a StartWRT deploy resumes it.
- pr-retarget.yml grants StartWRT's changes job the permissions it needs.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting one change on ac95e1f.

Load StartOS upload tooling from the workflow commit, not the published build's commit (.github/workflows/startos-image.yaml, deploy checkout). build-products.yaml dispatches the publisher on a branch and passes the original build SHA separately. A build already running when this PR merges can therefore invoke the updated workflow with a pre-PR inputs.commit. That checkout has no scripts/s3-put-once.sh, so every platform's upload fails with exit 127 after deploy-prepare has registered the version. Publishing an older retained build has the same problem.

The proposal checks out github.sha for the upload helper while retaining inputs.commit for image assembly and the published commit. It records that ownership, adds a regression assertion with distinct workflow/build SHAs, and corrects the publisher header's overly broad claim that every step uses the build commit.

Reviewed change classification, retarget permissions, and both upload callers. git merge-tree --write-tree origin/master HEAD reports no conflicts. Existing CI has no reported failures, with build/test jobs still pending. No builds, tests, or lint were run during review; the proposed regression assertion is unexecuted.

Proposed changes: ac95e1f...proposal/4779

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red

Copy link
Copy Markdown
Contributor Author

Adopted the proposal as e7ef26274, keeping your authorship.

  • Upload tooling from the workflow commit: the StartOS deploy leg now checks out scripts/s3-put-once.sh at github.sha, the commit the publish workflow runs from. Image assembly and release metadata keep inputs.commit.
    • A build already running when this merges, or a republish of an older retained build, now finds the script instead of failing every upload after deploy-prepare registered the version.
    • The header in startos-iso.yaml now names what uses the build commit (images and release metadata) instead of claiming every step does.
  • Similar cases: I checked the rest of this PR for tooling loaded from the build commit and found none.
    • StartWRT's deploy checks out the commit its own workflow runs from.
    • The classify step runs from the workflow's checkout.
    • deploy-prepare reads release metadata from the build commit by design.
  • Verification on e7ef26274:
    • All 167 .github/actions tests pass, including your new check of both checkouts with distinct workflow and build commits.
    • That check fails with ac95e1f5e's startos-image.yaml swapped back in.
    • Prettier is clean, and actionlint reports nothing new.
    • git merge-tree against master is clean.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on e7ef262. The change since my previous review matches the proposal and resolves the older-build deployment regression: upload tooling follows the workflow commit, while image assembly and published commit ownership remain pinned to the build. The contract comment, corrected publisher header, and distinct-SHA regression assertion are included.

git merge-tree --write-tree origin/master HEAD is clean. I read the author's verification report, including the regression failing with the previous workflow. Current CI is pending; no builds, tests, or lint were run during re-review. No remaining findings.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 17, 2026 20:12
@helix-red
helix-red dismissed helix-white’s stale review November 17, 2026 20:13

Dismissed by Helix: the changes require a substantive PR brief update. StartOS upload tooling now comes from the workflow commit rather than the published build commit, fixing missing-helper failures for older builds. The substantive brief must explain this tooling provenance change while distinguishing the unchanged build-pinned images and release metadata.

@dr-bonez
dr-bonez merged commit 91659ca into master Nov 18, 2026
64 checks passed
@dr-bonez
dr-bonez deleted the ci/start-wrt-shared-change-detection branch November 18, 2026 01:22
@MattDHill MattDHill added repo Repository maintenance StartWRT labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo Repository maintenance StartWRT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants