fix(github): honor PUBLIC_SITE_ORIGIN in the PR footer and repo-doc render - #4668
Merged
Merged
Conversation
…ender gittensoryFooter and renderRepoDocContent hardcoded gittensory.aethereal.dev in every reviewed PR's public footer and every generated AGENTS.md, so a self-hoster's own deployment still attributed both surfaces to JSONbored's product instead of their own domain. gittensoryFooter now takes an env param and resolves env.PUBLIC_SITE_ORIGIN ?? GITTENSORY_SITE_URL, matching the sibling maintainerControlPanelUrl in the same file; the env is threaded through every call site across engine.ts, commands.ts, planner.ts, e2e-test-gen-render.ts, processors.ts, settings-preview.ts, and routes.ts. renderRepoDocContent now accepts a siteUrl parameter resolved by its one caller (repo-doc-pr.ts) from the same env.PUBLIC_SITE_ORIGIN fallback, preserving the function's pure/deterministic contract that generated-doc-refresh.ts's byte-for-byte diff depends on. Fixes #4613
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
3 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4668 +/- ##
=======================================
Coverage 94.13% 94.13%
=======================================
Files 434 434
Lines 38554 38555 +1
Branches 14053 14055 +2
=======================================
+ Hits 36291 36292 +1
Misses 1604 1604
Partials 659 659
🚀 New features to boost your workflow:
|
JSONbored
added a commit
that referenced
this pull request
Jul 10, 2026
…and reference link (#4684) 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
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.
Summary
gittensoryFooter(src/github/footer.ts) hardcodedGITTENSORY_SITE_URL(https://gittensory.aethereal.dev) in the "Checked by Gittensory" attribution line that's appended to every reviewed PR comment, even for self-hosted deployments with their ownPUBLIC_SITE_ORIGINconfigured. The siblingmaintainerControlPanelUrlin the same file already resolvedenv.PUBLIC_SITE_ORIGIN ?? GITTENSORY_SITE_URLcorrectly —gittensoryFooternow does the same, so it takes anenvparam and threads it through.renderRepoDocContent(src/review/repo-doc-render.ts) hardcoded the same URL in the generatedAGENTS.mdcontent committed to a self-hoster's own repo. It now takes asiteUrlstring param resolved by its one caller (openRepoDocPullRequestinsrc/github/repo-doc-pr.ts) from the sameenv.PUBLIC_SITE_ORIGIN ?? GITTENSORY_SITE_URLfallback — preserving the function's pure/deterministic contract (same(profile, siteUrl)always renders the same output) thatgenerated-doc-refresh.ts's byte-for-byte diff-aware refresh depends on.PUBLIC_SITE_ORIGINconfigured) is unchanged — both still fall back toGITTENSORY_SITE_URL.Every
gittensoryFooter(/footerEarnUrl(call site was threaded, grepped exhaustively before and after:src/signals/engine.ts—buildPublicPrIntelligenceComment(×1 call) andbuildMinimalInviteComment(×1 call), both gained anenvfield on their argssrc/github/commands.ts—buildPublicAgentCommandComment(×1 call), gained anenvfield on its argssrc/review/planner.ts—buildIssuePlanComment(×1 call), gained anenvfield on its argssrc/review/e2e-test-gen-render.ts—buildE2eTestGenCommentBody(×3 internal calls), gained anenvfield onE2eTestGenCommentInputsrc/queue/processors.ts— 10 directgittensoryFooter(call sites updated to passenv(already in scope — every enclosing function already takesenv: Env), plus the 4 wrapper-function calls above (buildPublicPrIntelligenceCommentviacommentArgs,buildE2eTestGenCommentBody×2,buildIssuePlanComment,buildPublicAgentCommandComment) updated to passenvthroughsrc/signals/settings-preview.ts—buildSamplePreviewCommentandbuildRepoSettingsPreview(the settings-preview UI's sample-comment builder) threadedenvdown tobuildPublicPrIntelligenceCommentsrc/api/routes.ts— the/v1/repos/:owner/:repo/settings-previewroute passesc.env;buildCommandPreview(the maintainer command-preview UI) threadedenvdown tobuildPublicAgentCommandCommentfooterEarnUrlitself (inengine.ts) doesn't referenceGITTENSORY_SITE_URL— it resolves a Gittensor-network earn-CTA URL (gittensorRepoEarnUrl/GITTENSOR_HOME_URL), a separate, shared network that's never rebranded per-deployment — so it needed no signature change, onlyenvin scope in the same calling functions (which it now has).Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint(no workflow files changed)npm run typechecknpm run test:coveragelocally, scoped to every changed source file (footer.ts,repo-doc-render.ts,repo-doc-pr.ts,e2e-test-gen-render.ts,planner.ts,commands.ts,engine.ts,settings-preview.ts,processors.ts,routes.ts) plus their full owning unit/integration test files — 100% line+branch on every changed line; see Notes for detailnpm run test:workers(no Cloudflare-pool-specific code touched)npm run build:mcp(no MCP package changes)npm run test:mcp-pack(no MCP package changes)npm run ui:openapi:checknpm run ui:lint(no UI changes)npm run ui:typecheck(no UI changes)npm run ui:build(no UI changes)npm audit --audit-level=moderate(no dependency changes)Safety
envis internal plumbing only)Notes
src/github/footer.ts,src/review/repo-doc-render.ts,src/github/repo-doc-pr.ts,src/review/e2e-test-gen-render.ts, andsrc/review/planner.tsare each at 100%/100% line+branch on their scoped test runs.src/github/commands.tsandsrc/signals/settings-preview.tsshow 100% lines with no uncovered lines; their sub-100% branch % is entirely pre-existing/unrelated to this diff (verified line-by-line againstgit diff).src/signals/engine.tsandsrc/queue/processors.tsare large files with substantial pre-existing coverage gaps elsewhere; every line/branch this PR actually changed in both files was individually cross-checked against the coverage data and is fully hit.src/api/routes.ts's two touched call sites were verified covered viatest/integration/api.test.ts.env.PUBLIC_SITE_ORIGIN ?? GITTENSORY_SITE_URLbranch pair insrc/github/repo-doc-pr.ts:createTestEnv()defaultsPUBLIC_SITE_ORIGINto a truthy value, so a dedicated test explicitlydelete env.PUBLIC_SITE_ORIGINs to exercise the true nullish/fallback side.