Merge develop into infrahub-develop#872
Merged
ogenstad merged 20 commits intoinfrahub-developfrom Mar 17, 2026
Merged
Conversation
- Strip relationship fields that match schema loading defaults (direction: bidirectional, on_delete: no-action, cardinality: many, optional: true, min_count: 0, max_count: 0) - Exclude branch from attribute/relationship dumps (inherited from node) - Ensure scalar fields appear before attributes/relationships lists Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
read_only was unconditionally excluded from attribute dumps; move it to _ATTR_EXPORT_DEFAULTS so it is stripped only when False (the default) and kept when True (computed/read-only attributes). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…export - Drop relationships with kind Group, Profile, or Hierarchy from export output — these are always auto-generated by Infrahub and must not be re-loaded manually (doing so caused validator_not_available errors for hierarchical generics) - For GenericSchemaAPI objects that had Hierarchy relationships, restore the `hierarchical: true` flag so the schema round-trips cleanly - Add read_only: false to _REL_EXPORT_DEFAULTS to stop it leaking into relationship output Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ints - generics key now appears before nodes in the exported YAML payload - uniqueness_constraints entries that are auto-generated from unique: true attributes (single-field ["<attr>__value"] entries) are removed on export; user-defined multi-field constraints are preserved Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move export helpers from ctl/schema.py to infrahub_sdk/schema/export.py so the conversion logic is reusable outside the CLI. Regenerate infrahubctl docs to include the new export subcommand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts: - Keep export command in ctl/schema.py (removed on stable, added on branch) - Accept deletion of tests/unit/ctl/test_schema_export.py (tests moved to tests/unit/sdk/) - Move RESTRICTED_NAMESPACES into schema/export.py (removed from constants.py on stable) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix import ordering in test_schema_export.py (infrahub_sdk.schema above TYPE_CHECKING) - Use clients fixture + client_types pattern matching existing test conventions - Fix warnings.warn stacklevel from 2 to 3 for correct caller attribution - Pass populate_cache=False in both async/sync export to prevent cache poisoning Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…antic models Addresses PR review feedback: export() now returns a proper SchemaExport object instead of dict[str, dict[str, list[dict[str, Any]]]], making the API easier to understand and use. Includes .to_dict() for serialization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the ability to export the schema in yaml
prepare release v1.19.0
Merge stable into develop
Deploying infrahub-sdk-python with
|
| Latest commit: |
a4c5ecb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c6e90d11.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://develop.infrahub-sdk-python.pages.dev |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## infrahub-develop #872 +/- ##
====================================================
+ Coverage 80.41% 80.62% +0.21%
====================================================
Files 115 119 +4
Lines 9884 10335 +451
Branches 1500 1550 +50
====================================================
+ Hits 7948 8333 +385
- Misses 1418 1475 +57
- Partials 518 527 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
ogenstad
approved these changes
Mar 17, 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.
Merging develop into infrahub-develop after merging pull request #871.