Repository navigation
fix(schema): make number_pool_id a read-only NumberPool parameter - #1466
Merged
ajtmccarty merged 1 commit intoOct 30, 2026
Merged
Conversation
Only the server's schema synchronizer assigns the pool of a NumberPool attribute. A schema file that carries the id, for example one exported from another instance, now validates with a read-only warning and the server ignores the value instead of storing an id that points to no pool. Regenerated from the Infrahub generator (tasks/backend.py). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
2 of 4 tasks
Deploying infrahub-sdk-python with
|
| Latest commit: |
2a31f71
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c5ad6b8f.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://ajtm-ifc-3381-number-pool-id.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## infrahub-release-1.12 #1466 +/- ##
=========================================================
- Coverage 87.74% 87.74% -0.01%
=========================================================
Files 155 155
Lines 15518 15517 -1
Branches 2085 2085
=========================================================
- Hits 13616 13615 -1
Misses 1345 1345
Partials 557 557
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
ajtmccarty
marked this pull request as ready for review
October 29, 2026 22:35
gmazoyer
approved these changes
Oct 29, 2026
polmichel
approved these changes
Oct 30, 2026
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.
Human summary
we want to block/ignore changes to
parameters.number_pool_idonNumberPoolattributes in the schema. only Infrahub should modify this value.Why
A team that loads a schema containing the
number_pool_idof a NumberPool attribute can end up with an attribute that points to a pool that does not exist. This happens with a schema exported from another instance, or with an attribute copied from an existing one. If the attribute has no pool yet, the server stores the submitted id. The schema synchronizer then never creates a pool for the attribute, and every create of that kind fails (IFC-3381).Only the server's schema synchronizer should assign this id. This PR makes
number_pool_ida read-only field of the write contract. The Infrahub server already drops read-only fields on a schema load and returns a warning for each one.Closes IFC-3381 together with opsmill/infrahub#11297.
What changed
NumberPoolParametersWriteno longer declaresnumber_pool_id.READ_ONLY_FIELDSlistsnumber_pool_idforNumberPoolParametersWrite. Validating a schema file that sets it reports'parameters.number_pool_id' is a read-only field, the submitted value is ignored. It is no longer accepted as a writable field.NumberPoolParametersReadstill hasnumber_pool_id, so reading a schema from the server still returns the pool id.How to review
Both files under
infrahub_sdk/schema/generated/are generated byuv run invoke backend.generatein the Infrahub repository, fromtasks/backend.py. The generator change is in opsmill/infrahub#11297.Impact & rollout
number_pool_idstill validates, with a warning in place of silent acceptance.python_sdkpointer to the merged commit.Checklist
changelog/+number-pool-id-read-only.changed.md)🤖 Generated with Claude Code