oficina / base Public

Count the invite's mail after Maria signs in, not twice

staticcheck SA4006 on hub CI: the first count was never used. Maria's
sign-in link is now mailed before the count, so the refusals are checked
against one number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary

Fix staticcheck SA4006 in TestAPIPeopleInvite
claude agent, operated by paul@keymail.dev 07def314c6c62a6f3b7c968753bfb6a0b664a7df parent 5b27e0b
1 file changed, +4 −4
  • internal/webtest/api_team_test.go +4 −4

CI failed — run details

CI log
=== build ===
CGO_ENABLED=0 go build ./...
=== vet ===
go vet ./...
=== fmt-check ===
=== staticcheck ===
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./...
=== govulncheck ===
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
No vulnerabilities found.
=== gitleaks ===
7:31PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
7:31PM INF 1 commits scanned.
7:31PM INF scanned ~2843657 bytes (2.84 MB) in 298ms
7:31PM INF no leaks found
=== budget ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
internal/webtest: 8080 test lines, over the 8000-line limit for this directory. Split it by feature: put each feature in internal/webtest/<feature> with its own Deps struct and Mount function, and shared code in internal/webtest/core (docs/site/testing.md, "Splitting by feature"). Only if the split must wait, record an exemption in .rastrillo/budgets.txt and name the issue tracking the split.
rastrillo: budget size: 1 problem(s)
exit status 1
make: *** [Makefile:44: budget] Error 1

amadan: step budget failed: exit status 2

amadan: job failed at step budget — its output is above, not at the tail of this log
diff --git a/internal/webtest/api_team_test.go b/internal/webtest/api_team_test.go
index be6c0f1..cd18947 100644
--- a/internal/webtest/api_team_test.go
+++ b/internal/webtest/api_team_test.go
@@ -435,11 +435,11 @@ func TestAPIPeopleInvite(t *testing.T) {
if bob.Person.Email != "bob@acme.test" || len(a.mailbox()) != n+2 {
t.Errorf("retry: %+v, mailbox grew by %d", bob.Person, len(a.mailbox())-n)
}
+ // Refusals that send nothing. Maria signs in first, which mails her a
+ // sign-in link.
+ maria := a.maria()
sent := len(a.mailbox())
-
- // Refusals that send nothing.
- refusedWith(t, "member", a.maria().nativePost("/api/v1/people", `{"email":"carla@acme.test"}`), http.StatusForbidden, "owner_only")
- sent = len(a.mailbox()) // maria's own sign-in link
+ refusedWith(t, "member", maria.nativePost("/api/v1/people", `{"email":"carla@acme.test"}`), http.StatusForbidden, "owner_only")
form := app.postFrom(homeOrigin, "/api/v1/people", url.Values{"email": {"carla@acme.test"}})
if form.Code != http.StatusUnsupportedMediaType {
t.Errorf("a form body: %d %s", form.Code, form.Body)