Skip to content

Add commons.release for OpenShift payload phase checks - #54

Merged
vishnuchalla merged 4 commits into
cloud-bulldozer:mainfrom
Balatripura587:jira_ack
Aug 12, 2026
Merged

vishnuchalla merged 4 commits into
cloud-bulldozer:mainfrom
Balatripura587:jira_ack

Conversation

@Balatripura587

@Balatripura587 Balatripura587 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization
  • Documentation Update

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

  • Added tests
  • Tested manually: Queried latest nightly from release-controller and called get_payload_phase via a script

Summary by CodeRabbit

  • New Features

    • Added support for querying the payload phase of nightly releases.
    • Exposed a release controller client with configurable endpoint and timeout settings.
    • Invalid responses and request failures are handled gracefully.
  • Documentation

    • Added usage examples and API details for release payload-phase queries.
    • Updated the changelog with the 0.6.0 release information.
  • Chores

    • Bumped the package version to 0.6.0.
    • Updated package metadata to include release-controller support.

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

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Balatripura587, you've reached your PR review limit, so we couldn't start this review.

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 @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 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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 144b515c-dc2f-488f-a281-41bd1d1046e7

📥 Commits

Reviewing files that changed from the base of the PR and between 7bbb391 and 014e7cd.

📒 Files selected for processing (2)
  • src/commons/release/__init__.py
  • src/commons/release/client.py
📝 Walkthrough

Walkthrough

Changes

The project adds commons.release with a ReleaseControllerClient that queries nightly release payload phases. It exports the client and API constant, adds tests, updates package metadata to version 0.6.0, and documents the API.

Release controller client

Layer / File(s) Summary
Release controller client API
src/commons/release/__init__.py, src/commons/release/client.py
The client builds nightly release URLs, queries payload status, extracts the phase field, and returns None for handled errors.
Client behavior validation
src/commons/release/tests/test_client.py
Tests cover URL construction, parsing, successful retrieval, connection errors, and asyncio.to_thread usage.
Release and package documentation
CHANGELOG.md, README.md, src/commons/release/README.md, pyproject.toml, setup.py
Documentation describes payload phase queries. Package metadata updates the version to 0.6.0 and adds the release-controller keyword.

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
Loading

Suggested reviewers: jtaleric

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding commons.release to check OpenShift payload phases.
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 unit tests (beta)
  • Create PR with unit tests

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.

@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: 2

🧹 Nitpick comments (1)
src/commons/release/tests/test_client.py (1)

50-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the remaining fail-open paths.

This test only covers httpx.ConnectError. Add tests where raise_for_status() raises httpx.HTTPStatusError and where json() raises ValueError. ReleaseControllerClient.get_payload_phase handles both paths, and the PR contract requires None on 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

📥 Commits

Reviewing files that changed from the base of the PR and between 10f3f04 and 7bbb391.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • README.md
  • pyproject.toml
  • setup.py
  • src/commons/release/README.md
  • src/commons/release/__init__.py
  • src/commons/release/client.py
  • src/commons/release/tests/__init__.py
  • src/commons/release/tests/test_client.py

Comment thread src/commons/release/__init__.py Outdated
Comment thread src/commons/release/client.py Outdated
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
@vishnuchalla

Copy link
Copy Markdown
Collaborator

/lgtm

@vishnuchalla
vishnuchalla merged commit 0cfd0d6 into cloud-bulldozer:main Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants