Skip to content

chore(frontseat-plugin-release-flow): GH-168 guard the generated workflow - #276

Closed
joaodinissf wants to merge 2 commits into
mainfrom
chore/168-sync-guard-restored
Closed

chore(frontseat-plugin-release-flow): GH-168 guard the generated workflow#276
joaodinissf wants to merge 2 commits into
mainfrom
chore/168-sync-guard-restored

Conversation

@joaodinissf

Copy link
Copy Markdown
Collaborator

Replaces #247, which I closed by accident — merging #246 with gh pr merge --delete-branch deleted this branch's base and GitHub closed the dependent PR rather than retargeting it. Unrecoverable: a closed PR cannot be reopened while its base is missing, nor retargeted while closed. #275 adds the rule so it does not recur.

Same commits, rebased onto main. Authored by @jbadeau — the rebase preserves authorship; I am only the committer. The rebase also dropped 721de1c, which reached main via #246, automatically: git rebase skips commits whose patch-id already exists upstream.

Carrying forward the review context lost with the old thread. Everything raised was addressed in 3a8911e:

  • repoRoot() walks up to go.work from the process CWD instead of runtime.Caller, so GOFLAGS=-trimpath no longer resolves to a module-relative path that never exists. It was skipping locally too, not just in the sandbox.
  • The skip logic is inverted: it skips only when go.work is unreachable. Once the root is found, a missing ci.yml produces drift and fails — so deleting the workflow now fails the test rather than passing it green.
  • releaseFlowOptions(root) reads spec.plugins["frontseat/release-flow"].options from frontseat.yaml and passes them to Configure, so the render tracks workspace config. That removes the whole class: any option added later flows through, and -update can no longer strip workspace settings out of the committed workflow.
  • gofmt clean; the redundant && frontseat daemon restart dropped from the drift message; the hk glob narrowed to .github/workflows/ci.yml so it no longer fires on the hand-written onboarding-eval.yml.

Agreed on the framing too: this is a source-level guard for local runs complementing github:sync in CI, not a CI check itself, and the doc comment now says so.

This pull request was published with assistance from Claude.

Jose Badeau and others added 2 commits July 30, 2026 21:16
…flow

TestRepoWorkflowInSync renders the CI workflow from the checked-out
template source and byte-compares it against the committed
.github/workflows/ci.yml — immune to installed-plugin version skew;
-update regenerates the file daemon-free. An hk pre-commit step runs it
on any commit touching the workflow or the plugin sources, so hand
edits to the generated file and template changes committed without
regenerating both fail at commit time. hk stays a local dev tool
(mise.local.toml, gitignored). CLAUDE.md documents the workflow and the
version-skew trap; the general fingerprint-stamped drift detection is
issue GH-248.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ally run

Address review: the guard skipped on every run and rendered against the wrong
config.

- Locate the repo by walking up to go.work from the process CWD instead of
  runtime.Caller, which GOFLAGS=-trimpath (set by the go plugin) rewrites to a
  module-relative path that never resolves — the test skipped locally too, not
  only in the hermetic sandbox. Skip only when go.work is genuinely
  unreachable; once the root is found a missing ci.yml is drift, not a green
  skip, so deleting the workflow now fails the test.
- Render with the plugin's real options read from frontseat.yaml
  (spec.plugins["frontseat/release-flow"].options) rather than nil, so the
  render matches what `frontseat sync` produces and -update can't strip
  workspace-configured settings out of the committed workflow.
- gofmt the drift message; drop the redundant `frontseat daemon restart`
  (mise dev already restarts it).
- Narrow the hk glob to .github/workflows/ci.yml so it no longer fires on the
  hand-written onboarding-eval.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYAgCD9HZHZWEuH4vF17p1
@joaodinissf

Copy link
Copy Markdown
Collaborator Author

Superseded — #247 itself was recoverable after all.

Recreating the deleted base ref lets GitHub reopen it, and once open the base can be retargeted to main. That restores the original PR with its full review history and jbadeau as author, which this replacement could not do.

Recipe, for the record:

gh api -X POST repos/OWNER/REPO/git/refs -f ref=refs/heads/DELETED_BASE -f sha=MERGED_HEAD_SHA
gh pr reopen N
gh api -X PATCH repos/OWNER/REPO/pulls/N -f base=main
gh api -X DELETE repos/OWNER/REPO/git/refs/heads/DELETED_BASE

The order matters: a closed PR cannot be retargeted, and a PR with a missing base cannot be reopened.

@joaodinissf
joaodinissf deleted the chore/168-sync-guard-restored branch July 30, 2026 19:21
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.

2 participants