Skip to content

fix(integrations): reject blank project IDs before GitHub calls - #3419

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jony376:fix/integrations-reject-blank-project-id
Jul 5, 2026
Merged

fix(integrations): reject blank project IDs before GitHub calls#3419
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jony376:fix/integrations-reject-blank-project-id

Conversation

@jony376

@jony376 jony376 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

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 actionlint — no workflow changes
  • 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 — no worker/runtime changes
  • npm run build:mcp — no MCP changes
  • npm run test:mcp-pack — no MCP changes
  • npm run ui:openapi:check — no UI/API changes
  • npm run ui:lint — no UI changes
  • npm run ui:typecheck — no UI changes
  • npm run ui:build — no UI changes
  • 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:

  • Skipped UI/MCP/worker/actionlint checks: integrations-only bug fix with no surface-area changes outside src/integrations and its unit tests.

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 — no UI changes.

Notes

  • Touches src/integrations/** only (not a guarded path); intended for auto-merge eligibility once gates pass.

Made with Cursor

GitHubProjectsAdapter.attachToProject and resolveProjectV2Fields now
return early when projectId is empty or whitespace-only, avoiding wasted
installation-token round-trips and GraphQL errors on malformed input.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jony376
jony376 requested a review from JSONbored as a code owner July 5, 2026 06:39
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 5, 2026
@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

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 06:44:00 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
The change adds early blank-project-ID guards in both GitHub Projects v2 entry points and covers the no-GitHub-call behavior with unit tests. The guard is on the real hot path before installation-token minting and GraphQL/REST calls, so it directly addresses the wasted round-trip/error case described in the PR. I do not see a reachable correctness regression in the provided changed file.

Nits — 5 non-blocking
  • nit: src/integrations/project-tracker-adapter.ts:166 and src/integrations/project-tracker-adapter.ts:227 duplicate the same blank-ID predicate; a tiny local helper would keep future project-ID handling consistent across resolve and attach paths.
  • nit: src/integrations/project-tracker-adapter.ts:166 only rejects all-whitespace IDs but still sends IDs with leading/trailing whitespace unchanged, so confirm upstream intentionally treats `" PVT_1 "` as invalid rather than normalizing it before the GitHub call.
  • Consider adding a local `isBlankProjectId(projectId: string): boolean` helper in src/integrations/project-tracker-adapter.ts and using it from both `resolveProjectV2Fields` and `GitHubProjectsAdapter.attachToProject`.
  • If config/fuzzy wiring can produce IDs with surrounding whitespace, trim once at the boundary or explicitly add a test documenting that only fully blank IDs are rejected here.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
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 (no linked issue context).
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: 1013 registered-repo PR(s), 707 merged, 41 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 1013 PR(s), 41 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jony376
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 1013 PR(s), 41 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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

@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.46%. Comparing base (b807dc6) to head (c28fc3f).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3419   +/-   ##
=======================================
  Coverage   93.46%   93.46%           
=======================================
  Files         289      289           
  Lines       30788    30790    +2     
  Branches    11221    11223    +2     
=======================================
+ Hits        28777    28779    +2     
  Misses       1355     1355           
  Partials      656      656           
Files with missing lines Coverage Δ
src/integrations/project-tracker-adapter.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

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

@loopover-orb
loopover-orb Bot merged commit faf66ea into JSONbored:main Jul 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant