Skip to content

Add documentation for subdomain matching in forge host determination#12567

Closed
estib-vega with Copilot wants to merge 1 commit into
improve-forge-detectionfrom
copilot/sub-pr-12564
Closed

Add documentation for subdomain matching in forge host determination#12567
estib-vega with Copilot wants to merge 1 commit into
improve-forge-detectionfrom
copilot/sub-pr-12564

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Addresses feedback from #12564 requesting documentation of the subdomain matching logic in custom_host_matches_repository_host.

Changes

  • Added doc comment explaining subdomain matching behavior with concrete examples
  • Documents that api.example.com (account host) matches example.com (repo host)
  • Clarifies the normalization + comparison logic
/// Checks if an account's custom host matches a repository host.
///
/// This function supports subdomain matching, where an account's custom host that is a
/// subdomain of the repository host will match. For example:
/// - Account host: `api.example.com`, Repository host: `example.com` → matches
/// - Account host: `gitlab.mycompany.com`, Repository host: `mycompany.com` → matches
/// - Account host: `example.com`, Repository host: `example.com` → matches (exact match)
///
/// The logic first normalizes both hosts (removing schemes, paths, ports, etc.) and then
/// checks if they are identical or if the account host ends with the repository host
/// prefixed by a dot (indicating it's a subdomain).
fn custom_host_matches_repository_host(repository_host: &str, account_custom_host: &str) -> bool {

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Feb 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Skipped Skipped Feb 24, 2026 0:03am

Request Review

@estib-vega estib-vega closed this Feb 24, 2026
Copilot AI changed the title [WIP] Address feedback on but-forge PR Add documentation for subdomain matching in forge host determination Feb 24, 2026
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.

2 participants