fix(adapters): guard null repo entries in gittensor master summary#2048
Open
Dexterity104 wants to merge 1 commit into
Open
fix(adapters): guard null repo entries in gittensor master summary#2048Dexterity104 wants to merge 1 commit into
Dexterity104 wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
master_repositories.jsonaborted the entire adapter snapshot run. The guard insummarizeGittensorMasterconfirmed the response body was an object but never validated the values inside it, so a null entry raised aTypeErrorthat bubbled through thePromise.allinmain()and took down the wholesnapshot-adaptersprocess.What Changed
summarizeGittensorMasternow 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.repoShares) that feeds both the aggregate counts and the top emission ranking, removing the duplicated extraction that previously existed in two places.Registry Safety
Validation
npm run lintnpm run format:checknpm run test:coveragenpm run scan:public-safetygit diff --check