Skip to content

feat: add the WORKER_TIMEOUT error code to the generated catalogue - #1405

Merged
ogenstad merged 2 commits into
infrahub-developfrom
pog-worker-timeout-error-binding-ifc-3148
Oct 9, 2026
Merged

ogenstad merged 2 commits into
infrahub-developfrom
pog-worker-timeout-error-binding-ifc-3148

Conversation

@ogenstad

@ogenstad ogenstad commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

The Infrahub server now returns a WORKER_TIMEOUT error code when a call to a worker runs past its timeout (opsmill/infrahub#10668, part of opsmill/infrahub#10530). The SDK's generated error catalogue does not have this code yet, so the Infrahub backend-validate-generated CI job fails on opsmill/infrahub#10530 with python_sdk/infrahub_sdk/exceptions/catalogue.py is out of date with schema/error-catalogue.json.

What changed

  • Regenerated infrahub_sdk/exceptions/catalogue.py from the server's error catalogue with uv run invoke backend.generate.
  • Added WorkerTimeoutData and WorkerTimeoutError, and registered WORKER_TIMEOUT in CODE_TO_EXCEPTION, CODE_TO_DATA_MODEL and the builder mapping.
  • Exported WorkerTimeoutError from infrahub_sdk.exceptions and added it to the public_names.json snapshot.
  • Added a WORKER_TIMEOUT case to the per-code tests in tests/unit/sdk/test_error_catalogue.py, with a captured response in tests/fixtures/error_catalogue/codes/worker_timeout.json.
  • The other catalogue entries are unchanged.

How to review

catalogue.py is generated. Review it against the WORKER_TIMEOUT entry in schema/error-catalogue.json on opsmill/infrahub#10530. The fixture uses the payload and message the server builds for a connectivity check that times out.

How to test

uv run pytest tests/unit/sdk/test_error_catalogue.py tests/unit/sdk/test_exceptions_public_names.py

Once the Infrahub PR points its python_sdk submodule at this branch, its backend-validate-generated job should pass.

Checklist

  • Tests added/updated
  • Changelog entry added: not needed, because the error catalogue has not been released and +typed-per-code-exceptions.added.md already covers it
  • External docs updated (if user-facing or ops-facing change)
  • Internal .md docs updated (internal knowledge and AI code tools knowledge)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: aed8916
Status: ✅  Deploy successful!
Preview URL: https://58f0beee.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-worker-timeout-error-bin.infrahub-sdk-python.pages.dev

View logs

Regenerated from the server's error catalogue, which now defines WORKER_TIMEOUT for a worker call that exceeds its timeout. Adds WorkerTimeoutData and WorkerTimeoutError, registers the code in the catalogue mappings, exports WorkerTimeoutError from infrahub_sdk.exceptions, and adds the code to the per-code tests.
@ogenstad
ogenstad force-pushed the pog-worker-timeout-error-binding-ifc-3148 branch from c3c7a9c to 62f255a Compare October 7, 2026 10:25
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                 Coverage Diff                  @@
##           infrahub-develop    #1405      +/-   ##
====================================================
- Coverage             87.14%   86.81%   -0.33%     
====================================================
  Files                   153      152       -1     
  Lines                 16493    14763    -1730     
  Branches               2417     1982     -435     
====================================================
- Hits                  14372    12817    -1555     
+ Misses                 1493     1382     -111     
+ Partials                628      564      -64     
Flag Coverage Δ
integration-tests 42.28% <0.00%> (-1.34%) ⬇️
python-3.10 60.88% <30.00%> (-1.17%) ⬇️
python-3.11 60.88% <30.00%> (-1.17%) ⬇️
python-3.12 60.88% <30.00%> (-1.17%) ⬇️
python-3.13 60.86% <30.00%> (-1.18%) ⬇️
python-3.14 60.88% <30.00%> (-1.17%) ⬇️
python-filler-3.12 22.96% <70.00%> (+0.38%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/exceptions/__init__.py 100.00% <ø> (ø)
infrahub_sdk/exceptions/catalogue.py 100.00% <100.00%> (ø)

... and 16 files with indirect coverage changes

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

ogenstad added a commit to opsmill/infrahub that referenced this pull request Oct 7, 2026
Moves the submodule to opsmill/infrahub-sdk-python#1405 so the generated SDK error catalogue includes WORKER_TIMEOUT.
@ogenstad
ogenstad marked this pull request as ready for review October 9, 2026 11:22
@ogenstad
ogenstad requested a review from a team as a code owner October 9, 2026 11:22

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

No issues found across 5 files

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

@ogenstad
ogenstad merged commit 7ed9b39 into infrahub-develop Oct 9, 2026
31 checks passed
@ogenstad
ogenstad deleted the pog-worker-timeout-error-binding-ifc-3148 branch October 9, 2026 12:45
ogenstad added a commit to opsmill/infrahub that referenced this pull request Oct 9, 2026
Points the submodule at the merge commit of opsmill/infrahub-sdk-python#1405
so the epic branch tracks the same SDK history as develop.
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