Skip to content

fix: return bool instead of tuple in HTTPRoute _ready#981

Merged
averevki merged 1 commit into
Kuadrant:mainfrom
Priyanshu-u07:fix-route-ready-tuple
May 15, 2026
Merged

fix: return bool instead of tuple in HTTPRoute _ready#981
averevki merged 1 commit into
Kuadrant:mainfrom
Priyanshu-u07:fix-route-ready-tuple

Conversation

@Priyanshu-u07
Copy link
Copy Markdown
Contributor

@Priyanshu-u07 Priyanshu-u07 commented May 15, 2026

Description

While working on #980 , I found a bug in route.py. The _ready function in HTTPRoute.wait_for_ready() returns a tuple instead of a bool due to a trailing comma.

Changes

Removed the trailing comma and outer parentheses so _ready returns a plain bool.

Verification

No behavioral change for the happy path. Fixes the edge case where False conditions were incorrectly treated as ready.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected route readiness validation to accurately reflect controller status conditions.

Review Change Stack

Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

HTTPRoute.wait_for_ready readiness predicate now returns a plain boolean from the all(...) expression instead of wrapping it in a single-element tuple, correcting the return value to properly evaluate controller condition statuses.

Changes

Readiness Predicate Return Type

Layer / File(s) Summary
Readiness predicate return value
testsuite/gateway/gateway_api/route.py
The _ready predicate inside HTTPRoute.wait_for_ready returns a boolean directly from all(...) rather than wrapping it in a tuple, fixing the truthiness evaluation of controller condition statuses.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A tuple wrapped a truth so plain,
One element caused a logic pain,
Now boolean flows both clear and bright,
The readiness check shines just right! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
Title check ✅ Passed The title accurately reflects the main change: fixing a bug where HTTPRoute._ready returns a boolean instead of a tuple.
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.
Description check ✅ Passed The PR description follows the required template with all three main sections (Description, Changes, Verification) completed and clearly explains the bug fix.

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

✨ Finishing Touches
🧪 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 and usage tips.

Copy link
Copy Markdown
Contributor

@emmaaroche emmaaroche left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for contribution!

Since this changes shared infrastructure (testsuite/gateway/), please wait for a second review before merging per our team guidelines for core code changes.

@averevki averevki merged commit b70abe2 into Kuadrant:main May 15, 2026
7 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.

3 participants