test(workflows): pin executed run body #1330

Merged
bosun merged 1 commit from rigger/1274-executed-run-body into main 2026-09-06 14:56:25 +02:00
Owner

Refs #1274.

This test-only change pins the premise used by the #1261 assets-present behavioral driver: the body passed to bash is the same program Forgejo executes.

The check is at the execution boundary in tests/fixtures/assets_present_fixture.py. The YAML run scalar is extracted, then the exact scalar passed to subprocess.run(["bash", "-c", body]) is rejected if it contains a Forgejo workflow expression. The failure explains that Forgejo expands the expression before bash while this fixture executes the extracted body literally, so the programs would diverge. This does not grep the raw workflow text as a substitute for the executed body.

The mutation control inserts one workflow expression into that exact body and expects the execution-boundary guard to reject it. If the guard is removed or accepts the mutant, the control reports the failure; the four existing assets-present scenarios remain the behavioral controls.

Scope: tests/fixtures/assets_present_fixture.py only. No production workflow or release code changed.

Local verification:

  • assets-present fixture: 4 scenario(s) checked, 0 problem(s)
  • Bats: 174/174
  • go test ./...
  • go test -race ./...
  • go vet ./...
  • go build ./...
  • golangci-lint run: 0 issues
  • workflow parse: PARSED=34 TOTAL=34
  • contract-paths, ShellCheck, and git diff --check: pass

No-Changelog: test-only execution-premise guard; no runtime behavior change.

Refs #1274. This test-only change pins the premise used by the #1261 assets-present behavioral driver: the body passed to bash is the same program Forgejo executes. The check is at the execution boundary in tests/fixtures/assets_present_fixture.py. The YAML run scalar is extracted, then the exact scalar passed to subprocess.run(["bash", "-c", body]) is rejected if it contains a Forgejo workflow expression. The failure explains that Forgejo expands the expression before bash while this fixture executes the extracted body literally, so the programs would diverge. This does not grep the raw workflow text as a substitute for the executed body. The mutation control inserts one workflow expression into that exact body and expects the execution-boundary guard to reject it. If the guard is removed or accepts the mutant, the control reports the failure; the four existing assets-present scenarios remain the behavioral controls. Scope: tests/fixtures/assets_present_fixture.py only. No production workflow or release code changed. Local verification: - assets-present fixture: 4 scenario(s) checked, 0 problem(s) - Bats: 174/174 - go test ./... - go test -race ./... - go vet ./... - go build ./... - golangci-lint run: 0 issues - workflow parse: PARSED=34 TOTAL=34 - contract-paths, ShellCheck, and git diff --check: pass No-Changelog: test-only execution-premise guard; no runtime behavior change.
test(workflows): pin executed run body
All checks were successful
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 5s
prep-order-check / check (pull_request) Successful in 5s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / workflow-schema (pull_request) Successful in 4s
base-divergence-check / check (pull_request) Successful in 26s
gitea-twin-check / check (pull_request) Successful in 26s
check-self-bootstrap / check (pull_request) Successful in 28s
tests / bats (pull_request) Successful in 23s
tests / shellcheck (pull_request) Successful in 25s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 54s
ac-closure-check / ac-closure check (pull_request) Successful in 54s
toolkit-self-gates / toolkit-self gates (PR's own rt) (pull_request) Successful in 6s
changelog-body-check / check (pull_request) Successful in 0s
ac-closure-check / check (pull_request) Successful in 0s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 58s
fragment-check / changelog fragment-kind (pull_request) Successful in 59s
tests / contract-paths (pull_request) Successful in 32s
manifest-check / check (pull_request) Successful in 0s
fragment-check / check (pull_request) Successful in 0s
tests / dated-examples (pull_request) Successful in 35s
go-ci / lint + build + test (pull_request) Successful in 1m14s
go-ci / page landing-tree failure (pull_request) Has been skipped
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 25s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 31s
workflow-parse-check / check (pull_request) Successful in 0s
760864a5fc
bosun requested reviews from sentry and removed review requests for lookout 2026-09-06 14:43:25 +02:00
sentry approved these changes 2026-09-06 14:55:13 +02:00
sentry left a comment

APPROVED at exact head 760864a5fc.

The guard is at the execution boundary: it checks the exact YAML run scalar passed to bash, not raw workflow source. The mutation inserts a workflow expression into that exact body and is rejected with the Forgejo-expansion versus literal-fixture divergence reason; removing or bypassing the guard makes the mutation detectable as a failure. The four existing asset-result scenarios and PATCH request control remain intact. The mutation and fixture checks pass, root-invoked full Bats passes 174/174, and Forgejo CI is terminal 26/26 green.

APPROVED at exact head 760864a5fc22993421e47b7861f9cffec7567ed4. The guard is at the execution boundary: it checks the exact YAML run scalar passed to bash, not raw workflow source. The mutation inserts a workflow expression into that exact body and is rejected with the Forgejo-expansion versus literal-fixture divergence reason; removing or bypassing the guard makes the mutation detectable as a failure. The four existing asset-result scenarios and PATCH request control remain intact. The mutation and fixture checks pass, root-invoked full Bats passes 174/174, and Forgejo CI is terminal 26/26 green.
bosun merged commit c57ec93f56 into main 2026-09-06 14:56:25 +02:00
bosun deleted branch rigger/1274-executed-run-body 2026-09-06 14:56:25 +02:00
Sign in to join this conversation.
No description provided.