Skip to content

Add release engineering infrastructure - #3

Merged
jeremy merged 13 commits into
mainfrom
releng
Mar 5, 2026
Merged

jeremy merged 13 commits into
mainfrom
releng

Conversation

@jeremy

@jeremy jeremy commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Module rename hey-cli → github.com/basecamp/hey-cli enabling go install from source
  • Version injection via ldflags (--version flag, --help --agent JSON surface output)
  • GoReleaser config with cross-compilation (darwin/linux/windows/freebsd/openbsd × amd64/arm64), CGO_ENABLED=0, PGO, cosign signing, macOS notarization, SBOM generation, nfpm deb/rpm, Homebrew cask, Scoop manifest
  • CI workflows: test (unit + lint + security + race), security (gitleaks + trivy + gosec + CodeQL + dependency-review), release (tag-triggered, full pipeline), AI labeler, dependabot auto-merge
  • Scripts: release.sh (preflight + tag), publish-aur.sh, install.sh (curl installer), collect-profile.sh (PGO), check-cli-surface.sh / check-cli-surface-diff.sh (compatibility checks), sync-skills.sh
  • Makefile overhaul from 5 targets to full lifecycle (build, test, lint, fmt, vet, tidy, race, vuln, secrets, bench, PGO, surface compat, release)
  • Lint clean: all 56 golangci-lint findings fixed across the codebase
  • Config: .golangci.yml, .gitleaks.toml, .github/dependabot.yml, .github/release.yml, CodeQL config, AI prompt templates

Parity with basecamp-cli (PGO, AI changelog, benchmarks, CLI surface compat, cosign, notarization, AUR, Homebrew cask, Scoop) plus fizzy-cli's nfpm deb/rpm packaging.

Test plan

  • make check passes (fmt-check, vet, lint 0 issues, 90 tests pass, tidy-check)
  • go build ./... compiles after module rename
  • ./bin/hey --version prints version string (hey version 50479bb)
  • ./bin/hey completion bash generates shell completions
  • ./bin/hey --help --agent outputs JSON CLI surface
  • scripts/check-cli-surface.sh ./bin/hey generates surface snapshot (236 lines)
  • goreleaser release --snapshot --clean produces all artifacts (10 binaries, 10 archives, 4 nfpm packages, 10 SBOMs, checksums) — cosign signing skipped locally as expected (requires CI OIDC)
  • CI: test, lint, security, race-check, secret scanning all pass
  • Tag-triggered release workflow runs end-to-end (requires first v* tag push after merge)
  • CI secrets configured per RELEASING.md (cosign, notarization, homebrew-tap token)

jeremy added 7 commits March 4, 2026 12:47
Enables `go install github.com/basecamp/hey-cli/cmd/hey@latest`.
- internal/version: build-time Version/Commit/Date via ldflags
- root.go: --version flag, hidden --agent flag for JSON CLI surface
- client.go: User-Agent header from version.UserAgent()
Adds: build-pgo, fmt-check, vet, lint, tidy-check, race-test, vuln,
secrets, replace-check, check (CI gate), security, release-check,
bench/bench-cpu/bench-mem/bench-save/bench-compare, collect-profile,
check-surface, check-surface-compat, tools. Includes check-toolchain
guard for mise-managed Go installations.
GoReleaser: cross-platform builds (darwin/linux/windows/freebsd/openbsd),
PGO via -pgo=auto, cosign keyless signing, conditional macOS notarization,
Homebrew cask, Scoop, nfpm deb/rpm packaging.

Scripts: release.sh (preflight + tag), publish-aur.sh (source-based AUR),
install.sh (curl installer with checksum + cosign verification),
collect-profile.sh (PGO from benchmarks), check-cli-surface.sh and
check-cli-surface-diff.sh (surface snapshot + breaking change detection),
sync-skills.sh (skill distribution to basecamp/skills).
Workflows: test.yml (unit tests, lint, govulncheck, race detector),
security.yml (gitleaks, Trivy, gosec, CodeQL, dependency review),
release.yml (PGO, AI changelog, cosign, notarization, surface compat,
AUR, skills sync), ai-labeler.yml (PR classification + breaking change
detection), dependabot-auto-merge.yml.

Config: .golangci.yml, .gitleaks.toml, .github/dependabot.yml,
.github/release.yml (changelog categories), CodeQL config, AI prompts.
- Suppress unused MarkHidden/Encode return values
- Use _ for unused agentHelpFunc args parameter
- Exclude internal/version/ from revive var-naming
- errorlint: wrap errors with %w instead of %v in auth package
- errcheck: check server.Shutdown, type assertions, file cleanup returns
- gosec: suppress false positives (G117 token fields, G115 fd cast,
  G204 browser/editor launch, G703 internal paths)
- govet: eliminate variable shadowing in auth, client, config, editor,
  recordings
- noctx: use NewRequestWithContext in client and TUI image fetcher,
  CommandContext in editor
- nilerr: document intentional nil returns in auth status and raw JSON
- prealloc: preallocate slices in entry parser
- predeclared: rename shadowed `max` parameter
- unused: remove dead limitJSONArray function and kittyImage type
- exhaustive: annotate intentional partial switches
- revive: add justification comments for blank image decoder imports
- staticcheck: convert if-else chain to tagged switch in findImages
- unparam: remove unused configDir parameter from migrateOldCredentials
Copilot AI review requested due to automatic review settings March 4, 2026 21:43
The dependency-review action requires GitHub Advanced Security
(dependency graph) which may not be enabled on private repos.
Use continue-on-error so it doesn't block PRs.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50479bb3e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Makefile Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds release engineering infrastructure around the HEY CLI, including module renaming for go install, build-time version injection, and an end-to-end CI/release pipeline (GoReleaser packaging + security + distribution automation).

Changes:

  • Rename the Go module to github.com/basecamp/hey-cli and update imports across the codebase.
  • Introduce version/user-agent injection (ldflags + --version) and an --help --agent JSON output surface for deterministic CLI surface snapshots.
  • Add release automation: GoReleaser config, Makefile lifecycle targets, GitHub Actions workflows, and scripts for releases, packaging, and skills distribution sync.

Reviewed changes

Copilot reviewed 62 out of 66 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/sync-skills.sh New script to sync skills/ content to basecamp/skills with safety checks + manifest.
scripts/release.sh New preflight + tag-and-push release helper.
scripts/publish-aur.sh New script to publish/update AUR package metadata for releases.
scripts/install.sh New curl-based installer that downloads release artifacts and verifies integrity/signatures.
scripts/collect-profile.sh New helper to collect and merge benchmark CPU profiles for PGO.
scripts/check-cli-surface.sh New deterministic CLI surface snapshot generator using --help --agent.
scripts/check-cli-surface-diff.sh New snapshot diff gate that fails on removals.
internal/version/version.go New version metadata package (Version/Commit/Date) + user-agent helper.
internal/tui/tui_test.go Import path updates + minor struct field alignment.
internal/tui/tui.go Import path updates + add request context usage for image fetch; lint nits.
internal/tui/topic.go Import path update.
internal/tui/kitty.go Comment improvements; remove unused struct.
internal/tui/journal.go Import path update + safe type assertion for selected item.
internal/tui/html.go Import path update.
internal/tui/debug_test.go Import path update.
internal/tui/calendars.go Import path update + safe type assertion for selected item.
internal/tui/calendar.go Import path update + safe type assertion for selected item.
internal/tui/boxes.go Import path update + safe type assertion for selected item.
internal/tui/box.go Import path update + safe type assertion for selected item.
internal/models/calendar.go Formatting/field alignment cleanup (no schema change).
internal/htmlutil/htmlutil.go Lint-driven switch/exhaustive handling + refactor in image extraction.
internal/editor/editor.go Add context-aware exec + gosec/err handling adjustments.
internal/config/config.go Minor error variable reuse cleanup.
internal/cmd/tui.go Import path update.
internal/cmd/topic.go Minor formatting cleanup.
internal/cmd/skill_install.go Import path update.
internal/cmd/skill.go Import path update.
internal/cmd/root.go Add version output + hidden --agent help JSON surface + misc refactors.
internal/cmd/reply.go Import path update.
internal/cmd/recordings.go Minor variable declaration tweak.
internal/cmd/journal.go Import path update.
internal/cmd/formatting.go Lint fixes; rename truncate arg; remove unused helper.
internal/cmd/compose.go Import path update.
internal/cmd/box.go Import path update.
internal/cmd/auth.go Import path update + nilerr lint annotation.
internal/client/todos.go Import path update.
internal/client/time_tracks.go Import path update.
internal/client/journal.go Import path update.
internal/client/entries.go Import path updates + prealloc improvements.
internal/client/client.go Add request context + set User-Agent from version package.
internal/client/calendars.go Import path update.
internal/client/boxes.go Import path update.
internal/auth/store.go Lint annotations + error handling tightening for temp file writes/renames.
internal/auth/oauth.go Lint annotations for credential fields.
internal/auth/browser.go gosec lint annotation for launching browser.
internal/auth/auth.go Error wrapping improvements + reuse err vars + ignore shutdown errors.
go.sum Dependency updates due to module + tooling changes.
go.mod Module rename + dependency explicitness updates.
cmd/hey/main.go Import path update for renamed module.
RELEASING.md New release process documentation (CI secrets, channels, dry-run, etc.).
Makefile Overhaul into full lifecycle (build/test/lint/security/release/bench/PGO/surface).
.goreleaser.yaml New GoReleaser pipeline: cross builds, PGO, cosign, notarization, SBOM, nfpm, brew/scoop.
.golangci.yml New golangci-lint configuration and linter policy.
.gitleaks.toml New gitleaks configuration/allowlist.
.gitignore Ignore dist/completions/profiles/PGO artifacts and benchmark outputs.
.github/workflows/test.yml New CI workflow: tests, build smoke test, lint/vet/fmt, vuln, race.
.github/workflows/security.yml New security workflow: gitleaks, trivy, gosec, dependency review, CodeQL.
.github/workflows/release.yml New tag-triggered release pipeline: tests+security+PGO+GoReleaser+surface checks+AUR+skills sync.
.github/workflows/dependabot-auto-merge.yml Auto-approve/auto-merge Dependabot patch/minor updates.
.github/workflows/ai-labeler.yml PR classifier + “breaking change” detector using AI inference actions.
.github/release.yml Release note category config by labels.
.github/prompts/summarize-changelog.prompt.yml Prompt template for AI release summary generation.
.github/prompts/detect-breaking.prompt.yml Prompt template for AI breaking-change JSON analysis.
.github/prompts/classify-pr.prompt.yml Prompt template for AI PR categorization (bug/enhancement/docs).
.github/dependabot.yml Dependabot configuration for Go modules and GitHub Actions.
.github/codeql/codeql-config.yml CodeQL configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cmd/root.go Resolved
Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
Comment thread Makefile Resolved
jeremy added 2 commits March 4, 2026 14:24
- tidy-check: use trap for reliable cleanup on failure/interrupt
- check-surface-compat: fail when baseline build fails instead of
  silently skipping
- agentHelpFunc: include inherited flags via InheritedFlags() so
  persistent flags appear in subcommand surface snapshots
- install.sh: fail fast on missing checksum instead of warning
- install.sh: fail on cosign verification failure with
  HEY_INSECURE_SKIP_COSIGN bypass
Job-level continue-on-error makes the workflow pass but the check
run still reports failure. Step-level continue-on-error makes the
job itself report success.
Copilot AI review requested due to automatic review settings March 4, 2026 22:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 62 out of 66 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cmd/root.go Resolved
Comment thread scripts/publish-aur.sh Resolved
Comment thread scripts/install.sh Resolved
jeremy added 2 commits March 4, 2026 15:41
- agentHelpFunc: also visit PersistentFlags() so root-level persistent
  flags appear in the surface snapshot
- publish-aur.sh: validate required env vars upfront, fix header comment
- install.sh: tighten cosign certificate-identity-regexp to match only
  the release workflow
Copilot AI review requested due to automatic review settings March 5, 2026 00:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 62 out of 66 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/install.sh Resolved
Comment thread .github/workflows/test.yml Resolved
Comment thread scripts/check-cli-surface-diff.sh Resolved
- install.sh: use find to locate binary in extracted archive, handles
  both flat and nested archive layouts
- test.yml: use go-version-file for security job to match other jobs
- check-cli-surface-diff.sh: add usage check for missing arguments
@jeremy
jeremy merged commit 6ce4e26 into main Mar 5, 2026
10 checks passed
jeremy added a commit that referenced this pull request Mar 5, 2026
* Rename module to github.com/basecamp/hey-cli

Enables `go install github.com/basecamp/hey-cli/cmd/hey@latest`.

* Add build-time version injection and CLI surface support

- internal/version: build-time Version/Commit/Date via ldflags
- root.go: --version flag, hidden --agent flag for JSON CLI surface
- client.go: User-Agent header from version.UserAgent()

* Overhaul Makefile for full build, test, and release lifecycle

Adds: build-pgo, fmt-check, vet, lint, tidy-check, race-test, vuln,
secrets, replace-check, check (CI gate), security, release-check,
bench/bench-cpu/bench-mem/bench-save/bench-compare, collect-profile,
check-surface, check-surface-compat, tools. Includes check-toolchain
guard for mise-managed Go installations.

* Add GoReleaser configuration and release scripts

GoReleaser: cross-platform builds (darwin/linux/windows/freebsd/openbsd),
PGO via -pgo=auto, cosign keyless signing, conditional macOS notarization,
Homebrew cask, Scoop, nfpm deb/rpm packaging.

Scripts: release.sh (preflight + tag), publish-aur.sh (source-based AUR),
install.sh (curl installer with checksum + cosign verification),
collect-profile.sh (PGO from benchmarks), check-cli-surface.sh and
check-cli-surface-diff.sh (surface snapshot + breaking change detection),
sync-skills.sh (skill distribution to basecamp/skills).

* Add CI workflows and repository configuration

Workflows: test.yml (unit tests, lint, govulncheck, race detector),
security.yml (gitleaks, Trivy, gosec, CodeQL, dependency review),
release.yml (PGO, AI changelog, cosign, notarization, surface compat,
AUR, skills sync), ai-labeler.yml (PR classification + breaking change
detection), dependabot-auto-merge.yml.

Config: .golangci.yml, .gitleaks.toml, .github/dependabot.yml,
.github/release.yml (changelog categories), CodeQL config, AI prompts.

* Fix lint issues in new code

- Suppress unused MarkHidden/Encode return values
- Use _ for unused agentHelpFunc args parameter
- Exclude internal/version/ from revive var-naming

* Fix all lint issues for clean golangci-lint gate

- errorlint: wrap errors with %w instead of %v in auth package
- errcheck: check server.Shutdown, type assertions, file cleanup returns
- gosec: suppress false positives (G117 token fields, G115 fd cast,
  G204 browser/editor launch, G703 internal paths)
- govet: eliminate variable shadowing in auth, client, config, editor,
  recordings
- noctx: use NewRequestWithContext in client and TUI image fetcher,
  CommandContext in editor
- nilerr: document intentional nil returns in auth status and raw JSON
- prealloc: preallocate slices in entry parser
- predeclared: rename shadowed `max` parameter
- unused: remove dead limitJSONArray function and kittyImage type
- exhaustive: annotate intentional partial switches
- revive: add justification comments for blank image decoder imports
- staticcheck: convert if-else chain to tagged switch in findImages
- unparam: remove unused configDir parameter from migrateOldCredentials

* Allow dependency-review to soft-fail without GHAS

The dependency-review action requires GitHub Advanced Security
(dependency graph) which may not be enabled on private repos.
Use continue-on-error so it doesn't block PRs.

* Address PR review feedback

- tidy-check: use trap for reliable cleanup on failure/interrupt
- check-surface-compat: fail when baseline build fails instead of
  silently skipping
- agentHelpFunc: include inherited flags via InheritedFlags() so
  persistent flags appear in subcommand surface snapshots
- install.sh: fail fast on missing checksum instead of warning
- install.sh: fail on cosign verification failure with
  HEY_INSECURE_SKIP_COSIGN bypass

* Move continue-on-error to step level for dependency-review

Job-level continue-on-error makes the workflow pass but the check
run still reports failure. Step-level continue-on-error makes the
job itself report success.

* Address second round of PR review feedback

- agentHelpFunc: also visit PersistentFlags() so root-level persistent
  flags appear in the surface snapshot
- publish-aur.sh: validate required env vars upfront, fix header comment
- install.sh: tighten cosign certificate-identity-regexp to match only
  the release workflow

* Fix bot name in publish-aur.sh to cli-release-bot

* Address third round of PR review feedback

- install.sh: use find to locate binary in extracted archive, handles
  both flat and nested archive layouts
- test.yml: use go-version-file for security job to match other jobs
- check-cli-surface-diff.sh: add usage check for missing arguments
@jeremy
jeremy deleted the releng branch August 20, 2026 08:39
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