Skip to content

refactor(envd): extract inlined request/response bodies to OpenAPI components#2932

Closed
mishushakov wants to merge 3 commits into
mainfrom
mishushakov/envd-extract-body-components
Closed

refactor(envd): extract inlined request/response bodies to OpenAPI components#2932
mishushakov wants to merge 3 commits into
mainfrom
mishushakov/envd-extract-body-components

Conversation

@mishushakov

Copy link
Copy Markdown
Member

Moves the inlined request and response bodies in the envd OpenAPI spec into reusable components/requestBodies (Init, Compose) and components/responses (Metrics, EnvVars, ComposeSuccess), with each operation now referencing them via $ref. Regenerated api.gen.go gains only named type aliases — the operation-derived types like PostInitJSONBody are preserved, so handlers are unchanged. Verified with go build, go vet, and golangci-lint.

🤖 Generated with Claude Code

@cursor

cursor Bot commented Jun 5, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Spec and generated-type refactor only; no intentional wire-format or handler logic changes beyond type aliases.

Overview
Refactors the envd OpenAPI spec so inlined /init, /files/compose, /metrics, /envs, and /collapse payloads live under reusable components/requestBodies and components/responses, with paths wired via $ref. InitRequest is now the canonical init schema (replacing the generated PostInitJSONBody), and named aliases Init, Compose, ComposeSuccess, and CollapseSuccess are used in generated code and call sites.

Regenerated oapi-codegen output and updated envd handlers/tests, the orchestrator’s /init client payload type, and integration client response types to match the new names. HTTP contracts and JSON field shapes are unchanged—this is spec organization and type naming only.

Reviewed by Cursor Bugbot for commit 62c4699. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist gemini-code-assist 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.

Code Review

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/envd/internal/api/collapse.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread packages/envd/spec/envd.yaml Outdated
mishushakov and others added 2 commits July 3, 2026 17:24
Move the inlined /init and /files/compose request bodies and the
/metrics, /envs, /files/compose response bodies into reusable
components/requestBodies and components/responses. Regenerated
api.gen.go gains named aliases only; operation-derived types are
preserved, so handlers are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Switch the init and compose handlers (and their tests) to the new
component-derived types — Init, Compose, and ComposeSuccess — instead
of the operation-derived JSON body types.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov force-pushed the mishushakov/envd-extract-body-components branch from e141c54 to 6dbcfe4 Compare July 3, 2026 15:27
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Pull the /init request body's inline object schema into a named
components/schemas/InitRequest, and move the /collapse 200 response
(added on main) into components/responses/CollapseSuccess to match the
convention used by the other endpoints. This also drops the duplicate
PostInitJSONBody struct in favor of a single InitRequest type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov force-pushed the mishushakov/envd-extract-body-components branch from 29b7c75 to 62c4699 Compare July 3, 2026 15:37
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@jakubno jakubno closed this Jul 9, 2026
@jakubno jakubno deleted the mishushakov/envd-extract-body-components branch July 9, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants