-
Notifications
You must be signed in to change notification settings - Fork 114
feat: add task to handle OpenAPI artifact in Earthfile #644
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
Conversation
Added a new task `openapi` to manage OpenAPI specification by copying `openapi.yaml` and saving it as an artifact. This enhances automation and ensures consistent handling of OpenAPI files.
WalkthroughThis pull request introduces a new Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Earthfile (1)
76-80
: Implementation looks good but could be enhanced.The basic implementation correctly handles the OpenAPI artifact. The approach is consistent with other targets in the Earthfile.
Consider these enhancements:
- Add OpenAPI specification validation:
openapi: FROM core+base-image WORKDIR /src COPY openapi.yaml openapi.yaml + RUN npm install -g @apidevtools/swagger-cli + RUN swagger-cli validate openapi.yaml SAVE ARTIFACT ./openapi.yaml
- Add version tagging to the artifact:
openapi: FROM core+base-image + ARG VERSION=latest WORKDIR /src COPY openapi.yaml openapi.yaml - SAVE ARTIFACT ./openapi.yaml + SAVE ARTIFACT ./openapi.yaml AS LOCAL ./openapi-${VERSION}.yaml
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Earthfile
(1 hunks)
🔇 Additional comments (1)
Earthfile (1)
79-79
: Verify openapi.yaml existence and document its location.The COPY command will fail if openapi.yaml doesn't exist, but it would be helpful to:
- Add a comment documenting the expected location of openapi.yaml
- Add an explicit check for the file's existence
Run this script to verify the OpenAPI file location:
✅ Verification successful
OpenAPI file exists in the expected location
The
openapi.yaml
file is present in the repository root, exactly where the Earthfile's COPY command expects it. No changes needed.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify openapi.yaml existence and location # Check if openapi.yaml exists in the root if [ -f "openapi.yaml" ]; then echo "Found openapi.yaml in root directory" else # Search for potential OpenAPI files in the repository echo "Searching for OpenAPI files:" fd -e yaml -e yml -e json | grep -i "openapi\|swagger" fiLength of output: 108
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 81.65% 81.66% +0.01%
==========================================
Files 131 131
Lines 7070 7070
==========================================
+ Hits 5773 5774 +1
Misses 993 993
+ Partials 304 303 -1 ☔ View full report in Codecov by Sentry. |
Added a new task
openapi
to manage OpenAPI specification by copyingopenapi.yaml
and saving it as an artifact. This enhances automation and ensures consistent handling of OpenAPI files.