Skip to content

Conversation

@cemreinanc
Copy link
Contributor

@cemreinanc cemreinanc commented Feb 3, 2026

Summary by CodeRabbit

  • Chores
    • Improved PR preview URL slug generation with stricter validation and cleanup to ensure consistency and prevent invalid characters.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Workflow slug validation
.github/workflows/pr_preview.yml
Enhanced BRANCH_SLUG generation to enforce stricter character filtering, removing dots, replacing invalid characters with dashes, and stripping leading/trailing dashes for cleaner branch slugs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A dash of discipline, a dot swept away,
Slugs grow stricter with each regex play,
No leading, no trailing, just clean in between,
The prettiest branches our workflows have seen! ✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing edge cases in branch slug generation by implementing stricter character validation and cleanup.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-preview-name-truncation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2981ab4 and b9004b6.

📒 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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

🧹 Preview Environment Cleaned Up

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App ✅ Deleted
🗄️ PostgreSQL Branch ✅ Deleted
⚡ Redis Database ✅ Deleted
🔧 GitHub Deployments ✅ Removed
📦 Docker Image ⚠️ Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-02-03T11:41:40Z

@cemreinanc cemreinanc merged commit 6f02a6d into main Feb 3, 2026
16 checks passed
@cemreinanc cemreinanc deleted the fix-preview-name-truncation branch February 3, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant