Skip to content

refactor(extension): remove dead matchPullRequestTarget from content.js (#8023) - #8049

Closed
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:fix/remove-dead-match-pr-target-8023
Closed

refactor(extension): remove dead matchPullRequestTarget from content.js (#8023)#8049
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:fix/remove-dead-match-pr-target-8023

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

apps/loopover-extension/content.js's matchPullRequestTarget duplicated matchGitHubPageTarget's logic (minus the kind field) and was stranded by #7487/#7462, which narrowed the content-script match to pull/* only and simplified the route guard. Confirmed via git log -p that it is unreferenced in production — it was surfaced solely through the __loopoverContentInternals test hook.

Changes

  • Delete matchPullRequestTarget from content.js and remove its entry from the __loopoverContentInternals export.
  • Drop the now-orphaned matchPullRequestTarget assertions and its type entry in test/unit/extension-content.test.ts (a backend-suite test that VM-loads content.js). The retained matchGitHubPageTarget assertions still exercise the live routing, confirming the script loads and behaves unchanged.

Scope

  • Narrow, single coherent change (dead-code removal + its orphaned test references)
  • In scope (apps/loopover-extension/**, test/**); no blockedPaths
  • No secrets/private-scoring terms anywhere
  • No generated-artifact changes (the built extension zip is gitignored; extension:build still succeeds)

Validation

  • grep -rn matchPullRequestTarget — no remaining references anywhere in the repo
  • npm run extension:lint / extension:typecheck (node --check) — pass
  • npm run extension:build — succeeds
  • npx vitest run test/unit/extension-content.test.ts — 5/5 pass (the retained matchGitHubPageTarget + render/overlay coverage validates the loaded script)
  • git diff --check clean

Safety

  • Pure dead-code removal — no behavior change (the deleted function had no production caller)
  • matchGitHubPageTarget, renderPullContext, overlay/refresh behavior all untouched and still covered
  • No auth/CORS surface touched; no secrets introduced

Closes #8023

…js (JSONbored#8023)

matchPullRequestTarget duplicated matchGitHubPageTarget's logic minus the
kind field and was left stranded by JSONbored#7487/JSONbored#7462 (which narrowed the
content-script match to pull/* only). It is unreferenced in production --
surfaced solely through the __loopoverContentInternals test hook. Remove
the function and its export entry, and drop the now-orphaned assertions in
extension-content.test.ts; the retained matchGitHubPageTarget coverage
confirms the script still loads and routes unchanged.
@real-venus
real-venus requested a review from JSONbored as a code owner July 22, 2026 15:29
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-22 15:36:23 UTC

2 files · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This is a clean, narrowly-scoped dead-code removal: matchPullRequestTarget duplicated matchGitHubPageTarget's output (minus the kind field) and had no production caller, only being reachable via the test-only __loopoverContentInternals hook. The diff correctly removes the function, its export entry, and the now-orphaned assertions/type declaration in the corresponding test file, and the retained matchGitHubPageTarget tests still exercise the live routing path. The full post-change file content confirms no other reference to matchPullRequestTarget remains.

Nits — 3 non-blocking

CI checks failing

  • validate
  • validate-tests (3)
  • validate-tests (1)
  • validate-tests (2)

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8023
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 106 registered-repo PR(s), 43 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 106 PR(s), 17 issue(s).
Improvement ℹ️ None detected risk: low · value: none
Linked issue satisfaction

Addressed
The diff removes matchPullRequestTarget from content.js and its entry in the __loopoverContentInternals export exactly as required, and also cleans up the now-orphaned test assertions/type references, matching both deliverables.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 106 PR(s), 17 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (3), validate-tests (1), validate-tests (2))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

matchPullRequestTarget is dead code left behind in loopover-extension/content.js by #7487's issue-page match removal

1 participant