Skip to content

fix(github): thread PUBLIC_SITE_ORIGIN into the @gittensory help command reference link - #4684

Merged
JSONbored merged 1 commit into
mainfrom
fix/commands-help-text-public-site-origin-4670
Jul 10, 2026
Merged

fix(github): thread PUBLIC_SITE_ORIGIN into the @gittensory help command reference link#4684
JSONbored merged 1 commit into
mainfrom
fix/commands-help-text-public-site-origin-4670

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

Completes the self-hoster branding sweep #4668 (#4613) started. The @gittensory help command's
rendered command-reference section linked to a hardcoded GITTENSORY_SITE_URL/docs/gittensory-commands
— the same branding gap #4668 fixed for gittensoryFooter and renderRepoDocContent, just discovered
after that PR shipped and deliberately left out of its scope to keep it small. 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.

Fix

Threads env through commandSectionshelpSections (the only command that renders this link),
mirroring the gittensoryFooter(env, ...) pattern from #4668. 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 (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), and
commandReferenceUrl falls back to the default site if PUBLIC_SITE_ORIGIN is malformed. Existing
helpSections/buildPublicAgentCommandComment tests updated for the new required env param. 100%
coverage on every changed line/branch. Typecheck clean.

Fixes #4670

…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
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 10, 2026
@JSONbored
JSONbored merged commit 8554f7b into main Jul 10, 2026
7 checks passed
@JSONbored
JSONbored deleted the fix/commands-help-text-public-site-origin-4670 branch July 10, 2026 12:00
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.14%. Comparing base (8ad748b) to head (43a296f).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

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           
Files with missing lines Coverage Δ
src/github/commands.ts 98.17% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Thread PUBLIC_SITE_ORIGIN into commands.ts help-text URL

1 participant