Skip to content

fix(signals): classify Java gRPC service stubs as generated - #3572

Closed
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:fix/signals-java-grpc-generated
Closed

fix(signals): classify Java gRPC service stubs as generated#3572
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:fix/signals-java-grpc-generated

Conversation

@luciferlive112116

Copy link
Copy Markdown
Contributor

Summary

Extend isGeneratedFile to recognize grpc-java service stubs (*Grpc.java), matching the existing .pb.kt message-stub and *GrpcKt.kt coroutine-stub coverage. Includes direct isGeneratedFile / classifyChangedFile assertions and a hand-authored .java negative case.

Fixes #561

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 an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run typecheck
  • npx vitest run test/unit/path-matchers.test.ts (45/45 pass)
  • npm run test:coverage — changed lines covered by new positive/negative isGeneratedFile and classifyChangedFile cases
  • npm run test:workers — not applicable (signals-only)
  • npm run build:mcp — not applicable
  • npm run test:mcp-pack — not applicable
  • npm run ui:openapi:check — not applicable
  • npm run ui:lint — not applicable
  • npm run ui:typecheck — not applicable
  • npm run ui:build — not applicable
  • npm audit --audit-level=moderate — not applicable
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Signals-only two-file diff; full repo test:coverage runs on CI. Local validation: npm run typecheck + targeted vitest file above.

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 — signals-only change with no visible UI.

Notes

Extend isGeneratedFile to recognize grpc-java *Grpc.java stubs, matching the existing GrpcKt.kt coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-05 17:33:11 UTC

2 files · 1 AI reviewer · 1 blocker · readiness 80/100 · CI pending · blocked

🛑 Suggested Action - Reject/Close

  • Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.

Review summary
Adds a regex to recognize grpc-java's `*Grpc.java` service stubs as generated output, following the exact same suffix-matching convention already used for Swift's `.grpc.swift` and Kotlin's `GrpcKt.kt` stubs. The change is minimal, correctly placed in the existing regex chain, and is accompanied by both a positive case (`gen/GreeterGrpc.java` → generated) and a negative case (`src/Greeter.java` → not generated) in `isGeneratedFile`/`classifyChangedFile`, plus the classification table entry. The comment above the regex block was updated to document the new plugin output, consistent with the file's existing documentation style.

Nits — 3 non-blocking
  • The `/grpc\.java$/` pattern (like the pre-existing `/grpckt\.kt$/`) has no word boundary before "grpc", so a hand-authored file that merely ends in "...Grpc.java" without being protoc-generated would also be misclassified — this is a pre-existing risk class in the file, not new to this PR, so it's worth a shared follow-up rather than blocking this one.
  • The negative test only covers `src/Greeter.java`; a case like `src/MyGrpcHelper.java` (containing "Grpc" but not ending in it) or `src/FooGrpc.txt` would further pin down the boundary, though this is optional given the existing pattern's precedent.
  • Consider a follow-up issue to tighten the gRPC-suffix regexes (Kotlin, Swift, Java) with a preceding word/class-name boundary check if false positives on hand-authored `*Grpc.<ext>` files become a real problem in practice.

Why this is blocked

  • Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #561
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 ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 166 registered-repo PR(s), 87 merged, 21 issue(s).
Contributor context ✅ Confirmed Gittensor contributor luciferlive112116; Gittensor profile; 166 PR(s), 21 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: luciferlive112116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: JavaScript, MDX, Python, Rust, TypeScript
  • Official Gittensor activity: 166 PR(s), 21 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of another open PR). 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.

@loopover-orb loopover-orb Bot closed this Jul 5, 2026
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.11%. Comparing base (63185d4) to head (c58090b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3572   +/-   ##
=======================================
  Coverage   93.11%   93.11%           
=======================================
  Files         305      305           
  Lines       31532    31532           
  Branches    11509    11509           
=======================================
  Hits        29361    29361           
  Misses       1517     1517           
  Partials      654      654           
Files with missing lines Coverage Δ
src/signals/path-matchers.ts 88.46% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

feat(signals): slop signal — generated/vendored/dependency/docs matchers

1 participant