Skip to content

🤖 fix: map aggregated OpenAPI schemas to GVK for SSA#83

Merged
ThomasK33 merged 1 commit intomainfrom
fix/ssa-openapi-gvk
Feb 13, 2026
Merged

🤖 fix: map aggregated OpenAPI schemas to GVK for SSA#83
ThomasK33 merged 1 commit intomainfrom
fix/ssa-openapi-gvk

Conversation

@ThomasK33
Copy link
Member

Summary

Fix aggregated API OpenAPI model metadata so server-side apply can map aggregation.coder.com/v1alpha1 resources to structured-merge-diff types.

Background

kubectl apply --server-side was failing during managed fields processing with:

  • failed to convert new object to smd typed
  • no corresponding type for aggregation.coder.com/v1alpha1, Kind=CoderTemplate

The aggregated API server defines OpenAPI schemas manually, but those definitions were missing the x-kubernetes-group-version-kind extension that managedfields uses to index object types.

Implementation

  • Added x-kubernetes-group-version-kind extensions to manual OpenAPI definitions for:
    • CoderWorkspace
    • CoderWorkspaceList
    • CoderTemplate
    • CoderTemplateList
  • Added top-level object fields to the manual schemas (apiVersion, kind, metadata) and list metadata fields.
  • Added regression tests that assert:
    • template schema includes the GVK extension and object fields
    • managedfields TypeConverter can convert a CoderTemplate object to SMD typed form

Validation

  • make verify-vendor
  • make test
  • make build
  • make lint
  • GOFLAGS=-mod=vendor go test ./internal/app/apiserverapp -count=1

Risks

Low-to-moderate:

  • This changes manual OpenAPI model metadata only.
  • Main risk is schema shape drift for clients relying on previous minimal definitions.
  • Covered by new unit tests focused on GVK extension and managedfields conversion.

Generated with mux • Model: openai:gpt-5.3-codex • Thinking: xhigh


Generated with mux • Model: openai:gpt-5.3-codex • Thinking: xhigh • Cost: $0.29

Add GVK extensions and top-level object metadata fields to the aggregated API
server's manual OpenAPI schemas so managedfields can map
aggregation.coder.com/v1alpha1 objects to SMD types.

Also add regression tests that verify:
- CoderTemplate schema exposes x-kubernetes-group-version-kind and object fields
- managedfields type conversion succeeds for CoderTemplate objects

---
_Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_

---
_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.29`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.29 -->
@ThomasK33
Copy link
Member Author

@codex review

Please review this change for SSA compatibility and OpenAPI schema correctness.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 merged commit 2272d9b into main Feb 13, 2026
8 checks passed
@ThomasK33 ThomasK33 deleted the fix/ssa-openapi-gvk branch February 13, 2026 17:28
@ThomasK33
Copy link
Member Author

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.

1 participant