Skip to content

Promote network error logging to Warning across all HTTP enrichers#196

Merged
dennisdoomen merged 2 commits into
mainfrom
claude/elated-franklin-115069
Jun 11, 2026
Merged

Promote network error logging to Warning across all HTTP enrichers#196
dennisdoomen merged 2 commits into
mainfrom
claude/elated-franklin-115069

Conversation

@dennisdoomen

@dennisdoomen dennisdoomen commented Jun 11, 2026

Copy link
Copy Markdown
Owner

What changed

All HTTP-based enrichers and fetchers now surface network failures at Warning level instead of swallowing them at Debug.

GitHubRepositoryRiskEnricher — HTTP 403 (rate limit exceeded) responses from the GitHub API were previously swallowed into a catch-all Exception handler and logged at Debug level. A dedicated catch (HttpRequestException ex) when (ex.StatusCode == Forbidden) clause now logs these at Warning. Other exceptions (e.g. 404, connectivity errors) remain at Debug to avoid noise.

LicenseUrlRiskEnricher — network failures while validating a package's license URL were logged at Debug; promoted to Warning.

NpmRegistryMetadataFetcher — failures fetching the npm download count were logged at Debug with a string-interpolated message; promoted to Warning and aligned to pass the exception object (consistent with structured logging elsewhere).

The following were already correct and required no changes: OsvRiskEnricher, NpmRegistryMetadataFetcher.FetchMetadataAsync, UrlLicenseFetcher, and GitHubLicenseFetcher (covered by LicenseFetcher.TryFetchLicenseAsync).

Why

Network errors that prevent meaningful package analysis are actionable — they tell the user something is wrong (rate limit hit, unreachable endpoint, bad URL). Surfacing them as Warning makes them visible in normal operation without requiring debug logging to be enabled.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Test Results

  3 files  ±0    3 suites  ±0   4m 14s ⏱️ -13s
168 tests ±0  168 ✅ ±0  0 💤 ±0  0 ❌ ±0 
335 runs  ±0  335 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 08dc4d8. ± Comparison against base commit 8865a14.

♻️ This comment has been updated with latest results.

@coveralls

coveralls commented Jun 11, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27361927000

Coverage decreased (-0.05%) to 77.686%

Details

  • Coverage decreased (-0.05%) from the base build.
  • Patch coverage: 5 uncovered changes across 2 files (2 of 7 lines covered, 28.57%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
Src/PackageGuard.Core/GitHubRepositoryRiskEnricher.cs 4 0 0.0%
Src/PackageGuard.Core/LicenseUrlRiskEnricher.cs 1 0 0.0%
Total (3 files) 7 2 28.57%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 5563
Covered Lines: 4492
Line Coverage: 80.75%
Relevant Branches: 2284
Covered Branches: 1604
Branch Coverage: 70.23%
Branches in Coverage %: Yes
Coverage Strength: 2121.22 hits per line

💛 - Coveralls

…nd NpmRegistryMetadataFetcher

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dennisdoomen dennisdoomen changed the title Log GitHub API 403 rate-limit errors as Warning instead of Debug Promote network error logging to Warning across all HTTP enrichers Jun 11, 2026
@dennisdoomen dennisdoomen added the bug Something isn't working label Jun 11, 2026
@dennisdoomen dennisdoomen merged commit 48a1a88 into main Jun 11, 2026
8 checks passed
@dennisdoomen dennisdoomen deleted the claude/elated-franklin-115069 branch June 11, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants