Skip to content

fix(extension): remove stranded matchPullRequestTarget and keep scoped CI coverage (#8023) - #8062

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
milosde111:fix/extension-remove-matchPullRequestTarget-8023
Jul 22, 2026
Merged

fix(extension): remove stranded matchPullRequestTarget and keep scoped CI coverage (#8023)#8062
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
milosde111:fix/extension-remove-matchPullRequestTarget-8023

Conversation

@milosde111

Copy link
Copy Markdown
Contributor

Summary

Closes #8023

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Dead-code removal + test/contract updates. Ran node --check on content.js, git diff --check, and npx vitest run over the three extension suites (after a full workspace install). Extension lint/typecheck: npm run extension:lint / npm run extension:typecheck. apps/** is outside Codecov patch; the only graded touch is a comment on an already-covered OpenAPI path.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — dead-code removal in the content script; overlay behavior is unchanged (still mounts via matchGitHubPageTarget).

Notes

… function and enhance test coverage for backend contract parity (JSONbored#8023)

- Removed the matchPullRequestTarget function from content.js as it was redundant.
- Updated unit tests to ensure that the content script, background script, and auth.js maintain contract parity with the backend API.
- Added checks in tests to verify that the expected endpoints are defined in the OpenAPI specification.
@milosde111
milosde111 requested a review from JSONbored as a code owner July 22, 2026 17:48
@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

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 17:58:45 UTC

5 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR removes the dead `matchPullRequestTarget` duplicate from content.js (a leftover from #7487), moves route coverage onto `matchGitHubPageTarget` directly, and adds three extension↔OpenAPI drift-guard tests plus a comment pinning the hard-coded `/v1/extension/pull-context` path in spec.ts. The removal is verified against the full post-change content.js — the export list, `__loopoverContentInternals`, and both call sites are consistent, and the new test replacements (`pull/146/files`, bare-repo no-match) correctly cover what the removed duplicate previously exercised. The added parity tests genuinely execute `buildOpenApiSpec()` and assert against real hard-coded strings in auth.js/background.js/content.js, so they exercise real paths rather than fabricated states.

Nits — 5 non-blocking
  • nit: the three near-identical '↔ backend contract parity' test blocks (extension-auth.test.ts, extension-background.test.ts, extension-content.test.ts) duplicate the same `buildOpenApiSpec().paths[...]` assertions — consider a small shared helper to avoid triplicated drift-guard logic.
  • nit: src/openapi/spec.ts:1268 comment is helpful but the file itself is very large (~1275 lines); not something to fix in this PR, but worth flagging for a future split into per-domain route modules.
  • nit: test/unit/extension-content.test.ts's `loadContentInternals` type still references only the trimmed internals object — verify no stale `matchPullRequestTarget` references remain in test helper types outside the visible diff (the diff shows removal from one type declaration site).
  • Consider extracting a small `expectExtensionBackendParity(spec, path)` test helper shared across extension-auth/background/content test files to reduce duplication introduced by the three new parity blocks.
  • The `/v1/extension/pull-context` comment in spec.ts:1270-71 is a good addition — consider also linking it from apps/loopover-extension/README (if one exists) so the contract is documented on both sides.

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 #8032, #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 (2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 229 registered-repo PR(s), 156 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor milosde111; Gittensor profile; 229 PR(s), 4 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff removes the stranded matchPullRequestTarget helper and its __loopoverContentInternals export from content.js, matching the issue's exact ask, and updates extension-content.test.ts to retain equivalent route coverage via matchGitHubPageTarget.

Review context
  • Author: milosde111
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 229 PR(s), 4 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 25e2df1 into JSONbored:main Jul 22, 2026
10 checks passed
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.48%. Comparing base (b63fa69) to head (4046834).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8062      +/-   ##
==========================================
+ Coverage   91.81%   99.48%   +7.66%     
==========================================
  Files         731        1     -730     
  Lines       74862      193   -74669     
  Branches    22973        7   -22966     
==========================================
- Hits        68733      192   -68541     
+ Misses       5034        0    -5034     
+ Partials     1095        1    -1094     
Flag Coverage Δ
rees ?
shard-1 99.48% <ø> (+40.43%) ⬆️
shard-2 99.48% <ø> (+50.88%) ⬆️
shard-3 99.48% <ø> (+44.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/openapi/spec.ts 99.48% <ø> (ø)

... and 730 files with indirect coverage changes

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