Skip to content

Merge develop into infrahub-develop#1069

Merged
ogenstad merged 9 commits into
infrahub-developfrom
develop
Jun 9, 2026
Merged

Merge develop into infrahub-develop#1069
ogenstad merged 9 commits into
infrahub-developfrom
develop

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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


Summary by cubic

Switches infrahubctl marketplace get --collection to per-schema downloads with a clean directory layout and safer stdout. Adds infrahubctl graphql query-report, and makes relationship helpers generic so .peer/.peers keep the correct node type in the SDK and generated protocols.

  • New Features

    • --collection now reads collection metadata and downloads each member via the schema endpoint; saves to <output_dir>/<collection>/<schema>.yml and disambiguates duplicate names with <namespace>/; counts only downloaded schemas and warns on invalid members.
    • When streaming to stdout, inserts --- between documents if missing.
    • New graphql query-report reports if a query targets unique nodes; supports --online and --branch.
    • RelatedNode, RelatedNodeSync, RelationshipManager, and RelationshipManagerSync are generic over their peer type, and infrahubctl protocols emits parameterized relationships (e.g., device: RelatedNode[NetworkDevice]); traversal preserves peer types and remains backward compatible.
  • Bug Fixes

    • infrahubctl no longer prints an extra "Error: 1" or a traceback when a command exits with typer.Exit.
    • Typing hardening across the SDK: use CoreNodeBase subclasses and duck typing to resolve schema names and resource pool nodes reliably.

Written for commit b47bb9c. Summary will update on new commits.

Review in cubic

minitriga and others added 6 commits June 3, 2026 16:10
…ubdirectory

`marketplace get --collection` previously fetched a ZIP and dumped every
schema flat into the output directory with the version baked into each
filename (e.g. `infrahub-dcim-1.0.0.yml`). Re-downloading accumulated stale
versions side by side, and the naming was inconsistent with single-schema
downloads (`dcim.yml`).

Collections are now resolved via the collection metadata endpoint, which
lists each member schema and its latest published version. Each member is
downloaded individually through the existing `_download_schema` path, so
naming, versioning, and error handling match single-schema downloads.
Members land in `<output_dir>/<collection name>/<schema name>.yml`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e collisions

Address review findings on the per-schema collection download:

- The summary now counts schemas actually downloaded instead of every
  member entry, so skipped members (missing namespace/name) no longer
  inflate the count; skipped members also emit a warning instead of
  disappearing silently.
- Members sharing a schema name across namespaces are disambiguated
  into <collection>/<namespace>/<name>.yml instead of silently
  overwriting each other.
- The stdout `---` separator is tied to emitted documents rather than
  the raw member index.
- Collection metadata items with unexpected shapes are filtered out
  instead of raising AttributeError.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(ctl): download marketplace collections per-schema into a named subdirectory
Merge stable into develop
@infrahub-github-bot-app infrahub-github-bot-app Bot requested a review from a team as a code owner June 8, 2026 11:54
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: b47bb9c
Status: ✅  Deploy successful!
Preview URL: https://9eeca4ab.infrahub-sdk-python.pages.dev
Branch Preview URL: https://develop.infrahub-sdk-python.pages.dev

View logs

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.72727% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/store.py 70.00% 1 Missing and 2 partials ⚠️
infrahub_sdk/node/related_node.py 89.47% 2 Missing ⚠️
infrahub_sdk/schema/__init__.py 33.33% 1 Missing and 1 partial ⚠️
infrahub_sdk/ctl/marketplace.py 95.65% 1 Missing ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop    #1069      +/-   ##
====================================================
+ Coverage             82.02%   82.26%   +0.23%     
====================================================
  Files                   135      135              
  Lines                 11841    11956     +115     
  Branches               1762     1785      +23     
====================================================
+ Hits                   9713     9836     +123     
+ Misses                 1576     1573       -3     
+ Partials                552      547       -5     
Flag Coverage Δ
integration-tests 42.51% <26.36%> (-0.11%) ⬇️
python-3.10 55.98% <66.36%> (+0.08%) ⬆️
python-3.11 56.00% <66.36%> (+0.09%) ⬆️
python-3.12 56.00% <66.36%> (+0.09%) ⬆️
python-3.13 55.98% <66.36%> (+0.08%) ⬆️
python-3.14 55.98% <66.36%> (+0.09%) ⬆️
python-filler-3.12 22.34% <26.36%> (+0.36%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/ctl/branch.py 81.48% <ø> (ø)
infrahub_sdk/ctl/graphql.py 91.05% <100.00%> (+2.51%) ⬆️
infrahub_sdk/node/attribute.py 100.00% <100.00%> (ø)
infrahub_sdk/node/relationship.py 81.86% <100.00%> (ø)
infrahub_sdk/protocols_base.py 77.60% <100.00%> (+4.16%) ⬆️
infrahub_sdk/protocols_generator/generator.py 95.12% <100.00%> (+0.12%) ⬆️
infrahub_sdk/testing/repository.py 77.77% <ø> (ø)
infrahub_sdk/ctl/marketplace.py 92.25% <95.65%> (+1.34%) ⬆️
infrahub_sdk/node/related_node.py 92.57% <89.47%> (+0.12%) ⬆️
infrahub_sdk/schema/__init__.py 73.49% <33.33%> (+0.06%) ⬆️
... and 1 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Jun 8, 2026
solababs and others added 2 commits June 8, 2026 21:04
…1065)

* IHS-183: Fix typing errors for protocols

* fix ty

* fix failing tests

* address comments

* use CoreNodeBase in get_schema_name

* remove breakpoint

* add test for store get_schema_name

* update test

* Make RelatedNode/RelationshipManager generic over peer type (#1063)

Parameterise RelatedNode, RelatedNodeSync, RelationshipManager and
RelationshipManagerSync over the peer type (defaulting to InfrahubNode/
InfrahubNodeSync for backward compatibility) and have infrahubctl protocols
emit the peer type for each relationship. Relationship traversal via .peer/
.peers/indexing now preserves the peer type instead of collapsing to the
dynamic InfrahubNode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: regenerate SDK docs for generic RelatedNode peer types

The develop merge combined upstream peer/get docstrings with our generic
PeerT/PeerTSync return types, leaving the committed related_node.mdx stale.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Sola Infrahub User <sola@opsmill.com>
Co-authored-by: Aaron McCarty <aaron@opsmill.com>
Co-authored-by: Sola Babatunde <solababatunde12@gmail.com>
Co-authored-by: Mikhail Yohman <mikhail@opsmill.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ogenstad ogenstad merged commit 4172757 into infrahub-develop Jun 9, 2026
36 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.

6 participants