feat(local): auto-apply registry patches with a build-env trial-build gate #124
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/auto-apply-patches"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the classifier loop (issue #115, step 3): turns the auto-proposable candidates into an actual PR, gated by a real trial build in our own build-env images.
Chosen model (from the design discussion): autonomous PR, PR-first with a CI trial-build gate, bounded top-N batch per run.
Creating the patch PR
propose-patches.Rgains:--limit N-- act on the top-N candidates by failure volume; the rest defer to the next run (logged).--open-pr-- write the entries onto the reusedauto/registry-patch-proposalsbranch, push (withREPO_RW_TOKEN), and open/update one PR via the Forgejo API (so re-runs update the same PR instead of piling up)..crow/auto-apply-patches.yaml-- a single job that runs--open-pr --limiton a cron/manual trigger. NeedsFORGEJO_TOKEN+ a write-scopedREPO_RW_TOKEN.Novel source diffs and unknown signatures are still never proposed; nothing merges.
The merge gate (our build-env images)
.crow/trial-build-registry.yaml-- matrixed over the realOS/IMGbuild-env matrix (alpine:3.24, redhat:8/9/10, ubuntu:jammy/noble/resolute for ubuntu-2604). Each platform runslocal/trial-build-registry.R, which diffs the branch registry againstmainand trial-builds only the entries the branch adds that apply to that platform, insidereg.devxy.io/rpkgs/build-env-*. Green only if every new entry builds; a platform with no new entries is a fast no-op. Nothing is uploaded/archived/recorded.registry.jsonatmain, rather than silently treating the base as empty and trial-building the whole registry.Notes / follow-up
pull_requesttriggers, so the gate runs manually or on a cron against the branch (--var patch_branch=...). Wiring it to fire automatically on the PR needsevent: pull_requestenabled on the Forgejo webhook -- a one-line addition once that's on.auto-apply-patchesandtrial-build-registry. New secret needed:REPO_RW_TOKEN(write scope) for the push.Verification
entry_applies_to_os()/new_registry_packages()covered by tests (platform codename/family/wildcard matching; added-vs-unchanged entry detection; per-platform filtering).--limitsmoke (stubbed DB): top-2 by volume proposed, 3 deferred, candidate registry validates.