Skip to content

fix(packaging): keep the cask postflight installable under Homebrew's install steps - #676

Merged
piekstra merged 1 commit into
mainfrom
fix/cask-postflight-install-steps
Oct 21, 2026
Merged

piekstra merged 1 commit into
mainfrom
fix/cask-postflight-install-steps

Conversation

@piekstra

Copy link
Copy Markdown
Member

Summary

The published codereview-cli cask has been invalid under Homebrew's install-step DSL since the catalog refresh was added to the postflight hook. Homebrew rejects it with undefined method 'system_command' for an instance of Homebrew::InstallSteps::DSL, so brew upgrade fails and brew outdated silently leaves cr out.

The shared release workflow's modernizer turns each line that starts with system_command into a run step. The refresh line assigned the result (result = system_command ...) and the next line called opoo, so both stayed in the postflight_steps block.

  • Drop the install-time cr catalog update. The binary ships an offline catalog baseline, and install steps run sandboxed without network access by default, so the refresh has no working equivalent there.
  • Caveats point to cr catalog update.
  • scripts/verify-package-render.sh now requires every postflight line to be a bare system_command call, the form the modernizer converts.

The companion change makes the modernizer fail on a call it cannot convert: open-cli-collective/.github#51

Validation

  • goreleaser release --snapshot --clean --skip=publish,before then scripts/verify-package-render.sh: OK.
  • The rendered cask, passed through actions/homebrew-alias/modernize.sh render, loads in Homebrew 7 (Cask::CaskLoader::FromContentLoader) with a PostflightSteps artifact. The currently published cask fails the same load with the error above.
  • Reinserting the result = system_command ... line into the rendered cask makes the render check fail.

… install steps

The release workflow rewrites GoReleaser's legacy postflight block into
Homebrew's install-step DSL by turning each line that starts with
system_command into a run step. The catalog refresh assigned its result
(result = system_command ...) and called opoo, so it survived the rewrite and
Homebrew rejected the published cask as invalid, which also hides it from
brew outdated. Drop the install-time refresh (the binary ships an offline
catalog baseline), point to cr catalog update in the caveats, and have the
render check require every postflight line to be a bare system_command call.

@monit-reviewer monit-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR Review

Reviewed commit: acc1cfb4c68a
Profile: claude-monit-reviewer - Posting as: monit-reviewer

Summary

Reviewer Findings
automation:ci-release 0
harness-engineering:repo-health 0
policies:conventions 0
structure:harness-engineering 0

Reviewer Coverage

  • automation:ci-release — complete (broad); skipped: none; constraints: none
  • harness-engineering:repo-health — complete (constrained); skipped: none; constraints: none
  • policies:conventions — complete (broad); skipped: none; constraints: No local convenience copies of ../cli-common/docs or ../.github were present in the workbench; reviewed against the canonical breadcrumb docs referenced from memory of their public contents was avoided, and no finding was made that depends on their exact text.
  • structure:harness-engineering — complete (broad); skipped: none; constraints: none
Inspected files (2)
  • .goreleaser.yml
  • scripts/verify-package-render.sh

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 2m 00s | ~$1.25 (est.) | claude-sonnet-5 | cr 0.10.319
Field Value
Model claude-sonnet-5
Reviewers automation:ci-release, harness-engineering:repo-health, policies:conventions, structure:harness-engineering
Engine claude_cli · claude-sonnet-5
Reviewed by cr · monit-reviewer
Duration 2m 00s wall · 3m 44s compute
Cost ~$1.25 (est.)
Pricing basis anthropic-public-2026-09-23
Tokens 52 in / 10.0k out

Per-workstream usage

  • orchestrator-selection — claude-sonnet-5
    • In: 4
    • Out: 3.4k
    • Cache read: 38.7k
    • Cache create: 38.7k
    • Cost: ~$0.20 (est.)
    • Duration: 37s
  • automation:ci-release — claude-sonnet-5
    • In: 10
    • Out: 1.5k
    • Cache read: 230.3k
    • Cache create: 40.5k
    • Cost: ~$0.22 (est.)
    • Duration: 44s
  • harness-engineering:repo-health — claude-sonnet-5
    • In: 14
    • Out: 1.9k
    • Cache read: 339.5k
    • Cache create: 40.5k
    • Cost: ~$0.25 (est.)
    • Duration: 51s
  • policies:conventions — claude-sonnet-5
    • In: 8
    • Out: 1.3k
    • Cache read: 158.2k
    • Cache create: 36.6k
    • Cost: ~$0.19 (est.)
    • Duration: 37s
  • structure:harness-engineering — claude-sonnet-5
    • In: 10
    • Out: 1.5k
    • Cache read: 216.4k
    • Cache create: 40.1k
    • Cost: ~$0.22 (est.)
    • Duration: 39s
  • orchestrator-rollup — claude-sonnet-5
    • In: 6
    • Out: 390
    • Cache read: 150.4k
    • Cache create: 33.2k
    • Cost: ~$0.17 (est.)
    • Duration: 13s

@piekstra
piekstra marked this pull request as ready for review October 20, 2026 20:31
piekstra added a commit to open-cli-collective/.github that referenced this pull request Oct 21, 2026
)

## Summary

`modernize.sh render` converts only lines that start with
`system_command`. A call anywhere else on a line, such as `result =
system_command ...`, was left inside the `*_steps` block, and Homebrew
rejects the whole cask (`undefined method 'system_command' for an
instance of Homebrew::InstallSteps::DSL`). The release then publishes an
uninstallable cask that `brew outdated` silently skips; this is what
happened to `codereview-cli`.

`render` now fails and prints the offending lines when any non-comment
`system_command` remains after the rewrite, so the release stops before
the tap is updated.

## Validation

- `bash actions/homebrew-alias/test_modernize.sh`: all pass, including a
new case for an assigned `system_command`.
- Every cask currently in `homebrew-tap` renders unchanged except
`codereview-cli.rb`, which is the broken one and is now rejected.

The cask fix itself:
open-cli-collective/codereview-cli#676
@piekstra
piekstra merged commit 95928a6 into main Oct 21, 2026
14 checks passed
@piekstra
piekstra deleted the fix/cask-postflight-install-steps branch October 21, 2026 11:24
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