feat: add Homebrew formula and macOS binary releases - #742
Conversation
b28a9ac to
b7e8fca
Compare
1adab71 to
53abb4f
Compare
|
The lint issues are not from this PR. https://github.com/complytime/complyctl/actions/runs/29576984198/job/87873581142?pr=742 |
ef14585 to
d9b86b2
Compare
d9b86b2 to
dce1421
Compare
ed7f106 to
d9b2d33
Compare
d9b2d33 to
688f6e3
Compare
|
Hi @sonupreetam. I'm happy to do an LLM-driven review of this if you like and review the results but I have almost no experience in the Homebrew/Mac ecosystem so I'm not sure I'm the best reviewer for this. Let me know if you'd like me to proceed anyway and happy to do so! |
|
No worries @trevor-vaughan, added @marcusburghardt & @jpower432 as the primary reviewers. |
hbraswelrh
left a comment
There was a problem hiding this comment.
Corroborates @yvonnedevlinrh's findings on unvalidated ${{ inputs.tag }} (HIGH) and missing CHANGELOG entries (HIGH). Adding one new finding on token handling.
This review was generated by /review-pr (AI-assisted).
d8a6596 to
e909009
Compare
|
@hbraswelrh & @yvonnedevlinrh Thank you for your feedbacks, I have addressed them. |
yvonnedevlinrh
left a comment
There was a problem hiding this comment.
Verdict: APPROVE (with findings below)
Summary
Well-structured PR that adds macOS binary releases to GoReleaser, automated Homebrew Formula publishing via a GitHub App token, go install documentation, and a Homebrew smoke test. The OpenSpec artifacts are thorough and the design decisions (source-build Formula, custom workflow step, GitHub App token) are well-reasoned. CI is fully green (30 checks pass).
Findings
MEDIUM — make test-homebrew broken on macOS (missing timeout)
File: Makefile:83
The test-homebrew target uses GNU timeout which is not available on stock macOS (BSD toolchain). macOS is the primary target audience for this test — the target description even says "requires brew, macOS/Linux". Running make test-homebrew on a Mac produces:
make: timeout: No such file or directory
make: *** [test-homebrew] Error 1
Recommendation: Either detect gtimeout on macOS, use a portable timeout mechanism, or drop the wrapper entirely since the test script has its own cleanup trap:
# Option A: portable detection
TIMEOUT := $(shell command -v timeout 2>/dev/null || command -v gtimeout 2>/dev/null || echo "")
test-homebrew:
@command -v brew >/dev/null 2>&1 || { echo "ERROR: brew not found."; exit 1; }
$(if $(TIMEOUT),$(TIMEOUT) 300) ./tests/homebrew_test.shMEDIUM — Spec deviation: gitTreeState ldflag contradicts spec and design
Files: .github/workflows/release.yml:131, openspec/.../design.md:76-78, openspec/.../tasks.md:12
The design doc states: "It does NOT inject commit or gitTreeState because source tarballs have no .git directory." Task 2.3 says: "Verify Formula uses std_go_args(ldflags:) with version and buildDate only (no commit/gitTreeState)". Yet the actual Formula injects:
-X github.com/complytime/complyctl/internal/version.gitTreeState=cleanIn internal/version/version.go:44-47, when gitTreeState != "", version output becomes 1.2.3+clean. This is misleading for source tarball builds where there is no git context to verify tree cleanliness.
Recommendation: Either remove the gitTreeState ldflag (aligning with spec), or update the spec/design documents to document why hardcoding "clean" is appropriate for source builds.
LOW — Unchecked task 4.3 in tasks.md
File: openspec/.../tasks.md:26
Task 4.3 "Confirm GitHub App has Contents:write on homebrew-tap (admin check)" is unchecked. Expected (admin-level prerequisite), but should be confirmed before the first release exercising this workflow.
e909009 to
67e4917
Compare
67e4917 to
d107451
Compare
|
@yvonnedevlinrh Thank you, addressed your new feedbacks.
It's already called out in two places: |
22e6695 to
98c4394
Compare
|
@hbraswelrh I would need a re-review on this PR. |
Will do. Thanks, Sonu! |
hbraswelrh
left a comment
There was a problem hiding this comment.
PR Review: #742 — feat: add Homebrew formula and macOS binary releases
Well-structured PR. Design decisions documented in OpenSpec ADR. All CI passes.
No runtime code changes — CI/CD, docs, and testing only.
Findings: 1 HIGH (auth header leak risk), 1 MEDIUM (template fragility — informational).
Verdict: COMMENT — no blocking issues, but the HIGH finding merits evaluation before merge.
This review was generated by /review-pr (AI-assisted).
c07a3a2 to
59cf6ef
Compare
- Add darwin/amd64 and darwin/arm64 to GoReleaser build matrix - Add Homebrew formula publishing step to release workflow - Use validated preflight tag (not raw inputs.tag) for homebrew job - Add explicit if guard on homebrew job matching release job pattern - Mint short-lived GitHub App token for cross-repo push - Fix deprecated archives.format -> formats (GoReleaser v2) - Document Homebrew and go install as installation methods - Add CHANGELOG entries for macOS binaries, Homebrew formula, go install - Include OpenSpec artifacts for architectural decisions Closes complytime#713 Signed-off-by: sonupreetam <spreetam@redhat.com>
59cf6ef to
41c12ef
Compare
|
Hi @gxmiranda, would you take a look at the pre-merge checklist before this merges? |
Summary
Add a source-build Homebrew Formula and macOS binary releases for complyctl.
Changes:
generates a source-build Formula and pushes it to
complytime/homebrew-tapactions/create-github-app-tokenfor cross-repo push (uses existing
APP_ID/PRIVATE_KEYsecrets)archives.format→formats(GoReleaser v2)go installas installation methodsAfter merge, users install with:
The Formula builds from source on the user's machine (Homebrew auto-installs
Go). This avoids macOS Gatekeeper/signing entirely — no Apple Developer
certificate, no
xattrworkaround needed.Related Issues
Review Hints
The key design decision (Formula vs Cask) is documented in
openspec/changes/homebrew-formula-and-go-install/design.md— start therefor context on why source-build was chosen over pre-built binary distribution.
The release workflow's "Publish Homebrew formula" step uses a heredoc to
template the Ruby Formula file. The YAML indentation is handled by the
|block scalar (18 spaces stripped by YAML, leaving correct Ruby formatting).
Test results:
goreleaser checkpasses clean (zero deprecation warnings)goreleaser release --snapshot --cleanproduces all 4 archives(darwin/amd64, darwin/arm64, linux/amd64, linux/arm64)
complyctl versionreports correct metadata)complyctl completion {bash,zsh,fish}generates completions successfullycomplytime/homebrew-tapImportant
Admin pre-merge checklist:
APP_ID/PRIVATE_KEY) hasContents: writepermission on the
homebrew-taprepositoryadd
homebrew-tapto the list