Skip to content

Keep download location when central search api times out - #213

Open
bjk7119 wants to merge 5 commits into
mainfrom
error
Open

Keep download location when central search api times out#213
bjk7119 wants to merge 5 commits into
mainfrom
error

Conversation

@bjk7119

@bjk7119 bjk7119 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved Maven JAR discovery across configured repositories, not just Maven Central.
    • Added fallback handling for repositories that reject standard availability checks.
    • Download URLs are now provided only for verified Maven coordinates.
    • Prevented untrusted manifest-derived coordinates from producing download links or triggering repository checks.
    • Improved dependency verification when Central Search is skipped or times out.
    • Updated validation for incomplete or invalid Maven coordinates.

@bjk7119 bjk7119 self-assigned this Aug 6, 2026
@bjk7119 bjk7119 added the bug fix [PR] Fix the bug label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f983235-6d69-4a20-9e82-496ff6d87a45

📥 Commits

Reviewing files that changed from the base of the PR and between 958d10d and 91f0027.

📒 Files selected for processing (2)
  • pyproject.toml
  • src/fosslight_binary/_jar_analysis.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The JAR analysis validates Maven coordinates, tracks trusted coordinates from Central Search and JAR POM data, and resolves trusted artifacts across configured Maven repositories. Manifest-derived coordinates receive no download URL. Repository probes use HEAD with streamed GET fallback.

Changes

Maven URL resolution

Layer / File(s) Summary
Validate Maven coordinates
src/fosslight_binary/_jar_analysis.py
Validates coordinate tokens and rejects Central Search results that lack group, artifact, or version values.
Resolve trusted coordinates across repositories
src/fosslight_binary/_jar_analysis.py
Tracks trusted Central Search and JAR POM coordinates, probes configured repositories with HEAD and streamed GET fallback, and assigns no URL to manifest-derived coordinates.
Update repository-resolution dependency
pyproject.toml
Raises the minimum fosslight_util version to 2.2.8.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 91f00

This is a localized fix intended to preserve the download location when the central search API times out, and no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: dd-jy, soimkim

Sequence Diagram(s)

sequenceDiagram
  participant JARAnalysis
  participant RepositoryResolver
  participant MavenRepository
  JARAnalysis->>RepositoryResolver: resolve configured repository bases
  JARAnalysis->>MavenRepository: probe trusted artifact URL with HEAD
  MavenRepository-->>JARAnalysis: return status
  JARAnalysis->>MavenRepository: stream GET when HEAD returns 403, 405, or 501
  MavenRepository-->>JARAnalysis: return artifact availability
  JARAnalysis-->>JARAnalysis: set download URL or empty URL
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main bug fix: preserving download locations when Maven Central search times out.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch error

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bjk7119
bjk7119 requested a review from dd-jy August 6, 2026 08:26

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/fosslight_binary/_jar_analysis.py`:
- Around line 294-297: Move the _exists_in_central check in the JAR analysis
flow to after the _read_manifest_from_jar manifest fallback populates groupId,
artifactId, and version, or rerun it with those coordinates before the download
URL is generated. Preserve the existing Search API timeout behavior and add a
regression test covering a manifest-only JAR whose coordinates exist in Central.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 01358d8c-c939-45c4-8ca8-f80fcc575992

📥 Commits

Reviewing files that changed from the base of the PR and between ef52b85 and e7a0d4e.

📒 Files selected for processing (1)
  • src/fosslight_binary/_jar_analysis.py

Comment thread src/fosslight_binary/_jar_analysis.py Outdated

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/fosslight_binary/_jar_analysis.py`:
- Line 26: Update _read_manifest_from_jar and the Central existence-check flow
around _COORD_TOKEN so Bundle-Vendor, Implementation-Vendor,
Bundle-SymbolicName, and Implementation-Title are never used as trusted Maven
coordinates. Only enable groupId:artifactId:version matching when coordinates
come from pom.xml or a trusted SHA-1 search, while retaining manifest values
solely as display metadata.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b8970eec-1b0b-4eec-930e-5734ae556c4f

📥 Commits

Reviewing files that changed from the base of the PR and between e7a0d4e and 81edc6d.

📒 Files selected for processing (1)
  • src/fosslight_binary/_jar_analysis.py

Comment thread src/fosslight_binary/_jar_analysis.py

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/fosslight_binary/_jar_analysis.py`:
- Around line 321-323: In the manifest metadata fallback branch near
trusted_coordinates, also reset confirmed_in_central to False when replacing
POM-derived coordinates. Add a regression test covering an incomplete Central
response with token-shaped MANIFEST.MF fields, ensuring the flow does not skip
_exists_in_central or emit an invalid URL.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 967df92a-37e5-408d-a533-a93e86cf5ec2

📥 Commits

Reviewing files that changed from the base of the PR and between 81edc6d and 7f5533e.

📒 Files selected for processing (1)
  • src/fosslight_binary/_jar_analysis.py

Comment thread src/fosslight_binary/_jar_analysis.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix [PR] Fix the bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants