From 5f2768fcbc049d1cb75a89cd326833756d31781f Mon Sep 17 00:00:00 2001 From: Joshua Temple Date: Sun, 14 Jun 2026 16:32:28 -0400 Subject: [PATCH] test: add e2e regression guard for hyphenated build and deploy names Adds a runtime orchestrate scenario whose build (shared-lib) and deploy (web-api) names contain hyphens, asserting each job runs under act when its trigger fires and skips otherwise. Guards against a regression where the change-detection if: reference and the setup output key disagree on hyphen normalization, which silently skips the job. Closes #136 Signed-off-by: Joshua Temple --- .../orchestrate/hyphenated-names.yaml | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 e2e/scenarios/orchestrate/hyphenated-names.yaml diff --git a/e2e/scenarios/orchestrate/hyphenated-names.yaml b/e2e/scenarios/orchestrate/hyphenated-names.yaml new file mode 100644 index 00000000..b9bd7290 --- /dev/null +++ b/e2e/scenarios/orchestrate/hyphenated-names.yaml @@ -0,0 +1,92 @@ +name: "Hyphenated Build and Deploy Names Run" +description: | + Runtime regression guard for #127: a build or deploy whose name contains a + hyphen (shared-lib, web-api) must actually RUN under act, not be silently + skipped. + + The generator emits the change-detection if: condition referencing the + underscore-normalized output key (run_build_shared_lib), while the setup job + writes and passes through the matching output key. Before #135 the setter and + passthrough used the raw hyphenated name (run_build_shared-lib), which GitHub + Actions parses as subtraction inside an expression, so the reference never + resolved and the consuming job's if: was always false. The build/deploy was + skipped with no error. + + Step 1 commits a change touching only the build's lib/** trigger and asserts + the hyphenated build runs while the untouched hyphenated deploy skips. Step 2 + commits a change touching only the deploy's api/** trigger and asserts the + hyphenated deploy runs. Each orchestrate therefore pins one hyphenated job to + success and the other to skipped on the same run, proving the if: condition + tracks its own change-detection key rather than being always-true or + always-false. If the hyphen normalization regressed, run_build_shared-lib / + run_deploy_web-api would not match their if: reference and the expected-success + job would report skipped, failing the assertion. + +config: + trunk_branch: main + environments: [dev] + builds: + - name: shared-lib + workflow: build.yaml + triggers: ["lib/**"] + deploys: + - name: web-api + workflow: deploy.yaml + triggers: ["api/**"] + +steps: + # Touch only the build's lib/** trigger. Pre-#135 the hyphenated output key + # run_build_shared-lib never matched the if: reference, so the build was + # silently skipped; here it must run. + - name: "Commit touching only the hyphenated build trigger" + action: commit + commit: + message: "feat: add shared-lib source" + files: + lib/shared.go: | + package lib + + // Version is the shared library version marker. + const Version = "0.1.0" + + - name: "Orchestrate; hyphenated build runs, untouched hyphenated deploy skips" + action: orchestrate + expect: + state: + dev: + sha: commit1 + version: "v0.1.0-rc.0" + jobs: + # Load-bearing: the hyphenated build RAN. A skip is the #127 signature. + build-shared-lib: success + # The deploy's api/** trigger was untouched, so it must skip. This + # pins the if: condition to its own change-detection key. + deploy-web-api: skipped + + # Touch only the deploy's api/** trigger so the hyphenated deploy must run. + - name: "Commit touching only the hyphenated deploy trigger" + action: commit + commit: + message: "feat: add web-api source" + files: + api/server.go: | + package api + + // Listen is the web-api entrypoint marker. + func Listen() {} + + - name: "Orchestrate; hyphenated deploy runs, untouched hyphenated build skips" + action: orchestrate + expect: + state: + dev: + sha: commit2 + version: "v0.1.0-rc.1" + deploys: + web-api: + sha: commit2 + jobs: + # The build's lib/** trigger was untouched, so it must skip. + build-shared-lib: skipped + # Load-bearing: the hyphenated deploy RAN. A skip is the #127 signature. + deploy-web-api: success