-
Notifications
You must be signed in to change notification settings - Fork 147
ci: speed up js sdk release job #3213
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
📝 WalkthroughWalkthroughAdds a Nix-based GitHub Actions workflow for JavaScript SDK beta releases, removes two legacy workflows (Dagger-based release and SDK generation), adds a Makefile target to publish the JS SDK with env checks, and inserts a non-functional TODO comment in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
32b19e8 to
f963b2d
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: 4
🧹 Nitpick comments (2)
.github/workflows/sdk-javascript-dev-release.yaml (2)
26-27: Improve SHA extraction robustness.The current approach using
cutis fragile and doesn't handle potential variations in SHA format. Consider using a more robust method.run: | - id=$(echo ${{github.sha}} | cut -c 1-12) + id="${GITHUB_SHA:0:12}" echo "id=${id}" >> $GITHUB_OUTPUT
8-10: Consider limiting auto-releases from main branch.The workflow triggers on every push to main, which means every merge will create a beta release. This could lead to excessive releases and npm registry pollution.
Consider adding a path filter or requiring manual dispatch for releases:
push: branches: - main + paths: + - 'api/client/javascript/**' + - '.github/workflows/sdk-javascript-dev-release.yaml'Or remove the push trigger entirely if manual releases are preferred:
on: workflow_dispatch: - push: - branches: - - main
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.dagger/release.go(1 hunks).github/workflows/sdk-javascript-dev-release.yaml(1 hunks).github/workflows/sdk-javascript-release.yaml(0 hunks).github/workflows/sdk-javascript.yaml(0 hunks)api/client/javascript/Makefile(1 hunks)
💤 Files with no reviewable changes (2)
- .github/workflows/sdk-javascript.yaml
- .github/workflows/sdk-javascript-release.yaml
🔇 Additional comments (6)
api/client/javascript/Makefile (3)
11-11: Good synchronization reminder.The warning comment correctly emphasizes the need to keep this Makefile target in sync with the Dagger implementation during the transition period.
15-25: Excellent environment variable validation.The precondition checks for required environment variables provide clear error messages and usage examples, ensuring the target fails fast with helpful guidance.
28-30: LGTM on the publishing logic.The implementation correctly:
- Uses
--no-git-tag-versionto avoid creating git tags during version bumping- Uses
--no-git-checksto bypass git status checks during publishing- Provides clear success feedback with all relevant details
.dagger/release.go (1)
126-126: Good documentation of transition state.The TODO comment clearly indicates the temporary nature of this synchronization requirement and provides guidance for future cleanup once the release process is fully migrated to Nix.
.github/workflows/sdk-javascript-dev-release.yaml (2)
45-50: Well-designed cache strategy.The cache key hierarchy provides good fallback options:
- Primary: branch-specific with flake hash
- Fallback 1: branch-specific without hash
- Fallback 2: main branch with hash
- Fallback 3: main branch without hash
- Fallback 4: any OS build
This should provide effective cache hits while maintaining cache freshness.
54-57: LGTM on the Nix-based build execution.The implementation correctly:
- Uses
nix develop --impure .#cifor the development environment- Passes the required environment variables to the Makefile target
- Uses a semantic beta versioning scheme with the commit SHA
Use NIX for javascript beta package builds. This decreases the build time to 1-1.5mins from 3 minutes.
Remove javascript client PR based generation as CI enforces regeneration as part of the PR reivew.
The
-8executor is used for faster restores, otherwise this is not resource intensive.Summary by CodeRabbit
New Features
Chores