feat(tools): NuGet enrichment in get_dependency_blast_radius - #105
Open
manus-use wants to merge 1 commit into
Open
feat(tools): NuGet enrichment in get_dependency_blast_radius#105manus-use wants to merge 1 commit into
manus-use wants to merge 1 commit into
Conversation
Add _enrich_nuget(name) + _extract_nuget_first_release(pages) helpers to get_dependency_blast_radius.py, completing five-ecosystem coverage: npm ✓ PyPI ✓ Maven ✓ crates.io (PR #103) ✓ RubyGems (PR #104) ✓ NuGet ✓ Two-call enrichment pattern (consistent with the other enrichers): 1. NuGet Search API (azuresearch-usnc.nuget.org/query) → total_downloads, latest_version, description (truncated to 120 chars), home_page (projectUrl) 2. NuGet Registration API (api.nuget.org/v3/registration5/{name}/index.json) → version history, first_release_date (ISO 8601 → YYYY-MM-DD), age_years, total_versions; each call isolated so failure does not prevent the other from returning data. _blast_score updated: when weekly_downloads is absent, proxy weekly from total_downloads / max(age_years * 52, 1) — same approach as the crates.io and RubyGems enrichers in open PRs #103 / #104. Ecosystem dispatch: "nuget" / ".net" / "dotnet" / "csharp" / "c#" NuGet output block added to main tool report section. Docstring updated (data sources list + per-ecosystem metric docs). 34 new tests in tests/test_nuget_enrichment.py covering: - _extract_nuget_first_release: all ISO-8601 variants (Z suffix, +HH:MM offset, no TZ, sub-second fraction, 7-digit fraction), multi-page aggregation, malformed date skipping, empty pages, version count, age_years - _enrich_nuget: happy path, case-insensitive ID match, description truncation, graceful degradation for search error, registration error, both errors, non-matching search result, version count - _enrich_package dispatch: all five NuGet ecosystem aliases - _blast_score: total_downloads proxy, precedence of weekly_downloads, zero age_years guard (no ZeroDivisionError) 1192 tests pass, 0 failures.
This was referenced Jul 8, 2026
This was referenced Jul 11, 2026
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
Adds
.NET / NuGetenrichment toget_dependency_blast_radius, completing six-ecosystem coverage for the blast-radius tool:_enrich_npm_enrich_pypi_enrich_maven_enrich_crates_enrich_rubygems_enrich_nugetWhat changed
src/manus_agent/tools/get_dependency_blast_radius.pyNew helpers:
_extract_nuget_first_release(pages)— walks NuGet registration pages to find the earliestpublisheddate and count total versions; handles all ISO-8601 variants (Z suffix,+HH:MMoffset, no-TZ naive, sub-second fractions including 7-digit .NET ticks); isolated per-itemtry/exceptso one malformed date doesn't abort the scan._enrich_nuget(name)— two-call enrichment, consistent with the other enrichers:azuresearch-usnc.nuget.org/query?q={name}&prerelease=false) →total_downloads,latest_version,description(truncated to 120 chars),home_pageapi.nuget.org/v3/registration5/{name}/index.json) →total_versions,first_release_date,age_yearsBoth calls are individually guarded; failure of either does not prevent the other from returning data.
Updated:
_enrich_packagedispatch — routes"nuget"/".net"/"dotnet"/"csharp"/"c#"to_enrich_nuget._blast_score— whenweekly_downloadsis absent, proxies fromtotal_downloads / max(age_years * 52, 1). NuGet's search API returns all-time totals rather than per-week stats; the same fallback strategy is used by the crates.io and RubyGems enrichers in PRs feat: add crates.io enrichment to get_dependency_blast_radius #103/feat(tools): RubyGems enrichment in get_dependency_blast_radius #104.tests/test_nuget_enrichment.py(new, 34 tests)TestExtractNugetFirstReleaseage_years,total_versionsTestEnrichNugetTestEnrichPackageNuGetDispatch_enrich_nugetTestBlastScoreNuGetFallbacktotal_downloadsproxy,weekly_downloadsprecedence, zero-age guardSuite result: 1192 passed, 0 failures (was 1158 before this PR).
No real HTTP calls
All 34 tests use
unittest.mock.patchonrequests.get. Zero network I/O.Existing open PRs checked (no overlap)
Confirmed no duplication against: #51, #53, #54, #58, #60, #64, #65, #67, #74, #75, #76, #77, #78, #79, #80, #82, #83, #85, #86, #87, #88, #89, #90, #96, #97, #98, #100, #103, #104
None of the open PRs implement NuGet enrichment or touch
_enrich_nuget.