Skip to content

ci: run the swagger annotation tests in fork-ci - #41

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/fork-ci-swagger-tests
Nov 9, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/fork-ci-swagger-tests

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Closes #39.

fork-ci never ran ./coderd/coderdtest, so a broken swagger comment block passed CI. On #36 (de74d221a8), a const and its doc comment sat between the swagger block of watchChatTodos and the func, which made TestEndpointsDocumented fail and would drop the route from swagger.json on the next make gen.

The chat-tests job, which already starts Postgres, now runs:

go test -count=1 -run 'EndpointsDocumented|TestSwagger' ./coderd/coderdtest ./enterprise/coderd/coderdenttest

That runs TestEndpointsDocumented and TestSwaggerParametersValid in coderdtest, and TestEnterpriseEndpointsDocumented in coderdenttest. The issue proposed TestEndpointsDocumented|TestSwagger, but that pattern does not match the enterprise test, and coderdenttest reported [no tests to run]. The chatd README's CI table lists the new step.

Validation

Local runs in Colima (golang:1.26.10-bookworm with a postgres:17 container, the command above with -v):

Tree Result
main 5598133803 PASS: TestEndpointsDocumented, TestSwaggerParametersValid, TestEnterpriseEndpointsDocumented
main with the issue's pattern coderdenttest: [no tests to run]
Negative control: the #36 layout on getChat in coderd/exp_chats.go (a documented const between @Router and the func) FAIL in both packages: Go function comment must be placed before swagger comments (swaggerparser.go:325), exit 1
Negative control diff (not committed)
 // @Router /api/v2/chats/{chat} [get]
-//
+// negativeControlResync mirrors the #36 layout: a documented const between
+// the swagger block and its handler.
+const negativeControlResync = 30
+
 //nolint:revive // HTTP handler writes to ResponseWriter.
 func (api *API) getChat(rw http.ResponseWriter, r *http.Request) {

Xum opened this PR on behalf of @ibetitsmike.

fork-ci never ran ./coderd/coderdtest, so a comment between a handler's
swagger block and its func passed CI and later dropped the route from
swagger.json. The chat-tests job now runs TestEndpointsDocumented,
TestEnterpriseEndpointsDocumented and TestSwaggerParametersValid.

The pattern is EndpointsDocumented rather than TestEndpointsDocumented
so that it also matches the enterprise test.

Closes #39.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T09:41:57.226971Z 3be41b4 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike
ibetitsmike merged commit 7d2145d into main Nov 9, 2026
10 checks passed
@ibetitsmike
ibetitsmike deleted the mike/fork-ci-swagger-tests branch November 9, 2026 09:57
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Gates checked on head 3be41b4457: fork-ci green on this head (run 42595153982, the new "Swagger annotation tests" step passed in both packages), Codex found no issues on this head, 0 unresolved review threads. CI only, so no UAT. Negative control: a documented const placed between a swagger block and its handler fails both packages with "Go function comment must be placed before swagger comments". Merged right after #33 so one deploy carries both; this PR does not change the server binary. Closes #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.

fork-ci: run the swagger annotation tests

1 participant