ci: reserve ci/* statuses for the runner; tree reuse excludes untrusted builds #258

closed cmc opened this on 2026-09-28 02:36 UTC · ci mr security

Discussion

cmc 2026-09-28 02:36 UTC

Commit statuses that gate merges can be written by anyone with write access, and tree dedupe reuses results across trust domains.

  • status set (internal/control/status.go:76) requires write and accepts any context, ci/* included. A writer can mark ci/test green on their own MR head before or instead of the build. The runner's own path is internal/control/build.go:687.
  • MergeGates (internal/control/mr.go:1579) requires every present status to be green. Built-in CI writes pending for every job at push time (build.go:890), so the gap is external reporters: the first green one satisfies the gate before the others report.
  • SuccessBuildForTree (internal/store/builds.go:458) keys on repo, tree and job. A successful untrusted fork build, or one on an older image, can stand in for a trusted run.

Changes:

  • Reserve the ci/ prefix for the build subsystem; status set refuses it.
  • Tree reuse excludes untrusted builds and includes the job's image in the key.
  • Optional: a required-contexts list under repo settings, missing contexts pending.

referenced in commit 7a6343d02d by cmc: wiki: architecture and security pages

2026-09-28 04:30 UTC

referenced in commit 4e0958a163 by cmc: plans: open issues from the architecture and UX reviews

2026-09-28 05:43 UTC

referenced in commit b711b70da5 by cmc: plans: apply decisions on the open questions

2026-09-28 06:16 UTC

referenced in commit 42a7b1230c by cmc: wiki, changelog: last finisher sets ci/; required contexts report on heads

2026-09-28 22:33 UTC

referenced in commit 7a5f2a1a5c by cmc: changelog: #255, #258

2026-09-28 22:33 UTC

closed by cmc in commit d19e5181c5: wiki: reserved ci/ statuses, trusted reuse, required contexts

2026-09-28 22:33 UTC

referenced in commit dc10160221 by cmc: repo settings: required contexts turn the checks gate on, pending until reported

2026-09-28 22:33 UTC

referenced in commit b1f4bf1aaf by cmc: ci: reuse only trusted results on the job's image

2026-09-28 22:33 UTC

referenced in commit b022fedfc0 by cmc: status set: ci/ is reserved for the instance's builds

2026-09-28 22:33 UTC