Repository navigation
Add commons.release for OpenShift payload phase checks - #54
Conversation
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
|
Warning Review limit reached
Next review available in: 55 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the 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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesThe project adds Release controller client
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseControllerClient
participant httpxClient
participant ReleaseControllerAPI
ReleaseControllerClient->>httpxClient: GET nightly release payload URL
httpxClient->>ReleaseControllerAPI: Request payload status
ReleaseControllerAPI-->>httpxClient: JSON payload with phase
httpxClient-->>ReleaseControllerClient: Return response
ReleaseControllerClient-->>ReleaseControllerClient: Extract phase or return None
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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
🧹 Nitpick comments (1)
src/commons/release/tests/test_client.py (1)
50-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the remaining fail-open paths.
This test only covers
httpx.ConnectError. Add tests whereraise_for_status()raiseshttpx.HTTPStatusErrorand wherejson()raisesValueError.ReleaseControllerClient.get_payload_phasehandles both paths, and the PR contract requiresNoneon failure.🤖 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 `@src/commons/release/tests/test_client.py` around lines 50 - 56, Extend test_error_returns_none coverage for ReleaseControllerClient.get_payload_phase by adding cases where raise_for_status() raises httpx.HTTPStatusError and where json() raises ValueError. Mock each failure at the corresponding HTTP response/client stage and assert the method returns None, preserving the existing ConnectError case.
🤖 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/commons/release/__init__.py`:
- Line 8: Update the __all__ declaration to satisfy Ruff rule RUF022 by ordering
RELEASE_CONTROLLER_API before ReleaseControllerClient, without changing the
exported symbols.
In `@src/commons/release/client.py`:
- Line 14: Suppress Pylint’s too-few-public-methods rule for the intentionally
single-method ReleaseControllerClient class, preferably with a class-scoped
disable while preserving the existing get_payload_phase API.
---
Nitpick comments:
In `@src/commons/release/tests/test_client.py`:
- Around line 50-56: Extend test_error_returns_none coverage for
ReleaseControllerClient.get_payload_phase by adding cases where
raise_for_status() raises httpx.HTTPStatusError and where json() raises
ValueError. Mock each failure at the corresponding HTTP response/client stage
and assert the method returns None, preserving the existing ConnectError case.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 94907d2a-3d96-4498-b092-c98091d02112
📒 Files selected for processing (9)
CHANGELOG.mdREADME.mdpyproject.tomlsetup.pysrc/commons/release/README.mdsrc/commons/release/__init__.pysrc/commons/release/client.pysrc/commons/release/tests/__init__.pysrc/commons/release/tests/test_client.py
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
|
/lgtm |
Type of change
Description
Added a shared ReleaseControllerClient to query OpenShift release-controller for a payload’s phase (Accepted / Rejected / Pending), returning None on failure.
Related Tickets & Documents
Testing
Summary by CodeRabbit
New Features
Documentation
Chores