fix(schema): make number_pool_id a read-only NumberPool parameter
Human summary
we want to block/ignore changes to parameters.number_pool_id on NumberPool attributes in the schema. only Infrahub should modify this value.
Why
A team that loads a schema containing the number_pool_id of 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_id a 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 by uv run invoke backend.generate in the Infrahub repository, from tasks/backend.py. The generator change is in opsmill/infrahub#11297.
Impact & rollout
- Backward compatibility: a schema file that sets
number_pool_idstill validates, with a warning in place of silent acceptance. - Deployment notes: merge before opsmill/infrahub#11297, which moves its
python_sdkpointer to the merged commit.
Checklist
- Tests added/updated (in opsmill/infrahub#11297)
- Changelog entry added (
changelog/+number-pool-id-read-only.changed.md) - External docs updated (if user-facing or ops-facing change)
- Internal .md docs updated (internal knowledge and AI code tools knowledge)
š¤ Generated with Claude Code