-
Notifications
You must be signed in to change notification settings - Fork 27
fix: branch slug generation edge cases #4226
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
📝 WalkthroughWalkthroughThe PR modifies branch slug generation in the preview workflow to enforce stricter character validation. Dots are removed from allowed characters, non-alphanumeric/dash/underscore characters are replaced with dashes, and leading/trailing dashes are stripped after truncation to enhance slug integrity. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🤖 Fix all issues with AI agents
In @.github/workflows/pr_preview.yml:
- Around line 134-135: The BRANCH_SLUG assignment can produce an empty string
when BRANCH_REF contains only invalid chars; after the existing pipeline that
computes BRANCH_SLUG, add a validation step that checks if BRANCH_SLUG is empty
and replaces it with a safe fallback (for example a fixed token like "branch" or
a sanitized PR number/commit short) so resource names never end with a trailing
dash, and ensure any downstream resource-name construction that uses BRANCH_SLUG
trims or omits hyphens when the slug is the fallback; target the BRANCH_SLUG
assignment/usage in the .github/workflows/pr_preview.yml to implement this check
and fallback.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pr_preview.yml
⏰ 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). (4)
- GitHub Check: Deploy Preview App
- GitHub Check: Backend Checks
- GitHub Check: Frontend Checks
- GitHub Check: integration-tests
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
🧹 Preview Environment Cleaned UpThe preview environment for this PR has been destroyed.
Cleanup triggered by PR close at 2026-02-03T11:41:40Z |
Summary by CodeRabbit