fix: header blank in serve mode due to INI whitespace and unguarded githubRepository#3363
fix: header blank in serve mode due to INI whitespace and unguarded githubRepository#3363Mpdreamz wants to merge 1 commit into
Conversation
SoftCircuits.IniFileParser preserves leading whitespace in values, so
reading `url = git@github.com:org/repo.git` from .git/config yielded
" git@github.com:..." (space-prefixed). NormalizeToGitHubPath's
StartsWith("git@github.com:") check then failed silently, cascading to
a null GitHubRepository on the C# side and a missing github-repository
HTML attribute on the Razor side.
Razor null-suppression meant the web component received the prop as
undefined rather than an empty string. The TypeScript component called
githubRepository.includes('/') unconditionally, crashing React's
render and leaving <elastic-docs-header> empty in serve mode.
Fix: trim the URL value in BranchTrackingRemote (matching the existing
Trim() already applied to remoteName). Also make githubRepository
optional in the Header/DeploymentInfo web components so missing
repository info degrades gracefully rather than crashing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches✨ Simplify code
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 |
Summary
SoftCircuits.IniFileParserpreserves leading whitespace from INI values, so readingurl = git@github.com:org/repo.gitfrom.git/configyielded" git@github.com:..."(space-prefixed).NormalizeToGitHubPath'sStartsWith("git@github.com:")check then failed silently, makingGitHubRepositorynull locally.<elastic-docs-header>received nogithub-repositoryHTML attribute, so r2wc passedundefinedto the React component.getDeploymentLinkscalledgithubRepository.includes('/')unconditionally, throwing aTypeErrorthat crashed React's render silently and left the entire header blank inservemode.Fix (3 changes):
GitCheckoutInformationFactory.cs: add.Trim()to the URL value read from the INI file — consistent with the existing.Trim()already applied toremoteName.DeploymentInfo.tsx: makegithubRepositoryoptional; guardgetDeploymentLinksand the Repository row againstundefined.Header.tsx: makegithubRepositoryandgithubLinkoptional to match reality (Razor omits them when null).Test plan
dotnet run --project src/tooling/docs-builder -- servelocally; confirm the header renders with branch/commit button visiblenpm run compile:checkinsrc/Elastic.Documentation.Site🤖 Generated with Claude Code