Fixes the largest of the three lint classes blocking a green make check under current golangci-lint (issue #175).
What changed
every httptest.NewRequest(...) call in test code is now httptest.NewRequestWithContext(t.Context(), ...), wrapped
multiline where the single-line form would exceed the 88-column lll limit
createSetupFormRequest and createLoginFormRequest in internal/handlers/handlers_test.go now take t *testing.T (and
call t.Helper()) so they can supply the test context; all call
sites updated
TODO.md Status/Next Step/Completed/Future rotated per the repo
workflow, now pointing at the issue backlog (#175–#182)
make test passes (race detector on), make fmt run, make fmt-check clean. CI (script/cibuild, pinned golangci-lint
v2.10.1) was already green and stays green; the pin bump to enforce
the stricter set in CI is #179.
Note for reviewers: make fmt on this tree wants to reformat the
vendored static/js/alpine.min.js (no .prettierignore exists) and script/bootstrap does not install goimports which script/fmt
requires — both left untouched here and will be filed as separate
issues.
Fixes the largest of the three lint classes blocking a green
`make check` under current golangci-lint (issue #175).
## What changed
- every `httptest.NewRequest(...)` call in test code is now
`httptest.NewRequestWithContext(t.Context(), ...)`, wrapped
multiline where the single-line form would exceed the 88-column
`lll` limit
- `createSetupFormRequest` and `createLoginFormRequest` in
`internal/handlers/handlers_test.go` now take `t *testing.T` (and
call `t.Helper()`) so they can supply the test context; all call
sites updated
- `TODO.md` Status/Next Step/Completed/Future rotated per the repo
workflow, now pointing at the issue backlog (#175–#182)
No production code is touched.
## Lint counts (golangci-lint 2.12.2)
| | before | after |
| --- | --- | --- |
| `noctx` | 47 | 0 |
| `gosec` | 23 | 23 (tracked in #176, #177) |
| `goconst` | 24 | 24 (tracked in #178) |
| **total** | **94** | **47** |
`make test` passes (race detector on), `make fmt` run,
`make fmt-check` clean. CI (`script/cibuild`, pinned golangci-lint
v2.10.1) was already green and stays green; the pin bump to enforce
the stricter set in CI is #179.
Note for reviewers: `make fmt` on this tree wants to reformat the
vendored `static/js/alpine.min.js` (no `.prettierignore` exists) and
`script/bootstrap` does not install `goimports` which `script/fmt`
requires — both left untouched here and will be filed as separate
issues.
Replace every httptest.NewRequest call with
httptest.NewRequestWithContext using the test's t.Context(). Thread
t *testing.T through the createSetupFormRequest and
createLoginFormRequest helpers so they can supply a context.
make lint under golangci-lint 2.12.2 drops from 94 findings to 47
(remaining: 23 gosec, 24 goconst, tracked in #176/#177/#178). make
test and make fmt-check pass unchanged.
Closes#175
Manager note (independent verification, not authored by this PR's implementer):
This PR is fully superseded by #187 (commit 7a34fc9, merged to main
2026-08-07 22:21), which contains the identical remediation for issue #175: every test-file httptest.NewRequest call is now httptest.NewRequestWithContext with t.Context().
Verified on current main (7a34fc9) in a clean worktree with the
pinned toolchain (golangci-lint v2.12.2, via make targets only):
zero remaining httptest.NewRequest( call sites without a context
anywhere under internal/ (grep over the main tree)
A rebase of fix-noctx-lint onto main therefore produces an empty
diff — there is nothing left to merge or review. Closing as
superseded rather than reworking; issue #175's definition of done is
met by main and is being closed with reference to #187.
Branch fix-noctx-lint is left on the remote untouched.
Manager note (independent verification, not authored by this PR's implementer):
This PR is fully superseded by #187 (commit 7a34fc9, merged to `main`
2026-08-07 22:21), which contains the identical remediation for issue
#175: every test-file `httptest.NewRequest` call is now
`httptest.NewRequestWithContext` with `t.Context()`.
Verified on current `main` (7a34fc9) in a clean worktree with the
pinned toolchain (golangci-lint v2.12.2, via `make` targets only):
- `make check` green: tests pass (race detector on), lint reports
0 issues, `fmt-check` clean
- zero remaining `httptest.NewRequest(` call sites without a context
anywhere under `internal/` (grep over the `main` tree)
A rebase of `fix-noctx-lint` onto `main` therefore produces an empty
diff — there is nothing left to merge or review. Closing as
superseded rather than reworking; issue #175's definition of done is
met by `main` and is being closed with reference to #187.
Branch `fix-noctx-lint` is left on the remote untouched.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes the largest of the three lint classes blocking a green
make checkunder current golangci-lint (issue #175).What changed
httptest.NewRequest(...)call in test code is nowhttptest.NewRequestWithContext(t.Context(), ...), wrappedmultiline where the single-line form would exceed the 88-column
llllimitcreateSetupFormRequestandcreateLoginFormRequestininternal/handlers/handlers_test.gonow taket *testing.T(andcall
t.Helper()) so they can supply the test context; all callsites updated
TODO.mdStatus/Next Step/Completed/Future rotated per the repoworkflow, now pointing at the issue backlog (#175–#182)
No production code is touched.
Lint counts (golangci-lint 2.12.2)
noctxgosecgoconstmake testpasses (race detector on),make fmtrun,make fmt-checkclean. CI (script/cibuild, pinned golangci-lintv2.10.1) was already green and stays green; the pin bump to enforce
the stricter set in CI is #179.
Note for reviewers:
make fmton this tree wants to reformat thevendored
static/js/alpine.min.js(no.prettierignoreexists) andscript/bootstrapdoes not installgoimportswhichscript/fmtrequires — both left untouched here and will be filed as separate
issues.
@clawbot please fix
Manager note (independent verification, not authored by this PR's implementer):
This PR is fully superseded by #187 (commit
7a34fc9, merged tomain2026-08-07 22:21), which contains the identical remediation for issue
#175: every test-file
httptest.NewRequestcall is nowhttptest.NewRequestWithContextwitht.Context().Verified on current
main(7a34fc9) in a clean worktree with thepinned toolchain (golangci-lint v2.12.2, via
maketargets only):make checkgreen: tests pass (race detector on), lint reports0 issues,
fmt-checkcleanhttptest.NewRequest(call sites without a contextanywhere under
internal/(grep over themaintree)A rebase of
fix-noctx-lintontomaintherefore produces an emptydiff — there is nothing left to merge or review. Closing as
superseded rather than reworking; issue #175's definition of done is
met by
mainand is being closed with reference to #187.Branch
fix-noctx-lintis left on the remote untouched.clawbot referenced this pull request2026-09-03 18:29:27 +02:00
Pull request closed