-
Notifications
You must be signed in to change notification settings - Fork 104
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
feat: Remove earthly usage #640
Conversation
WalkthroughThis pull request introduces significant changes to the build and deployment infrastructure, focusing on restructuring OpenAPI and client generation processes. The modifications span across multiple configuration files including Earthfile, Justfile, and flake.nix. The changes primarily involve removing OpenAPI-related build steps, updating deployment configurations, and integrating the Speakeasy tool for SDK generation. The overall approach seems to streamline the build process and simplify the project's toolchain. Changes
Possibly related PRs
Suggested labels
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 (
|
…thfile` - Added `openapi` task to `Justfile` for merging specs and generating docs. - Removed OpenAPI-related tasks from `Earthfile` in favor of `Justfile`. - Streamlined pre-commit process by centralizing OpenAPI steps in `Justfile`. This simplifies the OpenAPI generation workflow and reduces duplication, making the development process more efficient and maintainable.
- Add speakeasy CLI as an installable package in the Nix Flake. - Support multiple platforms with pre-defined hashes and binaries. - Enhance Nix devShells by including speakeasy for supported systems. - Simplify Justfile tasks by removing redundant Earthly build steps. - Update speakeasy generate command in Justfile for better usability. - Refactor workflows to eliminate unnecessary steps in Earthfile. These changes streamline SDK generation, improve multi-platform support, and reduce reliance on Earthly for local builds.
b31126a
to
5fa3086
Compare
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 (3)
Justfile (2)
33-35
: Add error handling for OpenAPI file merging.The openapi target assumes all YAML files exist. Consider adding checks to ensure files exist before merging.
openapi: + @test -f openapi/v1.yaml || (echo "openapi/v1.yaml not found" && exit 1) + @test -f openapi/v2.yaml || (echo "openapi/v2.yaml not found" && exit 1) + @test -f openapi/overlay.yaml || (echo "openapi/overlay.yaml not found" && exit 1) @yq eval-all '. as $item ireduce ({}; . * $item)' openapi/v1.yaml openapi/v2.yaml openapi/overlay.yaml > openapi.yaml @npx -y widdershins {{justfile_directory()}}/openapi/v2.yaml -o {{justfile_directory()}}/docs/api/README.md --search false --language_tabs 'http:HTTP' --summary --omitHeader
37-38
: Add validation for OpenAPI file existence.The generate-client target should verify that openapi.yaml exists before attempting SDK generation.
generate-client: + @test -f openapi.yaml || (echo "openapi.yaml not found. Run 'just openapi' first." && exit 1) @speakeasy generate sdk -s openapi.yaml -o ./pkg/client -l go
flake.nix (1)
58-78
: Consider adding binary verification.The package derivation looks good, but consider adding SHA256 verification of the binary itself for additional security.
installPhase = '' mkdir -p $out/bin unzip $src ls -al + echo "${speakeasyHashes.${system}}" | sha256sum -c install -m755 speakeasy $out/bin/ '';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
openapi.yaml
is excluded by!**/*.yaml
openapi/openapi-merge.json
is excluded by!**/*.json
openapi/overlay.yaml
is excluded by!**/*.yaml
pkg/client/.speakeasy/gen.lock
is excluded by!**/*.lock
,!**/*.lock
pkg/client/.speakeasy/gen.yaml
is excluded by!**/*.yaml
📒 Files selected for processing (6)
Earthfile
(0 hunks)Justfile
(2 hunks)flake.nix
(2 hunks)pkg/client/docs/models/operations/runscriptresponse.md
(1 hunks)pkg/client/formance.go
(1 hunks)pkg/client/models/operations/runscript.go
(1 hunks)
💤 Files with no reviewable changes (1)
- Earthfile
✅ Files skipped from review due to trivial changes (2)
- pkg/client/docs/models/operations/runscriptresponse.md
- pkg/client/models/operations/runscript.go
🔇 Additional comments (4)
Justfile (1)
6-6
: LGTM! Pre-commit workflow updated.The pre-commit target now includes the new OpenAPI and client generation tasks, properly replacing the removed earthly functionality.
flake.nix (2)
36-48
: LGTM! Well-structured speakeasy configuration.The version, platform mappings, and hashes are well-organized and comprehensive.
87-107
: LGTM! Development shell properly configured.The development shell includes all necessary tools, including the newly added speakeasy package.
pkg/client/formance.go (1)
145-148
: Verify API compatibility with version upgrade.The OpenAPI version has been upgraded from v1 to v2, and the SDK version has been bumped to 0.6.0. Please ensure:
- All API consumers are aware of the version change
- Breaking changes are documented
- Migration guide is available if needed
Run this script to check for potential breaking changes:
✅ Verification successful
API version upgrade appears backward compatible
The v2 upgrade maintains backward compatibility:
- v1 endpoints are preserved and still operational
- Path changes are minor and non-breaking (e.g.,
/_info
→/_/info
)- Both versions coexist in the codebase
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Compare OpenAPI specs to identify breaking changes # Check if both versions exist if [ -f "openapi/v1.yaml" ] && [ -f "openapi/v2.yaml" ]; then # Compare endpoints and their parameters echo "Comparing API endpoints and parameters:" rg -A 5 "paths:" openapi/v1.yaml echo "---" rg -A 5 "paths:" openapi/v2.yaml fi # Search for API version references in codebase echo "Searching for API version references:" rg "v1" --type goLength of output: 11088
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #640 +/- ##
==========================================
- Coverage 81.69% 81.65% -0.05%
==========================================
Files 131 131
Lines 7070 7070
==========================================
- Hits 5776 5773 -3
- Misses 991 993 +2
- Partials 303 304 +1 ☔ View full report in Codecov by Sentry. |
No description provided.