Skip to content

Fix evidence-regression workflow: pin past v0, add 'pr' field to plan#579

Merged
riddim-developer-bot[bot] merged 1 commit into
mainfrom
fix-evidence-action-pin
May 25, 2026
Merged

Fix evidence-regression workflow: pin past v0, add 'pr' field to plan#579
riddim-developer-bot[bot] merged 1 commit into
mainfrom
fix-evidence-action-pin

Conversation

@riddim-developer-bot

Copy link
Copy Markdown
Contributor

Why

The first dispatch of evidence-regression.yml failed in ~1 second with Missing required option --repo. and a separate local CLI attempt failed with Invalid PR change evidence plan: missing required field 'pr'. Two distinct bugs:

  1. Workflow pinned to RiddimSoftware/evidence@v0 — the v0 tag was created in RiddimSoftware/evidence before EVI-7 (#39) wired capture-pr argument translation into action.yml. At @v0, the case "${subcommand}" block has no capture-pr) branch, so the action invokes the CLI as bare evidence capture-pr with no flags. The 30-minute build never happens — the action fails at CLI argument parsing.
  2. regression-parliament-calendar.json was missing the pr field — the CLI's plan loader validates pr as required even when the --pr flag is passed as override. Local dispatch hit this gate before any build.

What changed

  • .github/workflows/evidence-regression.yml — pin to RiddimSoftware/evidence@fc65484f400ec8bc0ded78a70fb54ed32f7dfa6d, the current HEAD of evidence/main, which is past EVI-7. Inline comment notes the temporary nature: the right long-term fix is to fast-forward the v0 tag in RiddimSoftware/evidence so all consumers get the fix, after which we can return to @v0.
  • .evidence/regression-parliament-calendar.json — add "pr": 542 as the conventional placeholder (the cyclomatic-project's trigger PR, EPAC-1985). The CLI's --pr flag and the workflow's pr_number input still override at dispatch time, so this only sets metadata in manifest.json when no override is supplied.

Trade-offs not taken

  • Did not move the v0 tag in RiddimSoftware/evidence. That would silently affect every consumer. Pinning my workflow to a specific SHA is reversible and contained.
  • Did not add a CI gate that validates plans against the schema. Out of scope for this fix; if plan validation becomes a recurring failure mode I'd file a follow-up to add a swift test step that parses every .evidence/*.json through the plan loader.

Test plan

  • actionlint .github/workflows/evidence-regression.yml — clean.
  • Local evidence capture-pr ... --plan .evidence/regression-parliament-calendar.json ... against the project boundary SHAs (9ba487ca79e3b0bc) — the CLI accepted the plan and started both builds (the local Mac hit an unrelated xcodebuild post-build network stall that does not reproduce on macos-14 runners; documented in the session, not blocking this PR).
  • After this merges, the dispatch command for the cyclomatic pilot is:
    gh workflow run evidence-regression.yml -R RiddimSoftware/epac --ref main \
      -f plan_path=.evidence/regression-parliament-calendar.json \
      -f pr_number=542 \
      -f before_sha=9ba487ca2fdb2ecfa4fe722d0c353944284bc9ff \
      -f after_sha=79e3b0bc2904dcc69e53975142deb4283f5f8c6d \
      -f linear_issue_id=EPAC-1997 \
      -f output_subdir=pilot-cyclomatic-complexity
    
    Note -f pr_number=542 is now required (the action's pre-check at any post-EVI-7 SHA requires it; prior attempt omitted it).

Reviewer-Boundary: review-only

…r' to plan

The first attempt to dispatch evidence-regression.yml against the
cyclomatic pilot failed with "Missing required option --repo." after
the action invoked the evidence CLI as bare `evidence capture-pr`.
Root cause: the `v0` tag in RiddimSoftware/evidence was created before
EVI-7 (#39) wired the capture-pr argument translation into action.yml.
At @v0, the action's case statement has no `capture-pr)` branch, so it
runs the CLI without `--repo`, `--pr`, `--plan`, `--output`, etc.

Pinning to a SHA past EVI-7 (fc65484f400ec8bc0ded78a70fb54ed32f7dfa6d,
the head of evidence/main as of this commit) restores the wiring. This
is a temporary fix — the right long-term move is to fast-forward the
`v0` tag in RiddimSoftware/evidence, after which we can move back to
`@v0` for cross-repo consistency.

The second issue was the plan itself: regression-parliament-calendar.json
omitted the `pr` field, which the CLI requires even when --pr is passed
as an override. Added `pr: 542` as the conventional placeholder (the
cyclomatic-project trigger PR). The CLI's --pr flag and the workflow's
pr_number input still override at dispatch time, so this value only
affects metadata in manifest.json when no override is supplied.

Local capture-pr against project-boundary SHAs (9ba487c79e3b0b)
is currently running to validate the plan end-to-end before the next
CI dispatch.
@riddim-developer-bot
riddim-developer-bot Bot enabled auto-merge (squash) May 25, 2026 06:17
@riddim-developer-bot
riddim-developer-bot Bot merged commit d78c745 into main May 25, 2026
5 checks passed
@riddim-developer-bot
riddim-developer-bot Bot deleted the fix-evidence-action-pin branch May 25, 2026 06:20
sunnypurewal added a commit that referenced this pull request May 25, 2026
## Why

[PR #579](#579) pinned
`RiddimSoftware/evidence@fc65484` to get past EVI-7's capture-pr
argument wiring. That pin is **still missing EVI-11 (#41)**, which fixed
a pipe-buffer deadlock in `CommandRunner.swift`. Diagnosed during
local-first validation of the cyclomatic-complexity pilot — the
pre-EVI-11 CLI hung at 12+ minutes post-compile on local runs.

## What the bug was

The pre-EVI-11
`ProcessCommandRunner.run(_:_:workingDirectory:environment:)` created
pipes for the child process's stdout/stderr, then called
`process.waitUntilExit()`, then read the pipes. macOS pipe buffer is
16-64 KB; `xcodebuild` emits megabytes during a build. The buffer fills
mid-build, xcodebuild's writer thread blocks waiting for a drain, no one
drains until after the wait — **classic textbook deadlock**. `.app`
files appear on disk (the build steps themselves succeed) but xcodebuild
can never exit.

EVI-11 fixed it with `readabilityHandler`-based concurrent draining.
Verified locally: pre-fix binary hung at 12+ minutes on a build that the
post-fix binary completes in ~1 minute.

CI happens to mask this because the action's `${cli} ${args[@]}`
invocation has a downstream shell pipe that drains the stdout
transitively. Local invocations (no downstream pipe) hit the deadlock
directly.

## What changed

Bump `RiddimSoftware/evidence@fc65484f400ec8bc0ded78a70fb54ed32f7dfa6d`
→ `RiddimSoftware/evidence@e76e7991b7eda56857080e46fd84ec6ebb642161`
(current `evidence/main`, post-EVI-11). The inline workflow comment is
updated to explain the second pin requirement so future maintainers know
why this isn't `@v0`.

## Trade-offs not taken

- **Did not move the `v0` tag in `RiddimSoftware/evidence`.** That's the
right long-term fix (so we can return to `@v0`), but it would silently
affect every consumer. Pinning here is reversible and contained.
- **Did not change the local CLI invocation.** Local runs were also
affected, but the fix lives in the upstream evidence repo, not in any
consuming workflow.

## Test plan

- `actionlint .github/workflows/evidence-regression.yml` — clean.
- Local CLI run with a binary rebuilt from
`e76e7991b7eda56857080e46fd84ec6ebb642161` of `evidence` — used the same
pipeline to validate the fix worked (the pipeline now produces evidence
end-to-end where the prior CLI hung).
- After this merges, the canonical dispatch is unchanged:
  ```
gh workflow run evidence-regression.yml -R RiddimSoftware/epac --ref
main \
    -f plan_path=.evidence/regression-parliament-calendar.json \
    -f pr_number=542 \
    -f before_sha=9ba487ca2fdb2ecfa4fe722d0c353944284bc9ff \
    -f after_sha=79e3b0bc2904dcc69e53975142deb4283f5f8c6d \
    -f linear_issue_id=EPAC-1997 \
    -f output_subdir=pilot-cyclomatic-complexity
  ```

Reviewer-Boundary: review-only

---------

Co-authored-by: Sunny Purewal <sunny@riddimsoftware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant