Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat: add DEFAULT_MAX_CONCURRENT_EXECUTION for the batch default - #1574

Open
saltas888 wants to merge 4 commits into
stablefrom
pha/INBOX-171
Open

saltas888 wants to merge 4 commits into
stablefrom
pha/INBOX-171

Conversation

@saltas888

@saltas888 saltas888 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The SDK's default batch concurrency, 5, is now DEFAULT_MAX_CONCURRENT_EXECUTION in infrahub_sdk.constants. InfrahubBatch, InfrahubBatchSync and the max_concurrent_execution field of Config use it as their default instead of three separate literal 5s. The value, the signatures and the INFRAHUB_MAX_CONCURRENT_EXECUTION environment override are unchanged.

Code that receives an optional concurrency value can now pass the constant when the value is None, instead of building the batch in two branches. This was asked for in a review of opsmill/infrahub#10113, where _apply_migration_batch does exactly that. Removing that conditional in Infrahub needs an SDK release with this constant and a python_sdk bump, so it is not part of this PR. The constant is not re-exported from infrahub_sdk/__init__.py, which exports only the client and Config; it sits next to InfrahubClientMode and Priority. infrahubctl dump keeps its own default of 4.

The change adds no tests: review questioned the ones it had, and they compared the defaults with 5, so they would not have caught a literal 5 coming back. Full unit suite: 3,148 passed, 2 skipped, 1 xfailed. invoke format, invoke lint (with Vale 3.7.1) and invoke docs-validate pass. Tracked as INBOX-171.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

saltas888 and others added 3 commits December 2, 2026 10:20
…oncurrency default

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d config default

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saltas888
saltas888 requested a review from a team as a code owner December 2, 2026 10:23
@saltas888 saltas888 added the type/tech-debt Item we know we need to improve way it is implemented label Dec 2, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8f75677
Status: ✅  Deploy successful!
Preview URL: https://ece6c2ce.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pha-inbox-171.infrahub-sdk-python.pages.dev

View logs

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread infrahub_sdk/constants.py Resolved
Comment thread infrahub_sdk/batch.py Resolved
@codecov

codecov Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##           stable    #1574      +/-   ##
==========================================
- Coverage   88.30%   87.88%   -0.42%     
==========================================
  Files         157      157              
  Lines       16310    15662     -648     
  Branches     2410     2114     -296     
==========================================
- Hits        14402    13765     -637     
- Misses       1332     1336       +4     
+ Partials      576      561      -15     
Flag Coverage Δ
integration-tests 42.98% <0.00%> (-0.69%) ⬇️
python-3.10 63.04% <0.00%> (-0.64%) ⬇️
python-3.11 63.03% <0.00%> (-0.65%) ⬇️
python-3.12 63.04% <0.00%> (-0.63%) ⬇️
python-3.13 63.03% <0.00%> (-0.65%) ⬇️
python-3.14 63.03% <0.00%> (-0.65%) ⬇️
python-3.15 63.04% <0.00%> (-0.64%) ⬇️
python-filler-3.12 23.04% <100.00%> (-0.08%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/batch.py 94.44% <100.00%> (+0.07%) ⬆️
infrahub_sdk/config.py 91.86% <100.00%> (ø)
infrahub_sdk/constants.py 94.73% <100.00%> (+0.29%) ⬆️

... and 2 files with indirect coverage changes

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

@ajtmccarty ajtmccarty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure if the unit tests are necessary

Review on #1574 questioned whether they are needed. They compared the
constant with 5 and the defaults with the constant, so they would still
pass if a literal 5 came back at any default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saltas888

Copy link
Copy Markdown
Contributor Author

@ajtmccarty agreed, they are removed in 8f75677. They compared the constant with 5 and the defaults with the constant, so they would not have caught a literal 5 coming back. The PR is now the constant, its three uses and the changelog fragment.

@saltas888

saltas888 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 platform-health-agent · approved; re-running one CI job that failed to start · 2026-12-02 UTC

details
  • Card: INBOX-171. Branch pha/INBOX-171, base stable.
  • History (newest first):
    • 2026-12-02: dependency-lower-bounds-no-harness was cancelled before it ran (runner did not finish downloading uv in 15 minutes); re-ran the failed jobs. Details on INBOX-171.
    • 2026-12-02: approved by ajtmccarty. Removed the new tests per the review (8f75677). Answered cubic's two threads (no top-level re-export; base stable) and resolved them. Unit suite 3,148 passed; lint, Vale and docs-validate pass.
    • 2026-12-02: PR opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/tech-debt Item we know we need to improve way it is implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants