Skip to content

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Dec 19, 2025

Summary by CodeRabbit

Release Notes

  • Tests
    • Updated test fixtures and configuration to improve code quality and type checking enforcement.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Walkthrough

This pull request modifies type checking configuration and test fixtures. In pyproject.toml, the invalid-return-type ignore rule for TypeCheck is removed from test-specific overrides, applying stricter type validation to test code. Additionally, two test fixtures are updated to explicitly return their httpx_mock objects at the end: mock_branch_report_default_branch in test_branch_report.py and mock_rest_api_artifact_generate in conftest.py. These changes clarify the return semantics of the fixtures without altering their setup or behavior.

Pre-merge checks

❌ 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%. 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 'Fix invalid return types' directly corresponds to the main change: removing the ignore rule for invalid-return-type in pyproject.toml and adding explicit return statements to fixtures.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fde1504 and ea109ee.

📒 Files selected for processing (3)
  • pyproject.toml (0 hunks)
  • tests/unit/ctl/test_branch_report.py (1 hunks)
  • tests/unit/sdk/conftest.py (1 hunks)
💤 Files with no reviewable changes (1)
  • pyproject.toml
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification

Files:

  • tests/unit/ctl/test_branch_report.py
  • tests/unit/sdk/conftest.py
tests/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

tests/**/*.py: Use httpx_mock fixture for HTTP mocking in tests instead of making real HTTP requests
Do not add @pytest.mark.asyncio decorator to async test functions (async auto-mode is globally enabled)

Files:

  • tests/unit/ctl/test_branch_report.py
  • tests/unit/sdk/conftest.py
tests/unit/**/*.py

📄 CodeRabbit inference engine (tests/AGENTS.md)

Unit tests must be fast, mocked, and have no external dependencies

Files:

  • tests/unit/ctl/test_branch_report.py
  • tests/unit/sdk/conftest.py
🧠 Learnings (1)
📚 Learning: 2025-12-10T17:13:37.990Z
Learnt from: CR
Repo: opsmill/infrahub-sdk-python PR: 0
File: tests/AGENTS.md:0-0
Timestamp: 2025-12-10T17:13:37.990Z
Learning: Applies to tests/**/*.py : Use `httpx_mock` fixture for HTTP mocking in tests instead of making real HTTP requests

Applied to files:

  • tests/unit/ctl/test_branch_report.py
  • tests/unit/sdk/conftest.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). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
tests/unit/sdk/conftest.py (1)

2124-2124: LGTM! Type annotation now matches actual return value.

The explicit return statement correctly aligns with the fixture's -> HTTPXMock type annotation, fixing the invalid return type.

tests/unit/ctl/test_branch_report.py (1)

129-129: LGTM! Type annotation now matches actual return value.

The explicit return statement correctly aligns with the fixture's -> HTTPXMock type annotation, fixing the invalid return type.


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: ea109ee
Status: ✅  Deploy successful!
Preview URL: https://9e06e87f.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-invalid-return-types.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                Coverage Diff                @@
##           infrahub-develop     #705   +/-   ##
=================================================
  Coverage             76.28%   76.28%           
=================================================
  Files                   114      114           
  Lines                  9830     9830           
  Branches               1508     1508           
=================================================
  Hits                   7499     7499           
  Misses                 1837     1837           
  Partials                494      494           
Flag Coverage Δ
integration-tests 34.42% <ø> (ø)
python-3.10 50.17% <ø> (+0.02%) ⬆️
python-3.11 50.17% <ø> (+0.02%) ⬆️
python-3.12 50.13% <ø> (-0.03%) ⬇️
python-3.13 50.13% <ø> (-0.03%) ⬇️
python-3.14 51.80% <ø> (ø)
python-filler-3.12 24.01% <ø> (ø)

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

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

@ogenstad ogenstad marked this pull request as ready for review December 19, 2025 21:21
@ogenstad ogenstad requested a review from a team December 22, 2025 07:48
@ogenstad ogenstad merged commit bdc4ca9 into infrahub-develop Dec 22, 2025
21 checks passed
@ogenstad ogenstad deleted the pog-invalid-return-types branch December 22, 2025 15:03
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