Skip to content

fix(rules): align isCodePath with isCodeFile module/JVM extensions - #9386

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
philluiz2323:fix/iscodepath-extension-parity-9322
Jul 27, 2026
Merged

fix(rules): align isCodePath with isCodeFile module/JVM extensions#9386
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
philluiz2323:fix/iscodepath-extension-parity-9322

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Summary

isCodePath in src/rules/advisory.ts lagged SOURCE_FILE_EXTENSION / isCodeFile for seven extensions (.mts, .cts, .mjs, .cjs, .kts, .scala, .groovy). annotatablePullRequestFiles gates on isCodePath before Missing test evidence annotations can land, so PRs whose only changed files use those extensions got zero inline annotations — the fourth instance of this same parity-drift class (Vue/Svelte/Astro, C++/hpp, Dart already fixed).

Adds the seven extensions to isCodePath (additive only) and a regression covering each path via buildCheckRunAnnotations.

Test plan

  • test/unit/rules.test.ts: new #9322 parity test asserts Missing test evidence annotations for all seven extensions
  • Adjacent Vue/Svelte/Astro + Dart parity tests still pass
  • Targeted vitest run green

Closes #9322

isCodePath lagged SOURCE_FILE_EXTENSION/isCodeFile for .mts/.cts/.mjs/.cjs/.kts/.scala/.groovy,
so annotatablePullRequestFiles dropped those paths before Missing test evidence annotations
could land. Add the seven extensions and a parity regression covering each.

Closes JSONbored#9322
@philluiz2323
philluiz2323 requested a review from JSONbored as a code owner July 27, 2026 15:30
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.52%. Comparing base (83b6867) to head (da27e47).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9386       +/-   ##
===========================================
- Coverage   89.46%   75.52%   -13.95%     
===========================================
  Files         836      276      -560     
  Lines      109588    58391    -51197     
  Branches    26096     6341    -19755     
===========================================
- Hits        98046    44100    -53946     
- Misses      10279    14014     +3735     
+ Partials     1263      277      -986     
Flag Coverage Δ
backend 98.09% <100.00%> (+2.87%) ⬆️

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

Files with missing lines Coverage Δ
src/rules/advisory.ts 98.09% <100.00%> (ø)

... and 698 files with indirect coverage changes

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

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 15:43:52 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a small, well-targeted regex parity fix: isCodePath was missing seven extensions (.mts/.cts/.mjs/.cjs/.kts/.scala/.groovy) that isCodeFile already recognizes via SOURCE_FILE_EXTENSION, causing annotatablePullRequestFiles to silently drop PRs using only these extensions from Missing test evidence annotations. The fix is purely additive to the existing regex, low-risk, and closes issue #9322. The added test correctly exercises the real annotation-building path (buildCheckRunAnnotations) with all seven extensions rather than fabricating an unreachable scenario, which is exactly the right kind of regression coverage.

Nits — 3 non-blocking
  • nit: the new test in test/unit/rules.test.ts checks all seven extensions in a single test body with a loop — consider whether per-extension assertions would make a future regression easier to isolate, though this is a minor readability preference.
  • nit: the regex in src/rules/advisory.ts:554 is getting long and could be refactored into a Set-based extension check for readability, though this is purely stylistic and matches the existing pattern.
  • Consider verifying the parity between isCodePath and isCodeFile's SOURCE_FILE_EXTENSION is enforced by a shared constant or a lint/test check, since this is now the fourth instance of the same drift class (Vue/Svelte/Astro, C++/hpp, Dart, now these seven) — a structural fix (e.g. derive isCodePath's extensions from SOURCE_FILE_EXTENSION directly) would prevent a fifth recurrence.

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 #9322
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: 986 registered-repo PR(s), 563 merged, 125 issue(s).
Contributor context ✅ Confirmed Gittensor contributor philluiz2323; Gittensor profile; 986 PR(s), 125 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff adds all seven missing extensions (.mts/.cts/.mjs/.cjs/.kts/.scala/.groovy) additively to isCodePath's regex, matching the requirement exactly, and includes a new regression test covering each extension via buildCheckRunAnnotations asserting Missing test evidence annotations, mirroring the existing parity test style.

Review context
  • Author: philluiz2323
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, MDX, TypeScript, CSS, Cuda, HTML, Kotlin
  • Official Gittensor activity: 986 PR(s), 125 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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; 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.

🟩 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 995cd78 into JSONbored:main Jul 27, 2026
10 checks passed
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.

fix(rules): advisory.ts's isCodePath is missing .mts/.cts/.mjs/.cjs/.kts/.scala/.groovy that isCodeFile recognizes

1 participant