Skip to content

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Dec 16, 2025

This parameter has been deprecated for some time and keeps producing warnings in various logs.

Summary by CodeRabbit

  • Breaking Changes
    • Removed the background_execution parameter from branch creation. Use wait_until_completion to control whether the operation blocks until completion or returns immediately.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Walkthrough

The pull request removes the deprecated background_execution parameter from the client branch creation functionality. The wait_until_completion parameter is now the sole control flag for branch creation behavior. The implementation updates mutation selection logic to choose between two query types based on the wait_until_completion value, and simplifies response handling to return either a BranchData object or a task ID accordingly. Associated deprecation warnings and backward-compatibility code have been removed.

Pre-merge checks

❌ 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 directly and clearly describes the main change: removing the deprecated background_execution parameter from client.branch.create().

📜 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 aa0164a and 20d349c.

📒 Files selected for processing (2)
  • changelog/+e2f96e7b.removed.md (1 hunks)
  • infrahub_sdk/branch.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{md,mdx}: Use text language for directory structure code blocks in markdown documentation
Add blank lines before and after lists in markdown documentation
Always specify language in fenced code blocks in markdown documentation

Files:

  • changelog/+e2f96e7b.removed.md
**/*.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:

  • infrahub_sdk/branch.py
infrahub_sdk/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Follow async/sync dual pattern for new features in the Python SDK

Files:

  • infrahub_sdk/branch.py
🧠 Learnings (1)
📚 Learning: 2025-11-25T13:29:23.062Z
Learnt from: wvandeun
Repo: opsmill/infrahub-sdk-python PR: 637
File: infrahub_sdk/ctl/branch.py:290-290
Timestamp: 2025-11-25T13:29:23.062Z
Learning: In infrahub_sdk/ctl/branch.py, the report command uses pc.created_by.updated_at to display "Created at" for proposed changes as a workaround because the SDK doesn't have easy access to the creation time of the proposed change. This will be replaced with proper object-level metadata implementation in version 1.7 of Infrahub.

Applied to files:

  • infrahub_sdk/branch.py
🧬 Code graph analysis (1)
infrahub_sdk/branch.py (2)
infrahub_sdk/graphql/query.py (3)
  • Mutation (46-77)
  • render (34-43)
  • render (54-77)
infrahub_sdk/client.py (2)
  • execute_graphql (907-991)
  • execute_graphql (1823-1908)
⏰ 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 (3)
changelog/+e2f96e7b.removed.md (1)

1-1: LGTM! Clear documentation of the breaking change.

The changelog entry clearly documents the removal of the deprecated parameter.

infrahub_sdk/branch.py (2)

261-284: Consistent sync implementation.

The synchronous version correctly mirrors the async implementation, maintaining the dual async/sync pattern as required by the coding guidelines.


106-129: Type-safe parameter migration with proper overload pattern.

The refactored logic properly implements wait_until_completion as the sole control flag with correct type narrowing via overloads:

  • wait_until_completion: Literal[True] returns BranchData
  • wait_until_completion: Literal[False] returns str

The mutation query selection, response handling, and async/sync dual pattern implementation are all correct. No remaining references to the deprecated background_execution parameter exist in the codebase.


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: 20d349c
Status: ✅  Deploy successful!
Preview URL: https://3fced7e7.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-branch-background-execut.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/branch.py 50.00% 4 Missing ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop     #696      +/-   ##
====================================================
+ Coverage             76.03%   76.09%   +0.06%     
====================================================
  Files                   113      113              
  Lines                  9742     9751       +9     
  Branches               1490     1491       +1     
====================================================
+ Hits                   7407     7420      +13     
+ Misses                 1840     1837       -3     
+ Partials                495      494       -1     
Flag Coverage Δ
integration-tests 34.59% <50.00%> (-0.05%) ⬇️
python-3.10 50.00% <12.50%> (+0.03%) ⬆️
python-3.11 50.00% <12.50%> (+0.03%) ⬆️
python-3.12 49.96% <12.50%> (+0.03%) ⬆️
python-3.13 49.96% <12.50%> (+0.03%) ⬆️
python-3.14 51.64% <12.50%> (+0.03%) ⬆️
python-filler-3.12 23.97% <0.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/branch.py 57.04% <50.00%> (+0.66%) ⬆️
🚀 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 17, 2025 08:36
@ogenstad ogenstad requested a review from a team December 17, 2025 08:36
@ogenstad ogenstad merged commit 31a7720 into infrahub-develop Dec 18, 2025
21 checks passed
@ogenstad ogenstad deleted the pog-branch-background_execution branch December 18, 2025 07:36
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