ci: the sync runs on the forge, upstream's CI with it (#13) #14
Loading…
Reference in a new issue
No description provided.
Delete branch "pluto/13-sync-on-the-forge"
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?
Purpose (platform): the engine sync's gate is defined without upstream's GitHub CI run, so the sync runs on the forge, once a day, and upstream syncs resume (martha-ai/martha-engine#13, RULED option (c)).
What this does
The forge reads only
.forgejo/workflowsonce it exists (#11), so.github/workflows/martha-engine-sync.ymlnever runs here and its second gate, upstream'sci.ymldispatched on github.com, cannot run at all. This is the forge's form of the sync..forgejo/workflows/martha-engine-sync.yml: the sync job. Daily at 04:00 UTC (schedule:) plusworkflow_dispatchwithresume; the fivegithub.server_url == 'https://github.com'guards are gone. When upstream has not moved,pick_the_upstream_change.shprintssync=and merge, upstream-ci and pull-request all skip: no dispatch, no pull request..forgejo/workflows/upstream-ci.yml: upstream'sci.ymljob for job, fifteen of them, onworkflow_dispatchONLY, so it runs on the sync branch and nowhere else and cannot undo #11. Forge adaptations carried from the four jobs.forgejo/workflows/ci.ymlalready runs: the pinned toolchain copy in this tree instead of the marketplace action, norust-cache, anapt-getstep for what a github.com runner image ships (sudo, pkg-config, libclang, cmake, jq, tini).changesanswerscode=truebecause a dispatched run exists only to be the gate.upstream-cidispatches that copy through the forge's API (POST /actions/workflows/upstream-ci.yml/dispatcheswithreturn_run_info), so the forge names the run and the job waits on it by id.martha/sync/dispatch_and_watch_the_run.sh; exit 0 green, 1 red or refused, 2 out of time.pull-requestreads the branch's tip through the forge's API and prints the forge's own command, in place ofgh apiandgh pr create.martha/sync/report_the_sync_for_a_pull_request.sh.checkscalls./.forgejo/workflows/martha-engine-checks.ymlwith the branch asref; that file gainsworkflow_callwith therefinput its jobs already read.push_the_sync_branch.shkeeps the GitHub fallback text byte for byte and adds the forge's: the forge has no rule that a token push may not touch.github/workflows, so a refused push there is a refused push, and the path it prints is the forge's..githubis untouched, byte for byte.Proof
martha/sync/dispatch_and_watch_the_run_test.shagainst a stub forge: the request (workflow file, ref,return_run_info), every request carrying the token as a header rather than on a command line, a green run, a red run, a refused dispatch (no poll), and a run that outlasts the wait. All pass.400 {"message":"reference 'refs/heads/no-such-branch-pluto-probe' does not exist"}. Route and token good; the 201 path is what Done-when 1's run proves..forgejoYAML files parse;upstream-ci.ymlhas 15 jobs andworkflow_dispatchas its only trigger;martha-engine-sync.ymlhas 5 jobs onscheduleandworkflow_dispatch.Not proven yet, and on the issue
Done-when 1 (a real sync end to end, gate green, merged, run ids) and Done-when 2 (the first scheduled run seen firing) are after this lands: both need the files on
main.Refs martha-ai/martha-engine#13
Three things my own read of the diff found before review: - upstream-ci.yml carried `permissions: {}`, which upstream's ci.yml does not. A block there can only narrow what the forge hands a job, and these jobs need to read the repository: drop it. - The gate dispatches fifteen upstream jobs with no cargo cache on a runner that carries three at a time, so it is hours rather than minutes: the upstream-ci job times out at 300 minutes and the wait gives up at 285, a quarter of an hour earlier, so a stuck gate says so itself. - report_the_sync_for_a_pull_request.sh no longer insists on a run id: a provider that sets no GITHUB_RUN_ID would otherwise fail the report rather than print the branch.