Repository navigation
ci: run the swagger annotation tests in fork-ci - #41
Conversation
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.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Gates checked on head |
Closes #39.
fork-ci never ran
./coderd/coderdtest, so a broken swagger comment block passed CI. On #36 (de74d221a8), aconstand its doc comment sat between the swagger block ofwatchChatTodosand the func, which madeTestEndpointsDocumentedfail and would drop the route fromswagger.jsonon the nextmake gen.The
chat-testsjob, which already starts Postgres, now runs:That runs
TestEndpointsDocumentedandTestSwaggerParametersValidincoderdtest, andTestEnterpriseEndpointsDocumentedincoderdenttest. The issue proposedTestEndpointsDocumented|TestSwagger, but that pattern does not match the enterprise test, andcoderdenttestreported[no tests to run]. The chatd README's CI table lists the new step.Validation
Local runs in Colima (
golang:1.26.10-bookwormwith apostgres:17container, the command above with-v):main5598133803TestEndpointsDocumented,TestSwaggerParametersValid,TestEnterpriseEndpointsDocumentedmainwith the issue's patterncoderdenttest:[no tests to run]getChatincoderd/exp_chats.go(a documentedconstbetween@Routerand the func)Go function comment must be placed before swagger comments(swaggerparser.go:325), exit 1Negative 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) {