-
Notifications
You must be signed in to change notification settings - Fork 1
ci: open version update PR as draft if tests fail #18
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: master
Are you sure you want to change the base?
Conversation
We want a PR anytime there is an update even if tests fail so the site maintainer is aware changes might be required.
WalkthroughUpdated GitHub Actions workflow for SDK version management with conditional PR draft creation based on test outcomes. Modified action references to use fixed commit SHAs, added test result tracking, and enhanced PR body with test result summaries. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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)
.github/workflows/update-evo-sdk.yml (1)
117-130: Complex conditional expression in PR body may have rendering issues.The multiline string literals within the GitHub Actions expression (lines 120–126) could potentially cause parsing or rendering problems. The nested
format()call is structurally sound, but the overall expression mixes multiple operators (&&,||) and spans multiple lines, which may be fragile.- **Test Results:** - - Smoke tests: ${{ steps.smoke_tests.outcome == 'success' && '✅ Passed' || '❌ Failed' }} - - Query tests: ${{ steps.query_tests.outcome == 'success' && '✅ Passed' || '❌ Failed' }} - ${{ steps.smoke_tests.outcome == 'success' && steps.query_tests.outcome == 'success' && ' - - ✅ Smoke and query tests passed!' || format(' - - ⚠️ **This PR is in draft because tests failed.** - - Review the test failures in the [workflow run]({0}/{1}/actions/runs/{2}) and update the site code to support the new SDK version.', github.server_url, github.repository, github.run_id) }} + **Test Results:** + - Smoke tests: ${{ steps.smoke_tests.outcome == 'success' && '✅ Passed' || '❌ Failed' }} + - Query tests: ${{ steps.query_tests.outcome == 'success' && '✅ Passed' || '❌ Failed' }} + + ${{ steps.smoke_tests.outcome == 'success' && steps.query_tests.outcome == 'success' && '✅ Smoke and query tests passed!' || format('⚠️ **This PR is in draft because tests failed.**\n\nReview the test failures in the [workflow run]({0}/{1}/actions/runs/{2}) and update the site code to support the new SDK version.', github.server_url, github.repository, github.run_id) }}Alternatively, use a clearer ternary with escaped newlines:
+ ${{ steps.smoke_tests.outcome == 'success' && steps.query_tests.outcome == 'success' ? '✅ Smoke and query tests passed!' : format('⚠️ **This PR is in draft because tests failed.**\n\nReview the test failures in the [workflow run]({0}/{1}/actions/runs/{2}) and update the site code to support the new SDK version.', github.server_url, github.repository, github.run_id) }}Could you verify that the PR body renders correctly with the current multiline string approach, particularly in the GitHub UI? If there are any rendering issues, the refactored version above should be more reliable.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-evo-sdk.yml(4 hunks)
🔇 Additional comments (4)
.github/workflows/update-evo-sdk.yml (4)
1-16: Workflow restructuring looks solid.The rename from "Update evo-sdk version on npm release" to "Check/Update SDK version" better reflects the scheduled nature, and the concurrency policy correctly prevents overlapping runs. Workflow permissions are appropriately scoped for PR creation.
24-24: Pinned action versions with commit SHAs improve reproducibility and security.Using fixed commit hashes instead of major version tags (e.g.,
v5→08c6903cd8c0fde910a37f88322edcfb5dd907a8) prevents supply chain attacks and ensures consistent behavior across workflow runs. Comments preserving the semantic version are helpful for maintainability.Also applies to: 27-27, 105-105
86-102: Test isolation with step IDs andcontinue-on-erroris correct.Setting
idon each test step and usingcontinue-on-error: trueallows both tests to run independently and later steps to inspect outcomes viasteps.<id>.outcome. This is the right pattern for capturing test results and making decisions based on them.
107-107: Draft PR logic correctly ties to test outcomes.The condition
draft: ${{ steps.smoke_tests.outcome != 'success' || steps.query_tests.outcome != 'success' }}properly marks a PR as draft if either test fails, achieving the objective of always opening a PR but flagging failures for review. Branch naming and title are appropriately versioned.Also applies to: 108-110
Updates the workflow to always open a PR when a new version of the SDK is available. If the tests don't pass, it sets the PR to draft and indicates which test set failed. Also pins the GitHub action versions by hash
Summary by CodeRabbit