fix(homebrew): show logo in brew install, guard empty tap token - #22
Conversation
Two Homebrew install problems, both rooted in the tap pipeline: 1. `brew install` showed no logo. The Tetris/robot-head banner lived only in the curl (install.sh) and PowerShell (install.ps1) installers, which Homebrew never runs. Add a `caveats` block to the formula template so `brew install` prints the static settled frame of that same logo (brew caveats are plain text, so this is the uncoloured robot head). 2. The tap auto-update workflow has failed on every release since the org migration: the `HOMEBREW_TAP_TOKEN` secret did not carry over, so `git push` to the tap repo fails with a cryptic exit-128 auth error and the tap stays frozen at the last good push (0.23.0). Add a fail-fast guard that detects an empty TAP_TOKEN and prints an actionable error instead of the opaque git failure. Also add a test asserting the rendered formula carries the logo caveats. The token secret itself must be re-added out-of-band (a fine-grained PAT with Contents: Read and write on the tap repo); this change only makes the failure obvious and ships the logo.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a static ASCII-art ChangesHomebrew Installation Caveats
🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/homebrew-tap.yml (2)
28-28:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPin third-party action to commit SHA.
The action uses a tag reference (
v4) instead of a full commit SHA. As per coding guidelines, actions in.github/workflows/**should be pinned to immutable commit SHAs for supply-chain security.🔒 Proposed fix
- - name: Checkout source repo - uses: actions/checkout@v4 + - name: Checkout source repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/homebrew-tap.yml at line 28, The workflow is using the tag reference "actions/checkout@v4" which is mutable; replace that tag with the repository's immutable commit SHA (e.g., "actions/checkout@<full-commit-sha>") so the action is pinned; locate the line containing uses: actions/checkout@v4 in the workflow and update it to the corresponding full commit SHA for the actions/checkout repo (and apply the same pinning approach to any other third-party actions in this file).
48-48:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPin third-party action to commit SHA.
The action uses a tag reference (
v5) instead of a full commit SHA. As per coding guidelines, actions in.github/workflows/**should be pinned to immutable commit SHAs for supply-chain security.🔒 Proposed fix
- - name: Set up Python - uses: actions/setup-python@v5 + - name: Set up Python + uses: actions/setup-python@0b93645e9e7c3e5d7b1ae4f84c82ca0e90d6c29a # v5.3.0🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/homebrew-tap.yml at line 48, Replace the tag reference "uses: actions/setup-python@v5" with a pinned commit SHA: locate the uses line (actions/setup-python@v5) and change it to the full commit SHA for the desired v5 release (e.g., actions/setup-python@<full-commit-sha>), obtaining the SHA from the official actions/setup-python GitHub repo and updating the workflow to use that immutable SHA.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_homebrew_formula.py`:
- Around line 66-73: Extract the duplicated asset setup into a helper function
(e.g., create_assets_for_version) that takes a version string and an iterable of
targets and returns the assets dict; replace the inline logic that builds assets
using version, assets, generator.NATIVE_TARGETS and target.asset_name(...) in
tests/test_homebrew_formula.py with a call to this helper, and apply the same
change to the new test so both use the shared helper.
---
Outside diff comments:
In @.github/workflows/homebrew-tap.yml:
- Line 28: The workflow is using the tag reference "actions/checkout@v4" which
is mutable; replace that tag with the repository's immutable commit SHA (e.g.,
"actions/checkout@<full-commit-sha>") so the action is pinned; locate the line
containing uses: actions/checkout@v4 in the workflow and update it to the
corresponding full commit SHA for the actions/checkout repo (and apply the same
pinning approach to any other third-party actions in this file).
- Line 48: Replace the tag reference "uses: actions/setup-python@v5" with a
pinned commit SHA: locate the uses line (actions/setup-python@v5) and change it
to the full commit SHA for the desired v5 release (e.g.,
actions/setup-python@<full-commit-sha>), obtaining the SHA from the official
actions/setup-python GitHub repo and updating the workflow to use that immutable
SHA.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 77bf84f9-7372-4577-a0a0-bde23ddc8068
📒 Files selected for processing (3)
.github/workflows/homebrew-tap.ymlpackages/homebrew-tap/pythinker-code.rb.tmpltests/test_homebrew_formula.py
Problem
Two issues with the Homebrew install path, surfaced from a real
brew install:No logo on
brew install. The animated/static "Tetris" robot-head banner exists only in the curl installer (install.sh) and PowerShell installer (install.ps1). Homebrew runs the formula, not those scripts, and the formula had nocaveats, so brew printed nothing.brew installserved 0.23.0, not the current 0.25.0. The Update Homebrew tap workflow has failed on every release since the org migration (0.24.0, 0.25.0). The failing step isgit pushto the tap repo:The
HOMEBREW_TAP_TOKENsecret did not survive themohamed-elkholy95 → TechMatrix-labsorg migration (same class of breakage as the pythinker-home site-sync freeze). Formula generation succeeds; only the cross-repo push fails, so the tap stayed frozen at the last good push (0.23.0, with stale old-org asset URLs).Changes
packages/homebrew-tap/pythinker-code.rb.tmpl— add acaveatsblock rendering the static settled frame of the robot-head logo + tagline (parity withinstall.sh/install.ps1; brew caveats are plain text, so no animation/colour)..github/workflows/homebrew-tap.yml— fail fast with an actionable message whenTAP_TOKENis empty/unset, instead of the opaque git exit-128.tests/test_homebrew_formula.py— assert the rendered formula carries the logo caveats (tagline + distinctive mouth row).Out of scope / follow-up
HOMEBREW_TAP_TOKENsecret must be re-added (fine-grained PAT,Contents: Read and writeonTechMatrix-labs/homebrew-pythinker). This PR only makes the failure obvious and ships the logo — it does not restore the secret. Until then, every release's tap update will fail the guard with a clear error.brew installworks now; this PR makes future auto-updates correct once the token is restored.Verification
Summary by CodeRabbit
New Features
Chores
Tests