Skip to content

Merge stable into develop#1177

Open
infrahub-github-bot-app[bot] wants to merge 1 commit into
developfrom
stable
Open

Merge stable into develop#1177
infrahub-github-bot-app[bot] wants to merge 1 commit into
developfrom
stable

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Merging stable into develop after merging pull request #1118.


Summary by cubic

Adds --dependencies to infrahubctl marketplace get to resolve and download transitive dependencies via the marketplace API, and -y/--yes to overwrite existing schemas when reconciling files. Aligns with IHS-246 by moving dependency resolution server-side and organizing outputs clearly.

  • New Features
    • --dependencies: resolves full transitive deps server-side and downloads them.
    • Output layout: collection members under <requested>/; prerequisite collections under their own <collection>/; standalone deps at the output root. In schema mode, deps are grouped by owning collection (or root if none).
    • Behavior: strict for collection members; soft-fail for standalone deps; reports unresolved kinds and visibility-hidden counts; deduplicates across groups.
    • Existing files: reconcile to a single file; keep by default; overwrite with -y/--yes (non-tty without --yes never overwrites).
    • Safety: validates path segments to prevent directory traversal.
    • Docs updated and unit tests added for dependency grouping, stdout streaming, overwrite rules, version-pinned deps, and error handling.

Written for commit 81612ea. Summary will update on new commits.

Review in cubic

)

## feat(ctl): add marketplace --dependencies flag with server-side resolution

Add `--dependencies` flag to `marketplace get` for collections and schemas, recursively downloading transitive dependencies resolved server-side via new `/dependencies` endpoints.

### Key features
- **Collections:** prerequisite collections grouped into subdirectories, members and standalone schemas in output root
- **Schemas:** dependencies grouped by owning collection (or root if standalone)
- **Soft-fail** for unresolved/missing schema dependencies; strict for collection members
- **Deduplication, cycle safety,** and reconciliation with existing schemas (keep by default, overwrite with `-y`)
- **Path validation** (`_safe_segment`) to prevent directory traversal attacks
- **Versioned** schema downloads resolve the pinned version's dependencies

### Technical changes
- Replaced client-side dependency walk with single server-side `/dependencies` endpoint call
- Report visibility-hidden dependencies in summary

**Refs:** IHS-246, #1117
@infrahub-github-bot-app infrahub-github-bot-app Bot requested a review from a team as a code owner July 13, 2026 10:14
@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Jul 13, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 81612ea
Status: ✅  Deploy successful!
Preview URL: https://04a677c9.infrahub-sdk-python.pages.dev

View logs

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.41104% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/ctl/marketplace.py 91.41% 7 Missing and 7 partials ⚠️
@@             Coverage Diff             @@
##           develop    #1177      +/-   ##
===========================================
+ Coverage    82.88%   82.97%   +0.09%     
===========================================
  Files          139      139              
  Lines        13074    13218     +144     
  Branches      2069     2097      +28     
===========================================
+ Hits         10836    10968     +132     
- Misses        1627     1633       +6     
- Partials       611      617       +6     
Flag Coverage Δ
integration-tests 40.85% <14.11%> (-0.28%) ⬇️
python-3.10 57.36% <91.41%> (+0.37%) ⬆️
python-3.11 57.36% <91.41%> (+0.39%) ⬆️
python-3.12 57.34% <91.41%> (+0.36%) ⬆️
python-3.13 57.36% <91.41%> (+0.37%) ⬆️
python-3.14 57.36% <91.41%> (+0.37%) ⬆️
python-filler-3.12 22.84% <0.00%> (-0.26%) ⬇️

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

Files with missing lines Coverage Δ
infrahub_sdk/ctl/marketplace.py 93.01% <91.41%> (-0.65%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread changelog/1117.added.md
@@ -0,0 +1 @@
Added a `--dependencies` flag to `infrahubctl marketplace get`. When downloading a schema or a collection, it now also resolves and downloads the schemas they depend on, via the marketplace API. Dependencies are grouped by the collection they belong to: prerequisite collections (and, for a single schema, dependencies that are members of a collection) are placed in their own `<collection>/` directory, while dependencies that belong to no collection land in the output root. Referenced kinds the marketplace cannot resolve are reported as unresolved dependencies. A schema that already exists in the output directory is reconciled to a single file rather than duplicated across directories — kept by default, or overwritten with the new `-y`/`--yes` flag.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changelog is quite long, is this something we really want in a release note @minitriga?
You can take a look at the guidelines in infrahub project related to changelogs (infrahub/dev/guidelines/changelog.md), or the new skill @saltas888 is working on opsmill/infrahub#9663.
I think we need to copy the changelog file into the infrahub-sdk project aswell.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And has the initial PR been approved? #1118
My UI may have an issue, got a poor connection today.

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.

2 participants