mirror of
https://github.com/hanzoai/git-runner.git
synced 2026-11-14 02:38:33 +00:00
The forge serves its runner surface as five typed zip operations. This is the half that calls them: zip.Dial and zip.Call by op name, so the body carries the same bytes both ends hold in memory, and the address is derived rather than spelled — the forge registers POST /v1/runner/<name>, zip derives post_runner_<name>, and TestOpNames pins our five literals against zip.ID so the two cannot drift. The types moved with the wire, and both moves were forced by it rather than chosen. A map is refused at encode, so secrets, vars, needs and a job's outputs cross as []Pair and are indexed once, at the boundary act wants a map at. A time.Time is accepted and then arrives as the zero time with no error anywhere, so every instant is an int64 of unix nanoseconds. Falling out of it: - Task.Context is a struct. As a map the forge wrote git_runtime_token while this runner read gitea_runtime_token and quietly fell back to the task token, so ACTIONS_RUNTIME_TOKEN was the wrong secret and the mask that keeps a runtime token out of a job's log covered nothing. A field is a compile error. - A transport timeout is an error again. It was read as "the designed idle path for a long poll" — fiction, the forge has never blocked — which counted it as an empty response AND reset the error counter, so a forge answering in six seconds against a five second wait was indistinguishable from an idle one in every log line and every metric, with the counter that would have raised the alarm suppressed. There is no long poll: task answers immediately and TaskIn.Queue is what makes an idle ask cost nothing. - fetch_timeout is now the ceiling on the wire. A zip.Call cannot be cancelled once it has left, so a per-request context bounds nothing and the wait has to sit on the transport, where it bounds every call. - The credential is a field, so header.go is gone. client.Forge stamps it and no caller carries it. - logs -> log, Row -> Line, NoMore -> Last, SentOutputs -> Stored. You append to a log, and the other four addresses are singular. - Insecure() had no caller. client.take copies every string and []byte out of a reply, and it is not belt-and-braces. ZAP reads text zero-copy — zap.Object.Text is an unsafe.String over the message — and zip.Call hands the response back to fasthttp's pool as it returns, so a reply's strings point at memory the next call writes over. A token registered as "runner-secret" read back "1.2.3r-secret" one call later, the version string of the call in between laid over its first five bytes, and the forge answered 401 to a runner that was registered. TestOwn fails without the copy. Delete it when zip copies on decode. client.dial declares its own transport scheme rather than taking http and https: declaring a scheme REPLACES what is registered under that name, and zip's own entries carry a Serve half this one does not — taking them left the process able to dial plain HTTP through zip and no longer able to serve it. .runner is untouched. Its uuid and token are exactly the credential the new wire sends, so a registration made before the cutover keeps working after it, and a runner only has to be rebuilt. Requires github.com/hanzoai/git at 92b2e84dba or later. Nothing here has been exercised against a live forge.