feat(resolver): exempt top-level == pins from release cooldown#1124
feat(resolver): exempt top-level == pins from release cooldown#1124LalatenduMohanty wants to merge 1 commit intopython-wheel-build:mainfrom
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe resolver now considers requirement type when computing per-package release-age cooldowns. A new helper detects pure top-level exact Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/resolver.py`:
- Around line 140-142: The helper _has_equality_pin currently treats any "=="
specifier as an exact pin; update it to only return True for true exact pins by
checking both spec.operator == "==" and that the spec's version contains no
wildcard characters (e.g., no '*' or patterns like '1.*'). In other words,
inside _has_equality_pin (working with the Requirement and its specifier
members), ensure you inspect spec.version (or str(spec)) and exclude specifiers
where '*' appears (or the version ends with '.*') so wildcard pins like "==1.*"
do not count as exact equality pins.
In `@tests/test_cooldown.py`:
- Around line 866-907: Add a new test that exercises the boundary case where a
top-level wildcard equality like Requirement("test-pkg==1.*") should NOT be
treated as an exact-pin exemption: call resolver.resolve_package_cooldown with
ctx from _make_ctx(tmp_path, cooldown=_COOLDOWN),
req_type=RequirementType.TOP_LEVEL and Requirement("test-pkg==1.*"), and assert
the returned value equals _COOLDOWN; place the test alongside the other
test_resolve_package_cooldown_* functions and name it something like
test_resolve_package_cooldown_toplevel_wildcard_equality_not_exempt to mirror
existing naming.
🪄 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: 44fe1182-608d-4129-aaa2-29b43592632d
📒 Files selected for processing (6)
docs/how-tos/release-age-cooldown.rstdocs/proposals/release-cooldown.mdsrc/fromager/resolver.pysrc/fromager/sources.pysrc/fromager/wheels.pytests/test_cooldown.py
4294f40 to
0d0fa24
Compare
There was a problem hiding this comment.
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 `@docs/how-tos/release-age-cooldown.rst`:
- Around line 137-142: The wording currently states that top-level requirements
using "==" bypass cooldown but is too broad; change the text in the
release-age-cooldown docs to clarify this applies only to a single exact pin
(e.g., "package==1.2.3") and not to prefix/partial or compound specifiers like
"==1.*" or combined specifiers; update the sentences referencing "Top-level
requirements that use ``==``" and "``==`` specifiers in transitive dependencies"
to explicitly say "a single exact ``==`` pin (single version literal)" and add a
short example contrasting allowed exact pins (e.g., package==1.2.3) versus
non-exempt patterns (e.g., package==1.* or package==1.2.3,>=1.0).
🪄 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: 86d20d90-a812-49c5-9dfb-99d16cc4e7a8
📒 Files selected for processing (6)
docs/how-tos/release-age-cooldown.rstdocs/proposals/release-cooldown.mdsrc/fromager/resolver.pysrc/fromager/sources.pysrc/fromager/wheels.pytests/test_cooldown.py
✅ Files skipped from review due to trivial changes (1)
- docs/proposals/release-cooldown.md
🚧 Files skipped from review as they are similar to previous changes (1)
- src/fromager/resolver.py
Closes: python-wheel-build#1123 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
0d0fa24 to
8601726
Compare
| automatically. Wildcard (`==1.*`) and compound specifiers are not exempt. | ||
| Transitive `==` pins remain subject to cooldown for security. See | ||
| [the how-to guide](../how-tos/release-age-cooldown.rst) for details. | ||
| Tracked in [#1123](https://github.com/python-wheel-build/fromager/issues/1123). |
There was a problem hiding this comment.
Not sure if we need to link this in proposal
|
LGTM! |
Summary
==version pins now bypass release cooldown enforcement — the operator has explicitly chosen that version==pins remain subject to cooldown to prevent malicious packages from bypassing the check via pinned dependenciesreq_typestill get full cooldown enforcementCloses #1123