Skip to content

Merge develop into infrahub-develop#872

Merged
ogenstad merged 20 commits intoinfrahub-developfrom
develop
Mar 17, 2026
Merged

Merge develop into infrahub-develop#872
ogenstad merged 20 commits intoinfrahub-developfrom
develop

Conversation

@infrahub-github-bot-app
Copy link
Contributor

Merging develop into infrahub-develop after merging pull request #871.

BeArchiTek and others added 20 commits February 18, 2026 15:27
- 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
Merge stable into develop
@infrahub-github-bot-app infrahub-github-bot-app bot requested a review from a team as a code owner March 17, 2026 07:32
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 17, 2026

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

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

View logs

@infrahub-github-bot-app infrahub-github-bot-app bot self-assigned this Mar 17, 2026
@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Mar 17, 2026
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 81.96721% with 99 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/client.py 75.80% 22 Missing and 8 partials ⚠️
infrahub_sdk/file_handler.py 81.69% 20 Missing and 6 partials ⚠️
infrahub_sdk/ctl/schema.py 20.83% 19 Missing ⚠️
infrahub_sdk/node/node.py 90.90% 4 Missing and 4 partials ⚠️
infrahub_sdk/schema/export.py 76.47% 4 Missing and 4 partials ⚠️
infrahub_sdk/ctl/cli_commands.py 50.00% 1 Missing ⚠️
infrahub_sdk/ctl/config.py 0.00% 1 Missing ⚠️
infrahub_sdk/ctl/exporter.py 0.00% 1 Missing ⚠️
infrahub_sdk/ctl/importer.py 0.00% 1 Missing ⚠️
infrahub_sdk/protocols_base.py 0.00% 0 Missing and 1 partial ⚠️
... and 3 more
@@                 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     
Flag Coverage Δ
integration-tests 40.06% <12.93%> (-1.32%) ⬇️
python-3.10 51.84% <54.28%> (+0.40%) ⬆️
python-3.11 51.82% <54.28%> (+0.40%) ⬆️
python-3.12 51.82% <54.28%> (+0.40%) ⬆️
python-3.13 51.84% <54.28%> (+0.40%) ⬆️
python-3.14 53.52% <56.64%> (?)
python-filler-3.12 24.04% <22.40%> (-0.09%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/branch.py 68.53% <100.00%> (+0.22%) ⬆️
infrahub_sdk/ctl/branch.py 81.48% <100.00%> (+0.34%) ⬆️
infrahub_sdk/ctl/validate.py 52.11% <100.00%> (ø)
infrahub_sdk/exceptions.py 89.28% <100.00%> (ø)
infrahub_sdk/graphql/__init__.py 100.00% <100.00%> (ø)
infrahub_sdk/graphql/constants.py 100.00% <100.00%> (ø)
infrahub_sdk/graphql/multipart.py 100.00% <100.00%> (ø)
infrahub_sdk/graphql/renderers.py 92.77% <100.00%> (-0.09%) ⬇️
infrahub_sdk/node/constants.py 100.00% <100.00%> (ø)
infrahub_sdk/protocols.py 100.00% <100.00%> (ø)
... and 24 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ogenstad ogenstad merged commit 6caa67b into infrahub-develop Mar 17, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants