Commit 78d3f54
fix: pin oapi-codegen version via go.mod tool directive (#210)
## Summary
- Adds `tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen`
directive to `server/go.mod`, pinning oapi-codegen at v2.6.0 via go.sum
- Switches `server/Makefile` from `go install ...@latest` to `go tool
oapi-codegen` so the pinned version is always used
- Removes the `OAPI_CODEGEN` binary variable and install target from the
Makefile (no longer needed)
This is the root cause fix for the version regression in #201 (where
`@latest` resolved to v2.5.1 instead of v2.6.0). PR #209 already
restored the generated code; this PR prevents it from happening again by
adopting the same `go.mod` tool directive pattern used in
`kernel/kernel`.
## Test plan
- [x] `go vet ./...` passes
- [x] Unit tests pass (`go test -race` on all non-e2e packages)
- [x] `go tool oapi-codegen -config ./oapi-codegen.yaml
./openapi-3.0.yaml` uses pinned v2.6.0
- [ ] CI server-test workflow passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk build tooling change: it only affects OpenAPI code generation
and Go module dependency resolution, not runtime behavior. Main risk is
unexpected dependency/tooling differences if the pinned tool or updated
transitive deps behave differently across environments.
>
> **Overview**
> **Pins `oapi-codegen` for reproducible OpenAPI generation.**
`server/go.mod` now declares `oapi-codegen` as a Go `tool` dependency
(and updates module sums), and `server/Makefile` switches
`oapi-generate` from installing `@latest` into `bin/` to invoking `go
tool oapi-codegen`.
>
> This removes the Makefile’s local `oapi-codegen` install
target/variable and updates Go module dependencies (including bumping
`github.com/getkin/kin-openapi` to `v0.133.0`) to reflect the pinned
toolchain.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d7632bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 306ac35 commit 78d3f54
3 files changed
+135
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 13 | | |
18 | 14 | | |
19 | | - | |
| 15 | + | |
20 | 16 | | |
21 | | - | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
| 89 | + | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| 101 | + | |
93 | 102 | | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| |||
0 commit comments