Skip to content

fix(deploy): lowercase the subdomain before deploying - #5470

Merged
Celant merged 1 commit into
mainfrom
fix/lowercase-deploy-subdomain
Sep 16, 2026
Merged

Celant merged 1 commit into
mainfrom
fix/lowercase-deploy-subdomain

Conversation

@Celant

@Celant Celant commented Sep 16, 2026

Copy link
Copy Markdown
Member

Problem

A mixed-case branch name (Fix-MapPlaylistOvertime-testerror, run 35103862692, PR #5467) became a mixed-case subdomain, because the sanitizing step in deploy.yml and the check in deploy.sh both allow A-Z.

update.sh then sent site=Fix-MapPlaylistOvertime-testerror.openfront.dev to /cluster/latest. The API's site schema only accepts lowercase (^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$), so it returned 400 Invalid site, and with CLUSTER_STATE_SOURCE=api the 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-Foo deploys to fix-foo, the same host DNS would resolve anyway.
  • deploy.sh: lowercase SUBDOMAIN too (matching how HOST is already handled) so manual runs are covered, and tighten the label check to [a-z0-9-].

Testing

  • Ran the new sanitizing pipeline locally and under GNU tr (ubuntu:24.04): Fix-MapPlaylistOvertime-testerrorfix-mapplaylistovertime-testerror; Fix/Map_Xfix-map-x; Feat/Héllo_x still 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

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>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ca5e585a-2209-4d78-ae30-c39e7f692e18

📥 Commits

Reviewing files that changed from the base of the PR and between 7eb424d and 53e22eb.

📒 Files selected for processing (2)
  • .github/workflows/deploy.yml
  • deploy.sh

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

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

Changes

Subdomain validation

Layer / File(s) Summary
Canonical subdomain normalization and validation
.github/workflows/deploy.yml, deploy.sh
The workflow lowercases and sanitizes subdomains, preserves the 63-character limit, and distinguishes lossy input. deploy.sh lowercases SUBDOMAIN and validates lowercase hostname characters.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: evanpelle

Merge Risk: ⚪ Minimal · up to 53e22

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)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: lowercasing the subdomain during deployment.
Description check ✅ Passed The description explains the mixed-case subdomain problem, the workflow and script changes, and the related testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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

Lowercase letters line up in flight
Hyphens settle edges right
Digits pass the hostname gate
Long names meet their proper fate
Clean subdomains deploy tonight

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

@Celant
Celant merged commit 863d5b5 into main Sep 16, 2026
18 of 19 checks passed
@Celant
Celant deleted the fix/lowercase-deploy-subdomain branch September 16, 2026 15:15
@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

1 participant