fix: regenerate OpenAPI specs from Go types, add jobConfig/jobScript and correct HTTP methods#499
fix: regenerate OpenAPI specs from Go types, add jobConfig/jobScript and correct HTTP methods#499
Conversation
✅ Deploy Preview for interlink-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…elds - Extend cmd/openapi-gen/main.go to generate both interlink-openapi.json and plugin-openapi.json from Go types (was only generating interlink spec) - Bump default version from 0.4.0 to 0.6.0 in generator - Fix interLink API /create response type: RetrievedPodData → CreateStruct - Add generatePluginSpec() producing plugin-openapi.json with correct RetrievedPodData schema including jobConfig and jobScript fields - Regenerate both JSON specs - Add docs/openapi/GENERATING.md documenting how to regenerate the specs Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com> Agent-Logs-Url: https://github.com/interlink-hq/interLink/sessions/f924d1c2-df66-4086-a403-d5eb0bf80d06
There was a problem hiding this comment.
Pull request overview
This PR updates interLink’s OpenAPI documentation by switching spec generation to be derived from Go types (rather than manually maintained), and regenerates both the interLink server API spec and the plugin API spec to include newer request/response shapes (notably jobConfig/jobScript in the plugin /create request).
Changes:
- Refactors
cmd/openapi-gen/main.goto generate both interLink and plugin OpenAPI specs, bumps default spec version to0.6.0, and corrects interLink/createresponse typing. - Regenerates
docs/openapi/interlink-openapi.jsonanddocs/openapi/plugin-openapi.json. - Adds
docs/openapi/GENERATING.mddocumenting how to regenerate the specs.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/openapi-gen/main.go |
Splits spec generation into interLink vs plugin, bumps default version, and updates schema types for /create. |
docs/openapi/plugin-openapi.json |
Regenerated plugin API spec; /create request now includes jobConfig and jobScript. |
docs/openapi/interlink-openapi.json |
Regenerated interLink server API spec at 0.6.0 with corrected /create response type. |
docs/openapi/GENERATING.md |
New docs explaining the two specs and how to regenerate them. |
ci/go.mod |
Removes require blocks (and ci/go.sum is emptied in this PR). |
Comments suppressed due to low confidence (1)
ci/go.mod:12
ci/go.modremoved allrequiredirectives andci/go.sumwas emptied. If the Dagger module (including generatedinternal/daggercode) still depends on external modules, this will force dependency resolution at runtime and may break builds that run with-mod=readonlyor rely on pinned sums. Please verifydagger call -m ./ci ...still works without modifying go.mod/go.sum, or re-add the required dependencies and sums viago mod tidyinci/.
module dagger/interlink
go 1.24.0
replace go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc => go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0
replace go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp => go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.14.0
replace go.opentelemetry.io/otel/log => go.opentelemetry.io/otel/log v0.14.0
replace go.opentelemetry.io/otel/sdk/log => go.opentelemetry.io/otel/sdk/log v0.14.0
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Diego Ciangottini <diego.ciangottini@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Diego Ciangottini <diego.ciangottini@gmail.com>
…ogs, DELETE for /delete) - /status: POST → GET in both interLink and plugin specs - /getLogs: POST → GET in both specs; response content type → text/plain - /delete: POST → DELETE in interLink spec (VK uses DELETE; plugin spec keeps POST) - GENERATING.md: fix method tables and Makefile TAB indentation - Regenerate both JSON specs Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com> Agent-Logs-Url: https://github.com/interlink-hq/interLink/sessions/ba60a74d-3a23-4f5a-91b7-c803e7e417e9
…opilot/update-to-v0-5-6
…ndpoints Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com> Agent-Logs-Url: https://github.com/interlink-hq/interLink/sessions/6a77c206-23c5-4838-b539-a4866280f2f0
Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com> Agent-Logs-Url: https://github.com/interlink-hq/interLink/sessions/6a77c206-23c5-4838-b539-a4866280f2f0
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // server communication and writes it to ./docs/openapi/interlink-openapi.json. | ||
| func generateInterlinkSpec(version string) { | ||
| reflector := openapi3.Reflector{} | ||
| reflector.Spec = &openapi3.Spec{Openapi: "3.0.3"} |
There was a problem hiding this comment.
OpenAPI 3.0.3 is a poor fit for this API because several endpoints use JSON request bodies with GET/DELETE. Many OpenAPI 3.0 consumers omit/ignore request bodies for those methods, and the regenerated specs end up dropping the request schema for /status, /getLogs, and /delete even though the runtime sends/reads JSON bodies. Consider emitting OpenAPI 3.1.0 (or remodeling those endpoints) so the request contracts are actually captured.
| reflector.Spec = &openapi3.Spec{Openapi: "3.0.3"} | |
| reflector.Spec = &openapi3.Spec{Openapi: "3.1.0"} |
| reflector := openapi3.Reflector{} | ||
| reflector.Spec = &openapi3.Spec{Openapi: "3.0.3"} | ||
| reflector.Spec.Info. | ||
| WithTitle("interLink Plugin API"). |
There was a problem hiding this comment.
Same OpenAPI version issue for the plugin spec: with Openapi: "3.0.3", the generated spec currently has no request schema for /status and /getLogs even though interLink sends JSON bodies in those GET requests. Switching to OpenAPI 3.1.0 (or remodeling the endpoints) would allow the spec to represent the actual request payloads.
| @@ -2,46 +2,6 @@ module dagger/interlink | |||
|
|
|||
| go 1.24.0 | |||
|
|
|||
There was a problem hiding this comment.
ci/go.mod now has only replace directives and no require block, and ci/go.sum is empty. Since this module depends on generated Dagger Go SDK code (ci/.gitignore ignores internal/dagger, etc.), builds can become non-reproducible or fail under -mod=readonly once the generated code imports external modules. Consider regenerating the Dagger SDK and committing the resulting go.mod/go.sum requirements (or documenting why deps should be unpinned).
| require ( | |
| go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0 | |
| go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.14.0 | |
| go.opentelemetry.io/otel/log v0.14.0 | |
| go.opentelemetry.io/otel/sdk/log v0.14.0 | |
| ) |
| | Endpoint | Method | Request type | Response type | | ||
| |---|---|---|---| | ||
| | `/create` | POST | `PodCreateRequests` | `CreateStruct` | | ||
| | `/delete` | DELETE | `v1.Pod` | — | | ||
| | `/pinglink` | POST | — | — | |
There was a problem hiding this comment.
The table documents /status and /getLogs as GET requests with JSON request types, but the generated OpenAPI 3.0.3 specs currently contain no request schema for these endpoints (many OpenAPI 3.0 tools omit/ignore GET request bodies). Either document this caveat here (GET-with-body is non-standard) or switch the specs to OpenAPI 3.1.0 / remodel the endpoints so the request payloads are represented.
plugin-openapi.jsonwas manually maintained and stuck at v0.4.0, causing the/createendpoint's request schema (RetrievedPodData) to be missing thejobConfig(ScriptBuildConfig) andjobScriptfields that interLink actually sends to plugins. Additionally, several endpoints had incorrect HTTP methods documented.Changes
cmd/openapi-gen/main.gogenerateInterlinkSpec()+generatePluginSpec()— generator now produces both JSON files from Go types0.4.0→0.6.0/createresponse was typed asRetrievedPodData; corrected toCreateStruct(what plugins return and interLink proxies to the VK)RetrievedPodDataas the/createrequest body, which carriesjobConfigandjobScript/statuscorrected toGETin both interLink and plugin specs (matches actual client code)/getLogscorrected toGETwithtext/plainresponse in both specs (matches actual streaming behaviour)/deletecorrected toDELETEin the interLink spec (VK calls DELETE); plugin spec keepsPOSTrequestBody.required: trueset for all POST endpoints that require a body (/createin both specs;/deletein the plugin spec), using awithRequiredBodyhelper that hooks into theCustomizecallbackdocs/openapi/plugin-openapi.json— regenerated;/createrequest body now includes:{ "pod": { ... }, "container": [ ... ], "jobConfig": { "SingularityHubProxy": {...}, "ApptainerOptions": {...}, "Volumes": {...} }, "jobScript": "..." }docs/openapi/interlink-openapi.json— regenerated at v0.6.0 with corrected/createresponse type, correct HTTP methods throughout, andrequestBody.required: trueon/createdocs/openapi/GENERATING.md— new file documenting both specs, their endpoint tables (with correct HTTP methods), and how to keep them in sync (make openapi); Markdown tables use a single leading|and the Makefile snippet uses correct TAB indentationOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.