fix(sdk): rename Priority.NORMAL to MEDIUM to match server contract#1208
Open
fatih-acar wants to merge 1 commit into
Open
fix(sdk): rename Priority.NORMAL to MEDIUM to match server contract#1208fatih-acar wants to merge 1 commit into
fatih-acar wants to merge 1 commit into
Conversation
The Infrahub API backpressure layer (opsmill/infrahub#9879) renamed the middle X-Priority tier from `normal` to `medium`, and the server now parses the header against enum member names. An SDK emitting `normal` no longer resolves, so background flows raised `ValueError: 'medium' is not a valid Priority`. Rename the SDK `Priority` enum's middle member to `MEDIUM`/`medium` so the emitted X-Priority header matches the server's high/medium/low contract. The feature is unreleased, so no backward-compatible alias is kept. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying infrahub-sdk-python with
|
| Latest commit: |
3ba71b4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c7ffdcb0.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://fac-infrahub-develop-priorit.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## infrahub-develop #1208 +/- ##
====================================================
- Coverage 83.98% 83.17% -0.82%
====================================================
Files 139 139
Lines 14390 12437 -1953
Branches 2381 1852 -529
====================================================
- Hits 12085 10344 -1741
+ Misses 1654 1528 -126
+ Partials 651 565 -86
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 13 files with indirect coverage changes 🚀 New features to boost your workflow:
|
ajtmccarty
approved these changes
Jul 23, 2026
Contributor
|
@fatih-acar this is already covered in #1205 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Infrahub API backpressure layer renamed its middle
X-Prioritytier fromnormaltomedium(opsmill/infrahub#9879) and now parses the header against enum member names. An SDK client emittingnormalno longer matches any tier, so background flows (artifact generation, generators, diffs) crash withValueError: 'medium' is not a valid Priority. This renames the SDK'sPriorityenum to keep the emitted header aligned with the server contract.Key Changes
X-Priority: high | medium | low, matching the server's tiers — background workflows that carry a request priority no longer error.Priority.NORMAL→Priority.MEDIUM(wire value"normal"→"medium") ininfrahub_sdk.constants. The feature is unreleased, so no backward-compatibleNORMALalias is kept.Config.prioritydescription, the regeneratedconfig.mdxreference, and the unreleased changelog fragment updated tohigh|medium|low.ihs-259design docs underdev/specs/re-titlednormal→medium.Related Context
Server-side counterpart: opsmill/infrahub#9879 (IFC-2886). The tier rename is documented in that PR's "Update since original description" section.
Documentation Updates
docs/docs/python-sdk/reference/config.mdxregenerated.changelog/1151.added.md(unreleased X-Priority fragment) updated.dev/specs/ihs-259-sdk-x-priority-header/*design docs updated.Test Plan
uv run invoke format lint-code— ruff, ty, mypy clean.uv run invoke lint-docs— rumdl clean.uv run pytest tests/unit/sdk/test_priority.py tests/unit/sdk/test_config.py tests/unit/sdk/test_relogin_headers.py— 91 passed.validate-generated-documentation(the regenerated config reference is committed).Summary by cubic
Renamed the SDK’s middle priority from
NORMALtoMEDIUMand now emitX-Priority: high|medium|lowto match the server contract. This fixes crashes in background workflows caused by the server expectingmedium.Priorityenum ininfrahub_sdk/constants.py:NORMAL→MEDIUM(wire value"medium").Config.prioritydocs and descriptions tohigh|medium|low.Written for commit 3ba71b4. Summary will update on new commits.