-
-
Notifications
You must be signed in to change notification settings - Fork 12
chore: add sample update workflow #353
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
WalkthroughA new GitHub Actions workflow is introduced that automatically updates sample repositories from the zenstackhq organization. The workflow triggers on release publication or manual dispatch, discovers repositories with the v3-sample topic, updates @zenstackhq packages to their next version, runs code generation, and commits any resulting changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
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 |
|
Claude finished @ymc9's task —— View job PR Review: Sample Update WorkflowI've reviewed the GitHub Actions workflow for updating sample repositories. Here's my comprehensive feedback: Todo List:
Code Quality & Best Practices ✅Strengths:
Minor improvements:
Security Assessment
|
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.
Pull Request Overview
This PR adds a new GitHub Actions workflow to automatically update @zenstackhq packages to the next release tag across all sample repositories in the zenstackhq organization. The workflow triggers on releases or manual dispatch and uses repository topics to identify target repositories.
- Adds automation to keep sample repos in sync with latest package releases
- Uses GitHub API to discover repos tagged with
v3-sampletopic - Updates packages via npm and commits changes back to each sample repository
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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: 2
🧹 Nitpick comments (3)
.github/workflows/update-samples.yml (3)
8-9: Update permissions to allow write access for commit and push operations.The workflow declares
contents: readbut performs write operations (commit and push) via PAT_TOKEN. While the PAT bypasses workflow permissions, this creates confusion and doesn't accurately reflect the workflow's requirements.Clarify the permissions declaration:
permissions: - contents: read + contents: writeAlternatively, if you prefer explicit documentation that PAT_TOKEN overrides permissions, add a comment.
75-82: Handle potential null values in jq filter for robust package extraction.The jq filter uses
addon[.dependencies, .devDependencies](line 77), but if either key is missing or null in package.json, this could fail or produce unexpected results.Apply this diff to safely handle missing fields:
# Get all @zenstackhq packages in the repo - PACKAGES=$(cat package.json | jq -r ' + PACKAGES=$(cat package.json | jq -r ' [.dependencies, .devDependencies] | - add | + map(select(. != null)) | add // {} | to_entries | map(select(.key | startswith("@zenstackhq/"))) | map(.key) | .[] ')
39-46: Consider fail-fast strategy implications and add logging for debugging.The
fail-fast: falsesetting (line 46) means failures in one repo won't stop updates to others, which is reasonable for batch operations. However, if updates fail silently (before error handling fixes), failures could go unnoticed.Once error handling is added to the update steps, consider adding a summary step that reports successes and failures across all repos for better visibility.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-samples.yml(1 hunks)
⏰ 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). (3)
- GitHub Check: build-test (20.x, sqlite)
- GitHub Check: build-test (20.x, postgresql)
- GitHub Check: claude-review
Summary by CodeRabbit