Skip to content

Conversation

@FragmentedPacket
Copy link
Contributor

@FragmentedPacket FragmentedPacket commented Oct 2, 2025

This is related to: opsmill/infrahub#7299

Summary by CodeRabbit

  • Improvements

    • Increased the default timeout from 10s to 60s for checks and transforms, reducing premature timeouts on longer-running operations.
    • Users can still override the timeout as needed.
  • Documentation

    • Clarified default timeout behavior to reflect the new 60s setting.
  • Chores

    • Standardized timeout defaults across related components for consistency.

@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2025

Walkthrough

The pull request updates default timeouts from 10 to 60 in two public classes. In infrahub_sdk/checks.py, the InfrahubCheck.timeout default is changed to 60. In infrahub_sdk/transforms.py, the InfrahubTransform.timeout default is changed to 60. No other functional or structural changes are indicated.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 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 primary change by stating that default timeouts were increased from 10 to 60 for both transform and checks. It's concise, specific to these modules, and accurately reflects the modifications in the changeset.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch may-202509-increase-timeouts

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.

@cloudflare-workers-and-pages
Copy link

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov
Copy link

codecov bot commented Oct 2, 2025

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     
Flag Coverage Δ
integration-tests 34.67% <0.00%> (-0.05%) ⬇️
python-3.10 48.30% <0.00%> (-0.73%) ⬇️
python-3.11 48.30% <0.00%> (-0.72%) ⬇️
python-3.12 48.28% <0.00%> (-0.72%) ⬇️
python-3.13 48.25% <0.00%> (-0.72%) ⬇️
python-3.9 46.90% <0.00%> (-0.83%) ⬇️
python-filler-3.12 24.98% <100.00%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/checks.py 70.19% <100.00%> (ø)
infrahub_sdk/transforms.py 74.28% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1c94694 and 44eeece.

📒 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.py
  • infrahub_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 override timeout, no tests depend on the 10 s default, and the parent InfrahubOperation has no conflicting behavior.

name: str | None = None
query: str = ""
timeout: int = 10
timeout: int = 60
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify timeout usage and confirm test coverage.

The default timeout has been increased from 10 to 60 seconds. Ensure that:

  1. All usages of InfrahubCheck.timeout are compatible with the new default
  2. Existing tests that may depend on the 10-second timeout are updated accordingly
  3. 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.py

Length 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.

@FragmentedPacket FragmentedPacket merged commit 23bedfa into stable Oct 7, 2025
20 checks passed
@FragmentedPacket FragmentedPacket deleted the may-202509-increase-timeouts branch October 7, 2025 13:40
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