broker auto-deploy: the .forgejo rail (ci.yml publish-broker + broker-deploy.yml) — protected-path half of #688 #689
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#689
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Why (protected path — filed from #688 by a Sandcastle worker)
#688 asks the broker to ride the ADR 0185 auto-deploy rail. Two of its
deliverables live under
.forgejo/workflows/, which is a protected path(rule 9 / #445): a worker that edits it has the change rolled back and the run
failed loud. So the worker landed everything else for #688 — the install leg
scripts/broker/idss-broker-install.sh(offline-tested,scripts/tests/broker-install-test.sh), thebroker/README.mdrunbook, and thedocs/GOTCHAS.md#59 entry — and files the.forgejo/half here for a sessionto apply (ADR 0174: a
.forgejo/machinery change needs an interactivesession's standing).
The install leg is already merged and proven: a session only needs to add the
two workflow pieces below and confirm one real publish+deploy.
Deliverable 1 — CI publishes the broker
Add a
publish-brokerjob to.forgejo/workflows/ci.yml, mirroring the existingpublish(agent) job: on a push tomainwhose range touchedbroker/**(orgo.mod/go.sum), buildourcloud-brokerand PUT it to the Forgejo genericregistry as
idss-broker/<fullsha>/ourcloud-broker-x86_64(+.sha256+ aRELEASEfile), idempotent on 409. Usessecrets.REGISTRY_FORGEJO_TOKEN(theswarm token has no
write:packagescope — see thepublishjob's comment).Proposed job (starting point — match the
publishjob's PATH/nix idiom):Deliverable 3 — the deploy workflow
Add
.forgejo/workflows/broker-deploy.ymlon thematou-workstationrunner (onthe Netbird mesh):
workflow_dispatchwith ashainput, and an automatic runafter CI's publish job on
main—ssh deploy@100.98.48.68 sudo /usr/local/sbin/idss-broker-install <sha>, key =secrets.BROKER_DEPLOY_SSH_KEY(a NEW
deployuser's key, NOTdev).Starting point:
The docs-only guard (the "Skip if not published" step) is the one nuance to get
right:
workflow_runfires for everycirun, butpublish-brokerskipsnon-broker pushes, so the deploy must no-op when the sha has no package rather
than red on a missing download.
Acceptance (from #688)
broker/**change tomainproduces a registry package for that sha(CI green).
workflow_dispatchofbroker-deploywith that sha (once the droplet half —the
ready-for-humansibling of this issue — is in place) ends withbroker booted … version=…in the journal andofferanswering.Non-goals
Same as #688: no blue/green, no containerising, no env/credential-layout change.
Depends on the droplet one-time setup (its own
ready-for-humanfollow-up) andthe repo secrets
REGISTRY_FORGEJO_TOKEN(exists) +BROKER_DEPLOY_SSH_KEY(new).Close report
Landed the
.forgejo/half of #688's auto-deploy rail (this ticket's whole scope):publish-brokerjob added to.forgejo/workflows/ci.yml(164027d8) — mirrors the existingpublishjob: on a push tomaintouchingbroker/**/go.mod/go.sum, buildsourcloud-brokerand PUTs it to the Forgejo generic registry asidss-broker/<fullsha>/ourcloud-broker-x86_64(+.sha256+RELEASE), idempotent on 409, no-op on an unrelated push..forgejo/workflows/broker-deploy.ymladded (164027d8) —workflow_dispatch(shainput) or automaticworkflow_runaftercionmain, with a skip-if-not-published guard, thenssh deploy@100.98.48.68 sudo /usr/local/sbin/idss-broker-install <sha>.Both were a session's-standing edit —
.forgejo/workflows/is a protected path a worker cannot touch (#445) — landed directly, no ADR 0174 judgement call involved (the YAML was fully specified by this ticket).Live proof (acceptance criterion 1 — CI green, real registry package)
Pushed
0763e143(a genuinebroker/README.mdchange) tomain:seam→ green,publish-broker→ green (run 9136, job 18156).GET .../packages/Matou/generic/idss-broker/0763e143dba1b362bdc44bfc5aa8f0c8a66b1841/{ourcloud-broker-x86_64,ourcloud-broker-x86_64.sha256,RELEASE}→ all200,RELEASEcorrectly names0763e143dba1b362bdc44bfc5aa8f0c8a66b1841.ci.ymlmanually (no broker change in the dispatch's own diff window) leaves bothpublish/publish-brokerskipped— never fires off-push, matching the existingpublishjob's own discipline.broker-deploy.yml — dispatched against the same sha
Resolved the sha and correctly detected the package as published (
go=1), then failed at thesshstep — expected: #690 (droplet one-time setup:deployuser, sudoers line,BROKER_DEPLOY_SSH_KEYsecret) is stillready-for-humanand open, so the secret doesn't exist yet. No risk to the live broker — nothing on the droplet trusts this key until #690 lands, and the installer's own rollback discipline (#688) covers the day it does.What's left
Full end-to-end proof (
workflow_dispatchofbroker-deployending inbroker booted … version=…+ a 200 from/v1/gateways/offer) is gated on #690 alone now — this ticket's own acceptance criteria already scoped it that way. Nothing further for a session to do here.STATUS.mdupdated in164027d8/a91b3b7f.broker/README.md's "Deploy" section updated to match.Ruled by agent under ADR 0174 (rule 5,
ready-for-session— protected-path edit, no judgement call) — veto anytime.