chore: add cube-cos-openapi submodule as single state of truth#580
chore: add cube-cos-openapi submodule as single state of truth#580raven-pan wants to merge 2 commits into
Conversation
f10720d to
7fc1bf0
Compare
There was a problem hiding this comment.
1. Orphan submodule path breaks fresh-clone builds
.gitmodules registers only api/cube-cos-openapi, but there's a second gitlink
cube-cos-openapi (root) that isn't registered — and the Taskfile reads from that
unregistered path (cube-cos-openapi/docs.yaml). On a clean clone,
git submodule update --init won't populate it, so task generateApiDocs
(→ buildLocalBinary / runLocalDevApi) fails. Please keep one submodule path
and make .gitmodules, the gitlink, and the Taskfile agree.
2. Generates fresh every build isn't true for the release artifact
generateApiDocs is wired only into the local-dev tasks. RPM %build and ci.yml
just go build, so they embed the committed api/docs.json, not a regenerated
one. The drift-prevention benefit doesn't apply to the shipped binary.
3. Removing diffApiDocs drops the only drift guard
With the guard gone and regen absent from CI, a stale api/docs.json can ship
silently. Suggest a CI step (with submodules: true):
- run: task generateApiDocs && git diff --exit-code api/docs.json4. This chore also ships an API-surface change (minor)
The regenerated JSON isn't a pure reformat:
- +2 endpoints (
gpuCards,gpuCards/{gpuId}) - +3 schemas (
GPUCardStatus,GPUResourceType,GPUSupportResourceType) - a
NodeRole$refrefactor
Thanks for your review! These are my solutions,I will:
|
33727e2 to
2b085e4
Compare
Hi @arasHi87 I've already fix issues 1~3, please review again. Thanks! |
2b085e4 to
6e329d2
Compare
Signed-off-by: raven-pan-bigstack <raven.pan@bigstack.co>
6e329d2 to
f3854ea
Compare
Signed-off-by: raven-pan-bigstack <raven.pan@bigstack.co>
0a2441a to
e4e2338
Compare
What type of PR is this?
Chore / Refactor
Which issue(s) this PR fixes?
N/A — this is a housekeeping change to establish cube-cos-openapi as the single source of truth for API documentation.
What this PR does?
bigstack-oss/cube-cos-openapias a git submodule at cube-cos-openapi and cube-cos-openapi.//go:embed docs.jsonapproach — the spec is now embedded from a generated file at build time.generateApiDocsTaskfile task (yq -o=json -I=4 docs.yaml > api/docs.json) and wires it as a dependency ofbuildLocalBinaryandrunLocalDevApi.diffApiDocscheck task (no longer needed since the JSON is generated).Benefits:
Test results (optional)
1). make sure the api docs have been updated
task generateApiDocsproduces docs.json from docs.yaml/api/v1/datacenters/{dataCenter}/apidocs/index.html2). make sure the api works properly
task deployRemoteDevApiandtask vetpass cleanly