Skip to content

fix: list every enum value the API can return in the Swagger spec - #30122

Merged
nickvigilante merged 6 commits into
mainfrom
fix-swagger-enums
Nov 10, 2026
Merged

nickvigilante merged 6 commits into
mainfrom
fix-swagger-enums

Conversation

@nickvigilante

@nickvigilante nickvigilante commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

The API reference is generated from Swagger comments and struct tags, and several enums:"..." tags narrowed a named enum type, so the docs omitted values the server returns. For example, User.status listed only active and suspended, not dormant, and TemplateVersion.warnings listed DEPRECATED_PARAMETERS, which is not a value of the type.

Remove 34 enums tags that narrow or duplicate a named type so the referenced type's full value list is used. Tags that describe an intentional subset stay: ACL role fields (which omit the "" deleted sentinel used only in update requests), APIKey.scope, and plain-string fields. Template.provisioner keeps its tag because .swaggo replaces ProvisionerType with string.

Also fix enum defects that break code generators:

  • The provisioner jobs and daemons status query parameters listed their enum twice (Swagger 2.0 requires unique enum items) or with the wrong type. Both are now []codersdk.ProvisionerJobStatus and []codersdk.ProvisionerDaemonStatus, matching what each handler parses, including comma-separated values. The daemons route previously documented job statuses, which the handler rejects with a 500.
  • Replace the _ zero placeholder of WatchErrorCode with iota + 1, so the spec no longer lists 0 or x-enum-varnames: ["_", ...]. Wire values are unchanged.

Where the narrowed tag hid values the server returns, the SDK type now includes them: LoginTypeOAuth2ProviderApp, BuildReasonAutodelete, and MissingTemplateParameter widen the generated TypeScript unions. The dashboard attributes autodelete builds to Coder like other system builds. APIKey.login_type and AuthorizationCheck.action set explicit examples so the generated samples stay representative.

TestSwaggerEnumsNotNarrowed fails when a property's enum list drops values of its named type (other than the 15 allowlisted intentional subsets), lists a value the type lacks, or repeats a value.

Part of DOCS-1122, split from #30121.


🤖 Built with AI assistance.

@linear-code

linear-code Bot commented Sep 29, 2026

Copy link
Copy Markdown

DOCS-1122

@nickvigilante
nickvigilante marked this pull request as ready for review September 29, 2026 20:06
@nickvigilante nickvigilante added the api Area: HTTP API label Oct 5, 2026
@matifali
matifali removed their request for review October 7, 2026 13:53
@matifali
matifali removed their request for review October 14, 2026 18:34
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review

coder-agents-review Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-10-29 03:39 UTC by @nickvigilante

Review history
  • R1 (2026-10-29): 9 reviewers, 1 Nit, 1 P2, 3 P3, 2 P4, COMMENT. Review
  • R2 (2026-10-29): 14 reviewers, 2 Nit, 1 P2, 8 P3, 6 P4, COMMENT. Review
  • R3 (2026-10-29): 9 reviewers, 3 Nit, 1 P2, 9 P3, 11 P4, COMMENT. Review
  • R4 (2026-10-29): 6 reviewers, 3 Nit, 1 P2, 9 P3, 13 P4, COMMENT. Review
  • R5 (2026-10-29): 6 reviewers, 3 Nit, 1 P2, 9 P3, 13 P4, APPROVE. Review

deep-review v0.13.0 | Round 5 | 2255794..99dba17

Last posted: Round 5, 26 findings (1 P2, 9 P3, 13 P4, 3 Nit), APPROVE. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Author fixed (26c3600) codersdk/apikey.go:20 APIKey.login_type enum omits oauth2_provider_app and lists "" (examples now show "") R1 Netero, Leorio Yes
CRF-2 Note Author fixed (261101a, WatchErrorUnspecified removed) codersdk/workspacesdk/workspaceagentconnwatch.go:20 WatchErrorUnspecified unused; swagger still lists code 0 R1 Netero No
CRF-3 Note Dropped by orchestrator (restates the PR description's stated exception) codersdk/templates.go:26 Template.provisioner stays narrowed to terraform R1 Netero No
CRF-4 P2 Author fixed (26c3600) coderd/provisionerdaemons.go:27 provisionerdaemons status param documented as ProvisionerJobStatus; handler parses ProvisionerDaemonStatus (documented values return 500) R1 Mafuuu P2, Pariston P2, Melody P3 Yes
CRF-5 P3 Author fixed (26c3600) codersdk/workspacebuilds.go:86 WorkspaceBuild.reason enum omits autodelete, which the server returns R1 Melody, Pariston, Mafuuu Yes
CRF-6 P4 Author fixed (26c3600) codersdk/provisionerdaemons.go:199 ProvisionerJob.error_code enum omits MISSING_TEMPLATE_PARAMETER R1 Melody P4, Mafuuu Note Yes
CRF-7 P3 Author fixed (26c3600) codersdk/users.go:86 No test prevents a new enums tag from narrowing a named type again R1 Ryosuke P3, Mafu-san Note Yes
CRF-8 Nit Author fixed (26c3600) codersdk/workspacesdk/workspaceagentconnwatch.go:18 WatchErrorUnspecified doc comment restates the zero value R1 Gon Yes
CRF-9 P4 Author fixed (26c3600) codersdk/authorization.go:34 authcheck examples now show application_connect as the action R1 Leorio Yes
CRF-10 Note Note (body) PR description Description does not say duplicate enum items violate Swagger uniqueness R1 Leorio No
CRF-11 Note Note (body) codersdk/audit.go:287 Removed resource_type list contained auditable_group, not a ResourceType value R1 Melody No
CRF-12 Note Note (body) codersdk/agentsdk/agentsdk.go:674 AgentMetric.Type keeps a duplicate enums tag not named in the description R1 Mafu-san No
CRF-13 Note Dropped by orchestrator (no spec effect, no action) codersdk/organizations.go:131 storage_method enum still emitted from validate oneof R1 Kite No
CRF-14 OOS Out of scope (body) codersdk/workspacebuilds.go:43 No test compares SDK enum const blocks with database enums R1 Pariston, Netero No
CRF-15 OOS Out of scope (body) Makefile:1505 apidoc .gen prerequisites exclude codersdk subpackages R1 Netero No
CRF-16 OOS Out of scope (body) coderd/provisionerdaemons.go:26 ids described as job IDs; offline and max_age params undocumented R1 Melody, Pariston, Mafuuu No
CRF-17 P3 Author fixed (261101a) coderd/coderdtest/swagger_test.go:138 Enum narrowing test skips array properties (Items never read) R2 Netero Yes
CRF-18 P3 Author fixed (261101a) site/src/utils/workspace.tsx:38 autodelete UI handling has no test case R2 Netero Yes
CRF-19 P4 Author contested; panel closed R3 (1/1 accept) codersdk/apikey.go:39 LoginTypeOAuth2ProviderApp makes request schemas list a rejected value R2 Netero Yes
CRF-20 P4 Author fixed (261101a) coderd/provisionerdaemons.go:27 status param documented as single value; handler accepts a list R2 Netero Yes
CRF-21 Note Note (body) codersdk/provisionerdaemons.go:170 MissingTemplateParameter duplicates runner constant string R2 Netero No
CRF-22 P3 Author fixed (PR description updated, R3) coderd/provisionerdaemons.go:27 PR description misnames the daemons status type and omits new SDK constants, test, and UI change R2 Mafu-san P3, Leorio P3, Nami Note Yes
CRF-23 P3 Author fixed (261101a) coderd/coderdtest/swagger_test.go:109 allowedSubsets comment gives a reason that is wrong for the ACL role entries R2 Gon P2, Leorio P4 Yes
CRF-24 P3 Author fixed (261101a) coderd/coderdtest/swagger_test.go:103 Test doc claims a duplicate check on enum lists; only parameters are checked R2 Gon P3, Leorio P4 Yes
CRF-25 P4 Author fixed (261101a) coderd/coderdtest/swagger_test.go:169 Allowlisted properties only need to differ from their type, not be subsets R2 Knov P4, Gon P4 Yes
CRF-26 Nit Author fixed (261101a) coderd/coderdtest/swagger_test.go:197 enumStrings doc restates the body R2 Gon Yes
CRF-27 Nit Dropped by orchestrator (matches the sibling comment form in the same const block) codersdk/workspacebuilds.go:65 BuildReasonAutodelete doc repeats the literal R2 Gon No
CRF-28 P4 Author fixed (261101a) codersdk/workspacesdk/workspaceagentconnwatch.go:19 Start WatchErrorCode at iota + 1 instead of naming an unsent zero value R2 Knov Yes
CRF-29 Note Note (body) coderd/coderdtest/swagger_test.go:181 Test cannot detect a @PARAM enums list narrowing a named type R2 Ryosuke No
CRF-30 OOS Out of scope (body) coderd/provisionerdaemons.go:27 No test checks a @PARAM type against the type the handler parses R2 Bisky No
CRF-31 OOS Out of scope (body) site/src/utils/workspace.tsx:24 System build reasons listed in three places; only the Record is type-checked R2 Nami, Knov No
CRF-32 P4 Author fixed (c044dce) codersdk/workspacesdk/workspaceagentconnwatch.go:18 iota + 1 lost the comment explaining why codes start at 1 R3 Netero Yes
CRF-33 OOS Out of scope (body) codersdk/users.go:173 Request fields using shared LoginType list token, "", oauth2_provider_app that handlers reject R3 Netero No
CRF-34 P4 Author fixed (c044dce) coderd/coderdtest/swagger_test.go:103 Test doc attributes the foreign-value check to narrowing R3 Gon P2 Yes
CRF-35 Nit Author fixed (c044dce) coderd/coderdtest/swagger_test.go:169 assertEnumMatchesType comment restates the closure signature R3 Gon P2 Yes
CRF-36 Nit Dropped by orchestrator (current enumStrings doc follows the Go doc convention of naming the function and its result) coderd/coderdtest/swagger_test.go:222 Re-raise of CRF-26: enumStrings doc still restates the body R3 Gon P2 No
CRF-37 P4 Author fixed (c044dce) coderd/coderdtest/swagger_test.go:185 Narrowing failure message names only the enums tag and offers an allowlist fix that cannot pass for foreign values R3 Leorio Yes
CRF-38 P4 Author fixed (c044dce) coderd/coderdtest/swagger_test.go:179 Foreign-value failure message gives no corrective action R3 Leorio Yes
CRF-39 P3 Author fixed (PR description updated, R4) codersdk/workspacesdk/workspaceagentconnwatch.go:18 PR description says it removes WatchErrorUnspecified, which does not exist at base, and implies wire values change R3 Mafu-san P2 Yes
CRF-40 P4 Author fixed (c044dce) coderd/coderdtest/swagger_test.go:110 allowedSubsets comment gives a reason only for the 11 ACL entries R3 Mafu-san Yes
CRF-41 OOS Out of scope (body) coderd/httpapi/queryparams.go:319 Invalid provisioner status filter values reach the SQL enum cast (inferred 500, not 400) R3 Knov, Komugi No
CRF-42 P4 Author fixed (99dba17) coderd/coderdtest/swagger_test.go:186 Both failure messages suggest removing a oneof validation tag (lines 180, 186) R4 Netero, Leorio Yes
CRF-43 Nit Dropped by orchestrator (merged into CRF-45, same comment rewrite) coderd/coderdtest/swagger_test.go:103 Test doc comment no longer starts with the function name R4 Netero No
CRF-44 P4 Dropped by orchestrator (merged into CRF-42, same defect at line 180) coderd/coderdtest/swagger_test.go:180 Foreign-value message suggests removing a value from a oneof tag R4 Leorio No
CRF-45 P4 Author fixed (99dba17) coderd/coderdtest/swagger_test.go:103 Test doc names only enums tags, ignores allowedSubsets, misstates extra values for requests, and drops the function name R4 Mafu-san P4, Gon P4, Netero Nit Yes
CRF-46 Nit Dropped by orchestrator (comment text was the R3 suggestion and states the intent of + 1; Leorio verified it; further rewording is churn) codersdk/workspacesdk/workspaceagentconnwatch.go:18 "Codes start at 1" restates iota + 1 R4 Gon P2 No
CRF-47 Nit Dropped by orchestrator (first sentence defines what qualifies; style only, third rewrite of this comment) coderd/coderdtest/swagger_test.go:110 allowedSubsets first sentence restates the map name R4 Gon P2 No
CRF-48 Nit Dropped by orchestrator (failure messages name each defect; rename is cosmetic) coderd/coderdtest/swagger_test.go:106 Test name names one of three checks R4 Gon No
CRF-49 Note Note (body) coderd/coderdtest/swagger_test.go:192 Failure keys are swagger definitions, so an embedded field fails and needs allowlisting once per embedding struct R4 Chopper No

Contested and acknowledged

CRF-19 (P4, codersdk/apikey.go:39) - LoginTypeOAuth2ProviderApp makes request schemas list a rejected value

  • Finding: Adding LoginTypeOAuth2ProviderApp to the shared codersdk.LoginType makes CreateUserRequestWithOrgs.login_type and ConvertLoginRequest.to_type list oauth2_provider_app, which POST /users rejects with 400. Proposed: give those request fields an enums tag and add them to allowedSubsets.
  • Author defense: The server returns oauth2_provider_app for API keys, so the response enum needs it, and LoginType is one shared type. token and "" are already listed on those request fields without being accepted, so this is the same pre-existing request-side looseness. Narrowing request fields is a separate change from making responses complete; offered as a follow-up if the human owner wants it.
  • Panel closure (R3, 1/1): Netero, the agent that raised it (same agent, resumed), accepted the defense: the response enum must contain the value because the server returns it on APIKey.login_type, the request fields already listed two rejected values (token, "") before this PR, and the failure is an explicit 400 with no state change. Request-field narrowing for shared enum types is listed as out of scope (CRF-33).

Round log

Round 1

Netero first pass: 1 P3, 2 Note, no P0, panel proceeded. Law not run (effective additions 39). Full panel, focused (Go only): ging-go, ryosuke, melody, pariston, mafuuu, gon, leorio, mafu-san, wildcard kite. Result: 1 P2, 3 P3, 2 P4, 1 Nit posted; 4 body notes; 3 out of scope; 2 dropped. Gon P2 on comment wording downgraded to Nit (no behavior or reader impact; Leorio judged the comment accurate). Reviewed against 2255794..1a998a1.

Round 2

Churn guard PROCEED: CRF-1, 4, 5, 6, 7, 8, 9 author fixed in 26c3600 (claims; reviewers verified CRF-1, 4, 5, 6, 8, 9; CRF-7 partially, gaps in CRF-17, CRF-24, CRF-25). Fix round (commits only address R1 findings; no new repo files, no exported signature changes). Panel: R1 raisers whose code changed (mafuuu, pariston, melody, ryosuke, mafu-san, gon, leorio), delta specialists (ging-go, ging-ts, ging-react, nami, bisky, komugi), wildcard knov. Netero advisory: 2 P3, 2 P4, 1 Note. New: 3 P3, 2 P4, 1 Nit posted from panel; CRF-23 downgraded P2 to P3 (keep-argument: a wrong rationale on the allowlist invites bad entries; downgrade reason: consequence is reader confusion, the mechanical check is unaffected). Gon P2 enumStrings doc downgraded to Nit (style only). CRF-27 dropped. Reviewed against 2255794..26c3600.

Round 3

Churn guard PROCEED: CRF-17, 18, 20, 23, 24, 25, 26, 28 author fixed in 261101a; CRF-22 fixed by description update; CRF-19 contested. Dispute check-in: Netero (R2 agent resumed via message_agent) accepted the CRF-19 defense, closed 1/1; request-field narrowing recorded as CRF-33 (OOS). Netero advisory: 1 P4 (CRF-32). Fix round (delta only fixes R2 findings). Panel: raisers whose code changed (gon, leorio, knov, mafu-san), delta specialists (ging-go, ging-ts, bisky, komugi), wildcard meruem. Reviewers verified CRF-17, 18, 20, 22, 23, 24, 25, 28 fixed; Mafu-san found CRF-23 fix incomplete (CRF-40). Downgrades: Gon P2 test doc to P4 (keep-argument: doc misstates the defect class; downgrade: the failure messages name each defect, consequence is one loose clause); Gon P2 closure comment to Nit (style); Mafu-san P2 description to P3 (keep-argument: squash body permanent and implies a wire change; downgrade: same class as CRF-22 at P3, one bullet). Gon re-raise of CRF-26 dropped (CRF-36). Reviewed against 2255794..261101a.

Round 4

Churn guard PROCEED: CRF-32, 34, 35, 37, 38, 40 author fixed in c044dce; CRF-39 fixed by description update. Netero advisory: 1 P4 (CRF-42), 1 Nit (CRF-43). Fix round (delta changes comments and failure messages only). Panel: raisers whose code changed (gon, leorio, mafu-san), delta specialists (ging-go, bisky), wildcard chopper. Two new findings were caused by text the R3 review suggested (CRF-37/38 "enums or oneof", CRF-34 doc without the function name); this round's suggestions were checked against allowedSubsets, oneof request fields, and the Go doc convention. Gon P2 x2 dropped as churn on text already iterated (CRF-46, CRF-47; keep-argument: restating clauses; drop reason: style only, comments verified accurate by Leorio and Netero). Reviewed against 2255794..c044dce.

Round 5

Churn guard PROCEED: CRF-42, CRF-45 author fixed in 99dba17. Netero advisory: no findings. Fix round (delta changes one test doc comment and two failure messages). Panel: raisers (leorio, mafu-san, gon), delta specialists (ging-go, bisky), wildcard mafuuu. All reviewers: no findings; fixes verified. No open findings remain. Reviewed against 2255794..99dba17.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes 34 enums struct tags and two @Param enum lists so the Swagger spec uses each named type's full value list, and renames the WatchErrorCode zero value. Findings: 1 P2, 3 P3, 2 P4, 1 Nit.

Out of scope (needs a ticket or explicit acceptance by a human):

  • codersdk/workspacebuilds.go:43: no test compares SDK enum const blocks with their database enums (database.AllBuildReasonValues() and siblings), so BuildReason and LoginType drifted from the database without a failing check, and the generated reference inherits the drift.
  • Makefile:1505: coderd/apidoc/.gen depends on $(wildcard codersdk/*.go), which does not match codersdk/healthsdk/ or codersdk/workspacesdk/, so a change limited to those packages does not regenerate swagger.json through make gen.
  • coderd/provisionerdaemons.go:26: the ids parameter is described as job IDs but filters daemon IDs, and the handler's offline and max_age parameters have no @Param line, so the reference misdescribes this endpoint's filters.

Notes:

  • codersdk/workspacesdk/workspaceagentconnwatch.go:20: WatchErrorUnspecified has no references, and the WatchErrorCode definition still lists 0, a code the server does not send.
  • codersdk/audit.go:287: the removed CreateTestAuditLogRequest.resource_type list contained auditable_group, which is not a ResourceType value, so this removal also drops a value the server would not accept.
  • codersdk/agentsdk/agentsdk.go:674: AgentMetric.Type keeps enums:"counter,gauge", a duplicate of AgentMetricType that the description's list of kept tags does not mention. The type is not in swagger.json, so it has no effect on the spec.
  • PR description: it says the duplicated status list breaks code generators but not how. The spec listed six statuses twice in one enum array, and Swagger 2.0 requires enum items to be unique.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/provisionerdaemons.go Resolved
Comment thread codersdk/apikey.go Resolved
Comment thread codersdk/workspacebuilds.go Resolved
Comment thread codersdk/users.go Resolved
Comment thread codersdk/provisionerdaemons.go Resolved
Comment thread codersdk/authorization.go Resolved
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2 reviews 26c3600, which fixes the round 1 findings, adds three SDK enum constants, adds TestSwaggerEnumsNotNarrowed, and attributes autodelete builds to Coder in the dashboard. Findings: 5 P3, 4 P4, 1 Nit.

All seven round 1 findings are fixed, and reviewers checked each fix against the code. TestSwaggerEnumsNotNarrowed fails against the base spec and passes at head. Four of the new findings are gaps or inaccurate comments in that test.

Out of scope (needs a ticket or explicit acceptance by a human):

  • coderd/provisionerdaemons.go:27: no test checks that the type in a @Param annotation matches the type the handler parses, so a query parameter can document values the handler rejects with a 500 while the suite stays green.
  • site/src/utils/workspace.tsx:24: a system build reason must be added in three places (the getDisplayWorkspaceBuildInitiatedBy switch, systemBuildReasons, buildReasonLabels), and only buildReasonLabels is type-checked, so a new reason can get a label but be shown as initiated by the owner.

Notes:

  • codersdk/provisionerdaemons.go:170: MissingTemplateParameter repeats the string of runner.MissingParameterErrorCode instead of referencing it, as its two siblings do, so renaming one of the two strings would not cause a compile error.
  • coderd/coderdtest/swagger_test.go:180: Swagger 2.0 query parameters carry no $ref, so the test cannot detect an enums(...) list that narrows a named type on a @Param. No such list exists at head.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread site/src/utils/workspace.tsx Resolved
Comment thread codersdk/apikey.go Resolved
Comment thread coderd/provisionerdaemons.go Resolved
Comment thread coderd/provisionerdaemons.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 3 reviews 261101a, which documents both provisioner status filters as arrays, starts WatchErrorCode at iota + 1, and extends TestSwaggerEnumsNotNarrowed to array items, values outside the type, and duplicates in every enum list. Findings: 1 P3, 5 P4, 1 Nit.

The round 2 findings on the test, the autodelete test row, the status array type, the WatchErrorCode zero value, and the description are fixed; reviewers reproduced the array and foreign-value failures against regenerated specs. The defense on LoginTypeOAuth2ProviderApp in request schemas is accepted: the response enum must list the value, and the request fields already listed rejected values before this PR. The remaining findings are wording in the test and the description.

Out of scope (needs a ticket or explicit acceptance by a human):

  • codersdk/users.go:173: CreateUserRequestWithOrgs.login_type and ConvertLoginRequest.to_type (codersdk/users.go:388) use the shared LoginType, so the spec lists token, "", and oauth2_provider_app as request values the handlers reject with 400.
  • coderd/httpapi/queryparams.go:319: ProvisionerDaemonStatuses and p.Strings (coderd/provisionerjobs.go:109) accept any string, and the queries cast it to provisioner_daemon_status[] and provisioner_job_status[], so a status value outside the documented enum likely returns 500 instead of a 400 validation error (inferred from the cast, not run).

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 4 reviews c044dce, which changes the test's comments and failure messages and restores the WatchErrorCode comment. Findings: 2 P4.

The round 3 findings are fixed, and the description now matches the base-to-head diff. Both remaining findings come from wording the round 3 review suggested: the "enums or oneof" failure text and the test doc without the function name. The suggestions below were checked against the oneof request fields, allowedSubsets, and the Go doc convention.

Notes:

  • coderd/coderdtest/swagger_test.go:192: failures are keyed by Swagger definition, not by the Go struct that holds the tag, so a narrowing tag on ReducedUser.Status fails under ReducedUser, User, and TemplateUser, and an intentional subset needs one allowedSubsets key per embedding struct.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/coderdtest/swagger_test.go Resolved
Comment thread coderd/coderdtest/swagger_test.go Resolved
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 5 reviews 99dba17, which rewords the TestSwaggerEnumsNotNarrowed doc comment and its two failure messages. No new findings.

Both round 4 findings are fixed, and no findings remain open. The test passes at head and fails with the new messages when a foreign value is added or an allowlist entry is removed. The out-of-scope items listed in earlier rounds still need a ticket or explicit acceptance by a human.

🤖 This review was automatically generated with Coder Agents.

@github-actions github-actions Bot added the stale This issue is like stale bread. label Nov 10, 2026
Document the provisioner daemon status filter with its own type, add the
missing build reason, login type, and job error code values, keep
representative examples, and add a test that fails when an enums tag
narrows a named type or an enum list repeats a value. The dashboard
labels the new autodelete build reason as a system build.

Part of DOCS-1122.

Assisted-by: AI
Document the provisioner status filters as lists, since both handlers
accept comma-separated and repeated values. Drop the unused
WatchErrorUnspecified so the spec lists only the codes the server sends.
Make TestSwaggerEnumsNotNarrowed check array items, reject values a type
does not have, and detect duplicates in definitions and properties.

Part of DOCS-1122.

Assisted-by: AI
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 22:15 — with GitHub Actions Inactive
@nickvigilante
nickvigilante merged commit 7301cee into main Nov 10, 2026
30 of 32 checks passed
@nickvigilante
nickvigilante deleted the fix-swagger-enums branch November 10, 2026 22:42
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 22:42 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
@nickvigilante

Copy link
Copy Markdown
Collaborator Author

Merged with check-docs still pending: its runner hung in the "Pre Harden Runner" setup step for 25+ minutes and ignored both cancel and force-cancel, so the link check never ran on the rebased head.
It passed on the previous head, and the rebase only changed generated API reference files under docs/reference/api/.
All required checks passed.


🤖 Posted by Coder Agents on behalf of @nickvigilante.

This branch was previously deployed

1 inactive deployment
main — 5c1d07c0 Deployed Nov 10, 2026 by nickvigilante via cla #253745
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api Area: HTTP API stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants