fix(github): thread PUBLIC_SITE_ORIGIN into the @gittensory help command reference link - #4684
Merged
Merged
Conversation
…and reference link The @gittensory help command's rendered command-reference section linked to a hardcoded GITTENSORY_SITE_URL/docs/gittensory-commands -- the same self-hoster branding gap PR #4668 (#4613) fixed for gittensoryFooter and renderRepoDocContent, just left out of that PR's scope. A self-hoster with PUBLIC_SITE_ORIGIN configured still got a link to gittensory.aethereal.dev in their own @gittensory help output instead of their own domain. Threads env through commandSections -> helpSections (the only command that renders this link), mirroring the gittensoryFooter(env, ...) pattern. Extracted a small commandReferenceUrl(env) helper using new URL(path, origin) -- the same idiom footer.ts's maintainerControlPanelUrl already uses -- rather than naive string concatenation, since a PUBLIC_SITE_ORIGIN with a trailing slash would otherwise produce a double slash. Fixes #4670
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4684 +/- ##
=======================================
Coverage 94.14% 94.14%
=======================================
Files 436 436
Lines 38526 38530 +4
Branches 14048 14049 +1
=======================================
+ Hits 36269 36273 +4
Misses 1599 1599
Partials 658 658
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Completes the self-hoster branding sweep #4668 (#4613) started. The
@gittensory helpcommand'srendered command-reference section linked to a hardcoded
GITTENSORY_SITE_URL/docs/gittensory-commands— the same branding gap #4668 fixed for
gittensoryFooterandrenderRepoDocContent, just discoveredafter that PR shipped and deliberately left out of its scope to keep it small. A self-hoster with
PUBLIC_SITE_ORIGINconfigured still got a link togittensory.aethereal.devin their own@gittensory helpoutput instead of their own domain.Fix
Threads
envthroughcommandSections→helpSections(the only command that renders this link),mirroring the
gittensoryFooter(env, ...)pattern from #4668. Extracted a smallcommandReferenceUrl(env)helper using
new URL(path, origin)— the same idiomfooter.ts'smaintainerControlPanelUrlalreadyuses — rather than naive string concatenation, since a
PUBLIC_SITE_ORIGINwith a trailing slash wouldotherwise produce a double slash (caught by my own first draft of the regression test failing).
Testing
2 new tests: the link follows
PUBLIC_SITE_ORIGIN(including the trailing-slash case), andcommandReferenceUrlfalls back to the default site ifPUBLIC_SITE_ORIGINis malformed. ExistinghelpSections/buildPublicAgentCommandCommenttests updated for the new requiredenvparam. 100%coverage on every changed line/branch. Typecheck clean.
Fixes #4670