fix(signals): scope earn-footer CTA to registered repos - #628
Conversation
The always-on public-comment earn footer used gittensorRepoEarnUrl() unconditionally, but that helper is documented for repos already registered on Gittensor. For an unregistered repo the CTA linked to a miner page with no data, implying the repo's contributions already earn. Gate the repo-scoped earn URL on repo.isRegistered (via a footerEarnUrl helper) in both buildPublicPrIntelligenceComment and the minimal-invite path, falling back to the general Gittensor home URL otherwise. Closes JSONbored#627
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 2 changed file(s) — two independent AI reviewers. Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
ghost
left a comment
There was a problem hiding this comment.
🔎 Gittensory inline review — 1 line-level note(s). Advisory only; a maintainer merges. See the summary comment for the full review.
JSONbored
left a comment
There was a problem hiding this comment.
@galuis116 this is good to merge.
A few notes:
- The repo-scoped Gittensor CTA is now only used when the repo is actually registered.
- The unregistered path falls back to the general Gittensor URL instead of implying that repo-specific contributions already earn.
- The test covers both full-panel and minimal-invite paths, which is the right surface for this bug.
No code changes requested.
Summary
The always-on public-comment earn footer (added in #620) built its CTA with
gittensorRepoEarnUrl(args.pr.repoFullName)unconditionally. But that helper is documented as scoped to repos already registered on Gittensor — its URL ishttps://gittensor.io/miners/repository?name=...&tab=miners.For a repo that has the App installed and public comments enabled but is not registered (
isRegistered === false), the footer still pointed "register to start earning →" at that repo's miner page — a page with no miner data for an unregistered repo — implying contributions to this repo already earn. The public-comment path (decidePublicSurface) does not gate onisRegistered, andargs.repo(which carries it) was unused.Fix
Introduce a small
footerEarnUrl(repo, repoFullName)helper that returns the repo-scoped miner URL only whenrepo?.isRegistered, and otherwiseundefined— sogittensoryFooterfalls back to its generalGITTENSOR_HOME_URLdefault. Applied in bothbuildPublicPrIntelligenceCommentand thebuildMinimalInviteComment(non-detected) path; the latter now receivesreposo it can make the same decision.Tests
Added a regression test asserting:
/miners/repositorylink and falls back to the home URL,for both the full-panel (detected contributor) and minimal-invite (non-detected) paths. Full coverage suite green locally (only the known CRLF-local
gittensory-focus-manifesttest fails locally; passes in CI).Closes #627