Skip to content

Commit 82d9fed

Browse files
authored
Merge pull request #36 from andreagrandi/add-install-smoke-tests
Add install smoke tests and release verification docs
2 parents 820efc5 + a1d579b commit 82d9fed

7 files changed

Lines changed: 342 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ go.work.sum
3333

3434
# Sentire
3535
sentire
36+
37+
# GoReleaser snapshot output
38+
dist/

.opencode/agent/new-release.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ mode: subagent
44
---
55

66
When asked to create a new release, you need to:
7-
- Make sure `make test` passes without errors
7+
- Make sure `make test` passes without errors (this also runs the
8+
`go install` smoke test via `TestGoInstallSmoke`)
9+
- If `goreleaser` is installed locally, also run `make smoke-release` to
10+
verify the release artifacts build and the unpacked binary works
811
- Use the provided version number or
912
Bump the version number in internal/version/version.go:
1013
if you find `const Version = "0.1.0"` change to `const Version = "0.1.1"`
1114
- Update the changelog writing a short summary of the changes since last release (with bullet points), follow existing format
1215
- git commit the changes you just did
1316
- git push the changes you just did
1417
- do `git tag v<version>` (use the version you just bumped to in the `internal/version/version.go`)
15-
- do `git push origin v<version>`
18+
- do `git push origin v<version>`
19+
- After the GitHub `Release` workflow finishes, run the post-release
20+
verification checklist in `docs/releases.md` (GitHub artifact, `go install`,
21+
and Homebrew)

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes to Sentire will be documented in this file.
1212
- Contributor and agent guidance for keeping `CHANGELOG.md` updated, plus a PR template prompting for an `[Unreleased]` entry
1313
- `docs/workflows.md` with recipe-style triage, inspection, and reporting workflows plus a troubleshooting checklist for auth, permissions, filters, and empty results
1414
- `Ctrl+C` (SIGINT) and SIGTERM cancel in-flight API requests, reported with a `canceled` error code
15+
- `docs/releases.md` with the release pipeline overview and a post-release verification checklist for `go install`, GitHub artifacts, and the Homebrew tap
1516

1617
### Changed
1718
- Request timeouts surface a clear `timeout` error code instead of a generic transport failure
@@ -27,6 +28,7 @@ All notable changes to Sentire will be documented in this file.
2728
- Lower `go.mod` minimum to Go 1.24 and add Go 1.24/1.25 to the CI build matrix
2829
- API requests use context-aware HTTP request creation, propagating cancellation and deadlines from CLI commands into the client
2930
- Add `make vet` target and CI step running `go vet ./...`
31+
- Add install smoke tests: `TestGoInstallSmoke` (runs by default) verifies the public `go install` path, and `make smoke-release` runs an opt-in goreleaser snapshot smoke test against the unpacked archive
3032

3133
## [0.3.0] - 2026-03-07
3234

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build test clean install help vet
1+
.PHONY: build test clean install help vet smoke-install smoke-release
22

33
# Default target
44
all: build
@@ -63,6 +63,16 @@ install: build
6363
@echo "Installing sentire..."
6464
@cp sentire $(GOPATH)/bin/
6565

66+
# Run the `go install` smoke test (mirrors the public install path)
67+
smoke-install:
68+
@echo "Running go install smoke test..."
69+
@go test ./tests/ -run TestGoInstallSmoke -v -count=1
70+
71+
# Run the goreleaser snapshot smoke test (requires goreleaser locally)
72+
smoke-release:
73+
@echo "Running release artifact smoke test..."
74+
@SENTIRE_SMOKE_RELEASE=1 go test ./tests/ -run TestGoreleaserSnapshotSmoke -v -count=1 -timeout 10m
75+
6676
# Cross-compile for multiple platforms
6777
build-all:
6878
@echo "Building for multiple platforms..."
@@ -85,4 +95,6 @@ help:
8595
@echo " vet - Run go vet static analysis"
8696
@echo " lint - Lint code (requires golangci-lint)"
8797
@echo " install - Install binary to GOPATH/bin"
98+
@echo " smoke-install - Run go install smoke test against the local module"
99+
@echo " smoke-release - Build a goreleaser snapshot and smoke-test the archive (requires goreleaser)"
88100
@echo " help - Show this help message"

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,12 @@ To bypass the hook temporarily (not recommended):
388388
git commit --no-verify
389389
```
390390

391+
## Releases
392+
393+
See [`docs/releases.md`](docs/releases.md) for the release pipeline overview
394+
and the post-release verification checklist for `go install`, the GitHub
395+
release artifacts, and the Homebrew tap.
396+
391397
## Changelog
392398

393399
User-visible changes are tracked in [`CHANGELOG.md`](CHANGELOG.md). When you

docs/releases.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Releasing Sentire
2+
3+
This guide covers the steps to cut a new release and the verification you
4+
should perform on each public install path before announcing the version.
5+
6+
The release pipeline itself is automated: pushing a tag matching `v*` to
7+
GitHub triggers the `Release` workflow, which runs the test suite and then
8+
invokes [GoReleaser](https://goreleaser.com) (see `.goreleaser.yaml`) to
9+
build cross-platform archives, publish them to the GitHub release page, and
10+
update the [Homebrew tap](https://github.com/andreagrandi/homebrew-tap).
11+
12+
For the version-bump and tagging workflow itself, see
13+
`.opencode/agent/new-release.md`.
14+
15+
## Pre-release smoke tests
16+
17+
Before tagging, run the local smoke tests. Neither requires Sentry
18+
credentials.
19+
20+
```bash
21+
# Verifies the public `go install` path against the local module.
22+
make smoke-install
23+
24+
# Builds a full goreleaser snapshot, extracts the current OS/arch archive,
25+
# and runs `sentire version` and `sentire --help` against the unpacked
26+
# binary. Requires goreleaser to be installed locally (`brew install
27+
# goreleaser`).
28+
make smoke-release
29+
```
30+
31+
`make smoke-install` runs as part of normal development (it is included in
32+
`make test` via `TestGoInstallSmoke`). `make smoke-release` is opt-in
33+
because a full snapshot build cross-compiles for every supported platform
34+
and adds noticeable time; it is also skipped automatically when goreleaser
35+
is not on PATH, so it does not break CI environments that lack it.
36+
37+
## Post-release verification
38+
39+
After the `Release` workflow finishes, verify each advertised install path
40+
end to end. Replace `<version>` with the tag you just pushed (without the
41+
leading `v` for `go install` queries; with it for the GitHub release page).
42+
43+
### 1. GitHub release artifacts
44+
45+
1. Open the release page:
46+
<https://github.com/andreagrandi/sentire/releases/tag/v\<version\>>
47+
2. Confirm archives for `Darwin_x86_64`, `Darwin_arm64`, `Linux_x86_64`,
48+
`Linux_arm64`, and `Windows_x86_64` are attached, along with
49+
`checksums.txt`.
50+
3. Download the archive for your platform, extract it, and run:
51+
52+
```bash
53+
./sentire version # should print "sentire version <version>"
54+
./sentire --help # should print top-level usage
55+
```
56+
57+
### 2. `go install`
58+
59+
In a clean shell (no `SENTRY_API_TOKEN` set), run:
60+
61+
```bash
62+
GOBIN="$(mktemp -d)"
63+
export GOBIN
64+
go install github.com/andreagrandi/sentire/cmd/sentire@v<version>
65+
"$GOBIN/sentire" version # should report v<version>
66+
"$GOBIN/sentire" --help
67+
```
68+
69+
If `go install @latest` should also resolve to the new tag, run the same
70+
check with `@latest`.
71+
72+
### 3. Homebrew
73+
74+
The release workflow pushes an updated formula to
75+
`andreagrandi/homebrew-tap`. After the workflow finishes, verify the tap
76+
end to end:
77+
78+
```bash
79+
brew update
80+
brew install andreagrandi/tap/sentire # or `brew upgrade ...` if installed
81+
sentire version # should report the new version
82+
sentire --help
83+
```
84+
85+
If the formula has not yet been updated, the workflow log under
86+
`Release → goreleaser` will show the push to the tap repository — check
87+
both this repo's Actions tab and the tap repo's commit history.
88+
89+
## Troubleshooting
90+
91+
- **`go install` returns an older version.** Module proxies cache versions;
92+
`GOPROXY=direct go install github.com/andreagrandi/sentire/cmd/sentire@v<version>`
93+
forces a fresh fetch from GitHub.
94+
- **`brew install` reports "no such formula".** The tap may not be tapped
95+
yet. Run `brew tap andreagrandi/tap` first, or use the fully qualified
96+
formula name `andreagrandi/tap/sentire`.
97+
- **`sentire version` reports `unknown` or a stale version.** The release
98+
archives are built with ldflags that inject the version
99+
(`internal/version.Version`). If the value is wrong, the goreleaser
100+
config drifted — check `.goreleaser.yaml` and the most recent commit on
101+
the tag.

0 commit comments

Comments
 (0)