fix(deploy): lowercase the subdomain before deploying - #5470
Conversation
A mixed-case branch name (e.g. Fix-MapPlaylistOvertime-testerror, run 35103862692) became a mixed-case SITE. The API's site schema only accepts lowercase, so /cluster/latest returned 400 and, with CLUSTER_STATE_SOURCE=api, update.sh failed the deploy. Server check-in sends the same site and would be rejected too, and browsers lowercase the page host anyway, so the preview could never list its server. Lowercase in the workflow's sanitizing step (a canonical mapping, like _ and / to -, so it does not add the collision digest) and in deploy.sh for manual runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughDeployment subdomain handling now lowercases input before sanitization and validation. The workflow preserves length and empty-result checks. The deployment script accepts only lowercase hostname characters. ChangesSubdomain validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Mixed-case deployment names are canonicalized consistently across automated and manual deployments, with no remaining actionable merge risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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. Lowercase letters line up in flight Comment |
Problem
A mixed-case branch name (
Fix-MapPlaylistOvertime-testerror, run 35103862692, PR #5467) became a mixed-case subdomain, because the sanitizing step indeploy.ymland the check indeploy.shboth allowA-Z.update.shthen sentsite=Fix-MapPlaylistOvertime-testerror.openfront.devto/cluster/latest. The API's site schema only accepts lowercase (^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$), so it returned400 Invalid site, and withCLUSTER_STATE_SOURCE=apithe deploy failed. The container was up, but server check-in sends the same site name and is rejected too. Browsers also lowercase the page host, so the preview couldn't list its server either way.Fix
deploy.yml: lowercase the raw subdomain before the rest of the sanitizing. It's treated as a canonical mapping (like_and/→-), so it doesn't add the collision digest:Fix-Foodeploys tofix-foo, the same host DNS would resolve anyway.deploy.sh: lowercaseSUBDOMAINtoo (matching howHOSTis already handled) so manual runs are covered, and tighten the label check to[a-z0-9-].Testing
tr(ubuntu:24.04):Fix-MapPlaylistOvertime-testerror→fix-mapplaylistovertime-testerror;Fix/Map_X→fix-map-x;Feat/Héllo_xstill drops theéand gets the digest.bash -n deploy.sh.After merge, affected PR branches need a rebase/re-run. They will move to the lowercase host, and the old uppercase container stays on the staging box until someone removes it.
🤖 Generated with Claude Code