-
Notifications
You must be signed in to change notification settings - Fork 6
Increase default timeouts for transform/checks from 10 to 60. #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe pull request updates default timeouts from 10 to 60 in two public classes. In infrahub_sdk/checks.py, the Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate 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. Comment |
Deploying infrahub-sdk-python with
|
| Latest commit: |
44eeece
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f865a046.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://may-202509-increase-timeouts.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## stable #563 +/- ##
==========================================
- Coverage 76.03% 75.75% -0.28%
==========================================
Files 101 100 -1
Lines 9642 8896 -746
Branches 2020 1752 -268
==========================================
- Hits 7331 6739 -592
+ Misses 1769 1677 -92
+ Partials 542 480 -62
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
infrahub_sdk/checks.py(1 hunks)infrahub_sdk/transforms.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method
Files:
infrahub_sdk/transforms.pyinfrahub_sdk/checks.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: unit-tests (3.12)
- GitHub Check: unit-tests (3.13)
- GitHub Check: unit-tests (3.10)
- GitHub Check: integration-tests-latest-infrahub
🔇 Additional comments (1)
infrahub_sdk/transforms.py (1)
20-20: Verified default timeout change
No subclasses overridetimeout, no tests depend on the 10 s default, and the parentInfrahubOperationhas no conflicting behavior.
| name: str | None = None | ||
| query: str = "" | ||
| timeout: int = 10 | ||
| timeout: int = 60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify timeout usage and confirm test coverage.
The default timeout has been increased from 10 to 60 seconds. Ensure that:
- All usages of
InfrahubCheck.timeoutare compatible with the new default - Existing tests that may depend on the 10-second timeout are updated accordingly
- No subclasses override this value in a way that would be affected by the change
Run the following script to verify timeout usage and identify potential impacts:
🏁 Script executed:
#!/bin/bash
# Description: Find all references to timeout in checks and related tests
echo "=== Searching for timeout usage in InfrahubCheck subclasses ==="
rg -n --type=py -C3 'class.*\(InfrahubCheck\)'
echo -e "\n=== Searching for explicit timeout assignments ==="
rg -n --type=py -C3 '\.timeout\s*='
echo -e "\n=== Searching for timeout references in tests ==="
rg -n --type=py -C3 'timeout.*=.*10' -g '*test*.py'
echo -e "\n=== Searching for InfrahubCheck instantiations ==="
rg -n --type=py -C3 'InfrahubCheck\('Length of output: 2889
🏁 Script executed:
#!/bin/bash
echo "=== Contents of infrahub_sdk/checks.py ==="
sed -n '1,200p' infrahub_sdk/checks.py
echo -e "\n=== Searching for 'timeout' in checks.py ==="
rg -n 'timeout' -C3 infrahub_sdk/checks.pyLength of output: 5940
Remove or integrate the unused timeout attribute
The timeout field on InfrahubCheck is never used (e.g. not passed to client.query_gql_query), so bumping its default has no effect. Either wire it into the client’s GraphQL calls (and update tests) or remove it.
🤖 Prompt for AI Agents
In infrahub_sdk/checks.py around line 36, the timeout attribute on InfrahubCheck
is defined but never used; either remove the unused timeout field or wire it
through to the GraphQL client calls. To fix: if keeping timeout, add it as a
parameter to the code path that performs GraphQL queries (pass it into
client.query_gql_query or equivalent method, updating that method signature and
all call sites and tests to accept/forward the timeout), or delete the attribute
from the dataclass and remove/update any tests that reference it. Ensure tests
reflect the chosen approach.
This is related to: opsmill/infrahub#7299
Summary by CodeRabbit
Improvements
Documentation
Chores