Skip to content

fix(ci): pass PR body via heredoc + --body-file in backmerge workflow - #11

Merged
lorem-dev merged 5 commits into
mainfrom
develop
May 24, 2026
Merged

fix(ci): pass PR body via heredoc + --body-file in backmerge workflow#11
lorem-dev merged 5 commits into
mainfrom
develop

Conversation

@lorem-dev

@lorem-dev lorem-dev commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #10: the previous backmerge workflow was rejected by GitHub Actions with "Invalid workflow file" on the multi-line PR body. This fix rewrites the offending step to build the body via a heredoc and pass it to gh with --body-file, with ${{ }} expressions routed through env: vars.

YAML now parses cleanly (verified locally with python3 -c "import yaml; yaml.safe_load(...)").

Test plan

  • After merge, push a small no-op commit to main (or wait for the next release) and confirm the workflow opens a PR main -> develop.
  • Confirm Actions tab no longer shows "Invalid workflow file" on backmerge.yml.

lorem-dev added 5 commits May 24, 2026 20:29
The previous version inlined the PR body as a multi-line bash double-quoted
string inside a YAML literal block, with embedded ${{ ... }} expressions
and backslash-escaped backticks. GitHub Actions rejected this as invalid
workflow YAML.

Rewrite: pipe github.workflow / github.run_id through env: vars, build the
body in a heredoc, and pass it to gh via --body-file. No nested quoting,
no escape gymnastics, and YAML now parses.
Adds focused unit tests across internal/{cli,bundled,daemon,initflow,
mcp,pinentry,shellhook} and the five internal/initflow/agents/*
packages so make test-coverage stays green on ubuntu CI. The
plugins/gopass tests previously skipped when the gopass binary was
absent on PATH; rewrite them to use the existing cmdFactory
injection seam so coverage no longer depends on the host having
gopass installed.

Also extend the TestStop_KillsListenerAndWaits timeouts from 2s to
10s. The helper-binary build + start cycle exceeds 2s on loaded CI
runners; the larger headroom does not change the behaviour the test
is asserting.

No production code is modified.
The catch-all coverage_extra_test.go files were unhelpful names. Move
each test next to the source file it exercises:

  internal/cli/coverage_extra_test.go  -> cli_error_paths_test.go
  internal/mcp/coverage_extra_test.go  -> transport_http_extra_test.go,
                                          transport_sse_extra_test.go,
                                          runner_internal_test.go,
                                          proxy_internal_test.go,
                                          secrets_internal_test.go,
                                          config_internal_test.go

The _internal_test.go suffix marks files that live in package mcp
alongside the existing package mcp_test files of the same source.

Also addresses lint findings introduced by the earlier coverage push:
removes a govet shadow in plugins_cmd_test.go and two unused
nolint:errcheck directives in bundled/shellhook tests.
ci.yml had a manual actions/cache step extracting into ~/go/pkg/mod
right after actions/setup-go@v5 had already populated it with its
own cache. The macOS gtar 'File exists' errors observed on every run
came from that double-extraction. setup-go's built-in cache covers
the same paths; pass cache-dependency-path to include the workspace
go.sum files and the go.work*.

Also document that superpowers skills must use codegraph_* tools for
code navigation. Sub-agents dispatched from those skills inherit the
same rule.
The six internal/mcp test files added in c99b6b0 / 5425688 (transport
http+sse extra, runner/proxy/secrets/config internal) cause a 3-minute
timeout on the ubuntu-latest CI runner under -covermode=atomic.
Locally on macOS (with -race -count=5) all tests pass in ~6s; the
hang reproduces only on linux CI scheduling.

Rather than ship a red CI, revert the additions. mcp returns to 84%
coverage. The 90% gate is enforced by make verify (not CI), so this
unblocks merges while a follow-up isolates which test races with
itself only on linux.

Suspected culprits, to investigate in the follow-up:
  - TestStreamableHTTP_Send_CtxCanceledDuringForward (unbuffered chan
    + cancel-via-timer race)
  - TestAutoTransport_ForwardFrom_ChanClosed (tr.Close goroutine
    cleanup may deadlock)
  - TestSSETransport_Connect_CtxCanceledBeforeEndpoint (server holds
    SSE stream via <-r.Context().Done(); cancel propagation flaky on
    linux)
@lorem-dev
lorem-dev merged commit 6b0a069 into main May 24, 2026
6 checks passed
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