Skip to content

fix(adapters): guard null repo entries in gittensor master summary#2048

Open
Dexterity104 wants to merge 1 commit into
JSONbored:mainfrom
Dexterity104:fix/gittensor-null-repo-guard
Open

fix(adapters): guard null repo entries in gittensor master summary#2048
Dexterity104 wants to merge 1 commit into
JSONbored:mainfrom
Dexterity104:fix/gittensor-null-repo-guard

Conversation

@Dexterity104

Copy link
Copy Markdown
Contributor

Summary

  • A JSON null value for any repository key in the upstream master_repositories.json aborted the entire adapter snapshot run. The guard in summarizeGittensorMaster confirmed the response body was an object but never validated the values inside it, so a null entry raised a TypeError that bubbled through the Promise.all in main() and took down the whole snapshot-adapters process.
  • The live upstream (entrius/gittensor) is currently clean, so this was latent, but a single null placeholder added upstream was enough to break every snapshot until then.

What Changed

  • summarizeGittensorMaster now reads each numeric share through optional chaining, so a null repository value resolves to zero shares instead of throwing. This matches the defensive ?. style already used throughout the file.
  • The emission, maintainer, and issue discovery reads were folded into one pass (repoShares) that feeds both the aggregate counts and the top emission ranking, removing the duplicated extraction that previously existed in two places.
  • Output stays byte for byte identical on clean payloads, so committed snapshots do not drift.
  • Added unit tests for the function covering the failed body guard, normal aggregation and ranking, and the null repository value regression. Line and branch coverage of the changed code is complete.

Registry Safety

  • No secrets, PATs, wallet data, private dashboards, private URLs, or validator-local state.
  • Generated artifacts were produced by repo scripts, not hand-edited.
  • R2-only/high-churn detail artifacts are not committed.
  • Public API/OpenAPI/schema changes are intentional and documented.

Validation

  • npm run lint
  • npm run format:check
  • npm run test:coverage
  • npm run scan:public-safety
  • git diff --check

@Dexterity104 Dexterity104 requested a review from JSONbored as a code owner June 26, 2026 23:12
@superagent-security

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.23%. Comparing base (c4880b9) to head (c08844e).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2048      +/-   ##
==========================================
+ Coverage   93.12%   93.23%   +0.11%     
==========================================
  Files          47       48       +1     
  Lines        7591     7626      +35     
  Branches     2798     2804       +6     
==========================================
+ Hits         7069     7110      +41     
+ Misses         91       90       -1     
+ Partials      431      426       -5     

see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb

gittensory-orb Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review — held for maintainer review

2 files · 1 AI reviewers · no blockers · readiness 68/100 · CI green · blocked

⏸️ Held for maintainer review

Signal Result Evidence
Code review ✅ No blockers 1 reviewers, synthesized
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.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels.
Validation evidence ❌ 5/25 Cached preflight status is hold.
Open PR queue ⚠️ 5/10 13 open PR(s), 7 likely reviewable, 6 unlinked.
Contributor context ✅ Confirmed Gittensor contributor Dexterity104; Gittensor profile; 91 PR(s), 12 issue(s).
Gate result ✅ Passing No configured blocker found.
Nits — 2 non-blocking
  • Repository config was not parsed
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Review context
  • Author: Dexterity104
  • 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: 91 PR(s), 12 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Fix blocker.
  • Expect slower review.
  • 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.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR 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

@gittensory-orb gittensory-orb Bot added gittensor Gittensor contributor context gittensor:bug Bug labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Bug gittensor Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant