Skip to content

fix(signals): scope earn-footer CTA to registered repos - #628

Merged
JSONbored merged 4 commits into
JSONbored:mainfrom
galuis116:fix/earn-footer-unregistered-repo
Jun 13, 2026
Merged

fix(signals): scope earn-footer CTA to registered repos#628
JSONbored merged 4 commits into
JSONbored:mainfrom
galuis116:fix/earn-footer-unregistered-repo

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

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 is https://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 on isRegistered, and args.repo (which carries it) was unused.

Fix

Introduce a small footerEarnUrl(repo, repoFullName) helper that returns the repo-scoped miner URL only when repo?.isRegistered, and otherwise undefined — so gittensoryFooter falls back to its general GITTENSOR_HOME_URL default. Applied in both buildPublicPrIntelligenceComment and the buildMinimalInviteComment (non-detected) path; the latter now receives repo so it can make the same decision.

Tests

Added a regression test asserting:

  • registered repo -> footer links the repo miner page,
  • unregistered repo -> footer contains no /miners/repository link 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-manifest test fails locally; passes in CI).

Closes #627

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
@ghost

ghost commented Jun 12, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #628 is no longer open. No action.

💰 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.

@ghost ghost added the gittensory:reviewed label Jun 12, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@ghost

ghost commented Jun 12, 2026

Copy link
Copy Markdown

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 · gpt-oss-120b — recommends 🛠️ request changes
The PR scopes the earn‑CTA footer to only show a repo‑specific miner page when the repository is registered, adding a helper function and updating comment generation logic. Tests cover both registered and unregistered scenarios.

Suggestions

  • Search the codebase for all calls to buildMinimalInviteComment and update them to pass the repo argument now required by the new signature.
  • Confirm that gittensoryFooter correctly handles an undefined earnUrl by falling back to the home URL, and add a comment if needed for clarity.
  • Consider adding a unit test for the case where repo is null to ensure the fallback still works.

Worth double-checking

  • TypeScript compilation may fail if any existing call sites to buildMinimalInviteComment are not updated.
  • If gittensoryFooter does not handle undefined properly, the fallback URL could be omitted, breaking the CTA.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR scopes the earn-footer CTA in public PR comments to only point to the repo-specific miner page when the repo is registered on Gittensory, falling back to the general home URL otherwise. This prevents implying earnability for unregistered repos and aligns with the public/private boundary. The change is minimal, well-tested, and includes a comprehensive new test case covering both registered/unregistered scenarios for full-panel and minimal-invite comments.

Suggestions

  • Consider extracting the lengthy test setup (settings, collisions, queueHealth, preflight) into helper functions to improve readability and maintainability.
  • Add a test comment explaining why footerEarnUrl returns undefined for unregistered repos (to rely on gittensoryFooter's fallback).

Worth double-checking

  • Verify that gittensoryFooter correctly handles undefined for earnUrl by falling back to GITTENSOR_HOME_URL (implied by test but not visible in diff).
  • Ensure the change doesn't affect private MCP/API surfaces (no evidence it does, as only public comment builders are modified).

@ghost ghost added the gittensory-review label Jun 12, 2026

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔎 Gittensory inline review — 1 line-level note(s). Advisory only; a maintainer merges. See the summary comment for the full review.

Comment thread src/signals/engine.ts

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@dosubot dosubot Bot added the lgtm label Jun 13, 2026
@JSONbored
JSONbored merged commit 343293b into JSONbored:main Jun 13, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Earn-footer CTA links every PR to the repo's Gittensor miner page — even for repos not registered on Gittensor

2 participants