-
Notifications
You must be signed in to change notification settings - Fork 11.6k
feat(ci): auto-update openapi.json when API v2 files change #26973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name=".github/workflows/pr.yml">
<violation number="1" location=".github/workflows/pr.yml:500">
P2: `check-openapi-json` failures are only enforced when `has-files-requiring-all-checks` is true, but that filter excludes `docs/**`. For docs-only API v2 changes, the OpenAPI check can fail without blocking the required job. Consider enforcing `check-openapi-json` whenever `has-api-v2-changes` is true (outside the `has-files-requiring-all-checks` gate), or include docs in the gate so failures always block merges.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| needs.unit-test.result != 'success' || | ||
| needs.api-v2-unit-test.result != 'success' || | ||
| (needs.prepare.outputs.has-api-v2-changes == 'true' && needs.check-api-v2-breaking-changes.result != 'success') || | ||
| (needs.prepare.outputs.has-api-v2-changes == 'true' && needs.check-openapi-json.result != 'success') || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: check-openapi-json failures are only enforced when has-files-requiring-all-checks is true, but that filter excludes docs/**. For docs-only API v2 changes, the OpenAPI check can fail without blocking the required job. Consider enforcing check-openapi-json whenever has-api-v2-changes is true (outside the has-files-requiring-all-checks gate), or include docs in the gate so failures always block merges.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/pr.yml, line 500:
<comment>`check-openapi-json` failures are only enforced when `has-files-requiring-all-checks` is true, but that filter excludes `docs/**`. For docs-only API v2 changes, the OpenAPI check can fail without blocking the required job. Consider enforcing `check-openapi-json` whenever `has-api-v2-changes` is true (outside the `has-files-requiring-all-checks` gate), or include docs in the gate so failures always block merges.</comment>
<file context>
@@ -489,6 +497,7 @@ jobs:
needs.unit-test.result != 'success' ||
needs.api-v2-unit-test.result != 'success' ||
(needs.prepare.outputs.has-api-v2-changes == 'true' && needs.check-api-v2-breaking-changes.result != 'success') ||
+ (needs.prepare.outputs.has-api-v2-changes == 'true' && needs.check-openapi-json.result != 'success') ||
(needs.prepare.outputs.has-prisma-changes == 'true' && needs.check-prisma-migrations.result != 'success') ||
needs.build.result != 'success' ||
</file context>
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. ✅ No changes pushed |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Checkout PR branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the “cache-checkout” action we have
What does this PR do?
Adds a CI workflow that automatically keeps
openapi.jsonup-to-date when API v2 input/output files are modified.Currently, the
openapi.jsonis only generated when running API v2 in dev mode. When PRs modify API v2 files without regenerating the OpenAPI spec, the documentation becomes outdated. This PR adds a CI step that:openapi.jsonfile when API v2 related files are modifiedThe check runs when any of these paths are modified (using existing
has-api-v2-changesdetection):apps/api/v2/**packages/platform-*/**packages/trpc/**packages/prisma/schema.prismaMandatory Tasks (DO NOT REMOVE)
How should this be tested?
apps/api/v2/src/)yarn generate-swagger, the CI should automatically commit the updatedopenapi.jsonyarn generate-swaggerImportant for reviewers
vars.CI_NODE_ENV: The swagger generation only writes the file whenNODE_ENV=development. Please confirm thatCI_NODE_ENVis set todevelopmentin GitHub Actions variables, otherwise this check will always pass (false positive).[skip ci]in the auto-commit message to prevent infinite CI loops.Checklist
Link to Devin run: https://app.devin.ai/sessions/20427f8676304f1583ed712b5a28f0aa
Requested by: @ThyMinimalDev