Skip to content

feat(resolver): add versionmap-git source resolver#1197

Open
jskladan wants to merge 2 commits into
python-wheel-build:mainfrom
jskladan:AIPCC-17610
Open

feat(resolver): add versionmap-git source resolver#1197
jskladan wants to merge 2 commits into
python-wheel-build:mainfrom
jskladan:AIPCC-17610

Conversation

@jskladan

Copy link
Copy Markdown
Contributor

Add VersionMapGitResolver config model for the versionmap-git provider from the new-resolver-config proposal. Maps version numbers to git refs (commit SHAs or ref paths) with a separate clone_url, replacing the need for handwritten Python plugins.

  • Add VersionMapGitResolver pydantic model with clone_url, build_sdist, and versionmap fields
  • Register in SourceResolver discriminated union
  • Add to config reference docs
  • Add tests for config parsing, provider output, and validation

Closes: AIPCC-17610

Add `VersionMapGitResolver` config model for the `versionmap-git`
provider from the new-resolver-config proposal. Maps version numbers
to git refs (commit SHAs or ref paths) with a separate `clone_url`,
replacing the need for handwritten Python plugins.

- Add `VersionMapGitResolver` pydantic model with `clone_url`,
  `build_sdist`, and `versionmap` fields
- Register in `SourceResolver` discriminated union
- Add to config reference docs
- Add tests for config parsing, provider output, and validation

Closes: AIPCC-17610
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Josef Skladanka <jskladan@redhat.com>
@jskladan jskladan requested a review from a team as a code owner June 17, 2026 11:57
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jskladan, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 35 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d24cacb8-4649-4e74-95eb-6b3ac8ebbb0b

📥 Commits

Reviewing files that changed from the base of the PR and between c278a43 and 6a33ca3.

📒 Files selected for processing (2)
  • docs/reference/config-reference.rst
  • src/fromager/packagesettings/_resolver.py
📝 Walkthrough

Walkthrough

A new VersionMapGitResolver class is added to src/fromager/packagesettings/_resolver.py. It accepts a clone_url (validated for scheme and path), a versionmap of version strings to git refs, and an optional build_sdist mode. Its resolver_provider method constructs a {version: git+<clone_url>@<ref>} mapping, wraps it in a VersionMap, and returns a VersionMapProvider with constraints and the requested requirement type. The new class is added to the SourceResolver discriminated union under provider: "versionmap-git", exported from the packagesettings package, and documented in the config reference. Tests cover YAML parsing, provider construction, clone_url validation errors, and constrained/unconstrained version resolution with git-format URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a new versionmap-git source resolver.
Description check ✅ Passed The description comprehensively details the new VersionMapGitResolver, its fields, registration, documentation, and test coverage.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@mergify mergify Bot added the ci label Jun 17, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/reference/config-reference.rst (1)

44-45: ⚡ Quick win

Add a versionadded directive for this new user-facing resolver entry.

Line 44 introduces a new config model in user-facing docs, but there’s no explicit version marker in this section. Please add .. versionadded:: next to this entry for release traceability.

Suggested patch
 .. autopydantic_model:: VersionMapGitResolver
+
+   .. versionadded:: 0.79.0

As per coding guidelines: "Use Sphinx versionadded, versionremoved, versionchanged directives for user-facing changes".

🤖 Prompt for 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.

In `@docs/reference/config-reference.rst` around lines 44 - 45, The
VersionMapGitResolver autopydantic_model directive in the config reference
documentation is missing a versionadded directive to track when this new
user-facing resolver was introduced. Add a `.. versionadded::` directive before
the `.. autopydantic_model:: VersionMapGitResolver` line, specifying the
appropriate version number where this resolver was first available, to comply
with the documentation guidelines for user-facing changes.

Source: Coding guidelines

🤖 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/fromager/packagesettings/_resolver.py`:
- Around line 517-522: The validate_clone_url method in the Resolver class
currently accepts URLs with only a host and no repository path because Pydantic
v2 normalizes the path to "/" which is truthy. Add an additional validation
check after the existing path validation to explicitly reject URLs where the
path is only "/" or is root-only. This will prevent invalid git URLs that lack
an actual repository path from passing validation.

---

Nitpick comments:
In `@docs/reference/config-reference.rst`:
- Around line 44-45: The VersionMapGitResolver autopydantic_model directive in
the config reference documentation is missing a versionadded directive to track
when this new user-facing resolver was introduced. Add a `.. versionadded::`
directive before the `.. autopydantic_model:: VersionMapGitResolver` line,
specifying the appropriate version number where this resolver was first
available, to comply with the documentation guidelines for user-facing changes.
🪄 Autofix (Beta)

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

Run ID: 48b234c8-c0ab-46c3-a2e3-b4b237852236

📥 Commits

Reviewing files that changed from the base of the PR and between 1d2876b and f4d72f1.

📒 Files selected for processing (5)
  • docs/reference/config-reference.rst
  • src/fromager/packagesettings/__init__.py
  • src/fromager/packagesettings/_resolver.py
  • tests/test_packagesettings_resolver.py
  • tests/test_resolver.py

Comment thread src/fromager/packagesettings/_resolver.py
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Josef Skladanka <jskladan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant