Skip to content

Manual merge develop into infrahub-develop#1053

Merged
polmichel merged 16 commits into
infrahub-developfrom
pmi-20260602-infrahub-dev-merge-develop
Jun 2, 2026
Merged

Manual merge develop into infrahub-develop#1053
polmichel merged 16 commits into
infrahub-developfrom
pmi-20260602-infrahub-dev-merge-develop

Conversation

@polmichel

@polmichel polmichel commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Merges develop into infrahub-develop to bring the latest changes (incl. v1.21.0 prep) into the Infrahub-tracked line. Alternative to #1043 with conflicts resolved.

Conflicts resolved

Both files conflicted on the same dependency-version divergence. Kept infrahub-develop's higher versions to avoid downgrading:

  • pyproject.toml (ctl + all extras): kept ariadne-codegen==0.18.0 (over develop's 0.15.3) and click>=8.3,<9 (over develop's >=8.2,<9).
  • uv.lock: regenerated via uv lock against the resolved pyproject.tomlclick 8.3.3, ariadne-codegen 0.18.0, version bumped 1.20.0 → 1.21.0. uv lock --check passes.

Summary by cubic

Brings SDK v1.21.0 into infrahub-develop and adds the infrahubctl marketplace get command (auto-detects schema vs collection, supports --version, --collection, and --stdout). Kept higher dependency versions during conflict resolution and regenerated uv.lock; also sets branch.create(sync_with_git=False), adds MERGING status, and improves cardinality-many error text.

  • New Features

    • New infrahubctl marketplace get: fetch schemas or collections via REST; auto-detects type; supports --version, --collection, --stdout; configurable base URL via marketplace_url/INFRAHUB_MARKETPLACE_URL; docs and tests added.
  • Dependencies

    • Kept ariadne-codegen==0.18.0 and click>=8.3,<9; regenerated uv.lock (click 8.3.3, ariadne-codegen 0.18.0); bumped project version to 1.21.0.

Written for commit 5d96736. Summary will update on new commits.

Review in cubic

dependabot Bot and others added 16 commits May 18, 2026 10:17
)

Bumps [infrahub-testcontainers](https://github.com/opsmill/infrahub) from 1.9.3 to 1.9.5.
- [Release notes](https://github.com/opsmill/infrahub/releases)
- [Changelog](https://github.com/opsmill/infrahub/blob/stable/CHANGELOG.md)
- [Commits](opsmill/infrahub@infrahub-v1.9.3...infrahub-v1.9.5)

---
updated-dependencies:
- dependency-name: infrahub-testcontainers
  dependency-version: 1.9.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(branch): add MERGING to BranchStatus enum to match server (#9293)

The server-side BranchStatus enum gained MERGING in Infrahub 1.9.3 (PR
opsmill/infrahub#9116) but the SDK enum was not updated. Any branch
returned with status="MERGING" — including a branch stranded in that
state by a task worker dying mid-merge — caused client.branch.all() to
raise ValidationError, which crashloops the task worker on every
sync_remote_repositories run.

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

* fix(tests): use model_validate so ty accepts the parametrized status string

ty rejects passing str where BranchStatus is annotated; switch to
BranchData.model_validate({...}) which mirrors how the SDK actually
parses server JSON in branch.py.

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

* review(branch): address PR feedback — drop test, rename changelog, shorten note

- Drop test_branch_data_accepts_all_server_statuses: per review, the
  enum-coverage test belongs in the infrahub community repo where it
  can iterate over the actual server-side BranchStatus enum instead of
  a hardcoded list of strings. It will be added there as part of the
  PR that bumps the SDK commit pin.
- Rename changelog +branchstatus-merging.fixed.md → 1037.fixed.md to
  link it to the newly-filed SDK-side issue #1037 (migrated from
  opsmill/infrahub#9293).
- Shorten changelog note per review.

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

* chore(changelog): shorten 1037.fixed.md per review

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

---------

Co-authored-by: Phillip Simonds <phillip@opsmill.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Prepare for version 1.20.1

* fix version
* IHS-136: Update click version

* update docs
Merge stable into develop
)

Bumps [infrahub-testcontainers](https://github.com/opsmill/infrahub) from 1.9.5 to 1.9.6.
- [Release notes](https://github.com/opsmill/infrahub/releases)
- [Changelog](https://github.com/opsmill/infrahub/blob/stable/CHANGELOG.md)
- [Commits](opsmill/infrahub@infrahub-v1.9.5...infrahub-v1.9.6)

---
updated-dependencies:
- dependency-name: infrahub-testcontainers
  dependency-version: 1.9.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [idna](https://github.com/kjd/idna) from 3.11 to 3.15.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](kjd/idna@v3.11...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* IHS-75: Fix cardinality many error message

* update news fragment
#952)

* Marketplace

* Auto-detect marketplace items; drop --load from download

- Probe schema and collection endpoints in parallel so
  `infrahubctl marketplace download <ns>/<name>` no longer requires
  the user to pass `--collection` up front. Collision between the two
  resolves to schema with a warning (pass `--collection` to force the
  other path). `_detect_item_type` returns the winning 200 response so
  the download helper reuses it instead of re-fetching.
- Remove the `--load` convenience flag; `download` is write-only.
  Users who want to push into Infrahub chain with `infrahubctl schema
  load`.
- Introduce a four-class error taxonomy (invalid-input, not-found,
  network) with exit codes 1 vs 2, distinguishing "version not found"
  from "schema not found" when `--version` is passed.
- Surface filesystem failures (unwritable `--output-dir`) cleanly
  rather than as a traceback.
- Regenerate `infrahubctl-marketplace.mdx`; no longer advertises
  `--load`.
- Add spec, plan, research, contract, quickstart, tasks, and
  checklist artifacts under `specs/001-marketplace-api-update/`.

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

* Fix vale style errors in marketplace CLI help text

Spell out 'semver' and replace 'config/env' with the full words so
vale's spelling and word-swap rules pass.

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

* Pad research.md table separator rows

CI runs markdownlint v0.40.0 which flags MD060 (table-column-style)
when the separator row uses compact pipes while the data rows are
padded. Match the repo's existing style (docs/python-sdk/introduction.mdx)
by padding the separator rows too.

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

* Rename marketplace command to `get` and add `--stdout`

- Rename `infrahubctl marketplace download` to `infrahubctl marketplace get` to match the convention used by similar tools (kubectl, gh, etc.) and stay consistent with future `marketplace list` / `marketplace search` commands.
- Add `--stdout/-s` flag that streams content to stdout (status, warnings, and errors routed to stderr) so output can be piped into commands like `infrahubctl schema check` once stdin support lands. Skips disk writes entirely. For collections, schemas are concatenated as multi-doc YAML, only injecting `---` separators when missing.
- Route `_fail` errors through stderr unconditionally so failures don't pollute stdout when piping.
- Regenerate `infrahubctl-marketplace.mdx` and add `stdout`/`stderr` to the vale spelling exceptions.

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

* Address cubic review: classify partial probe failures and download errors as network

- `_detect_item_type`: a transport failure on either probe (when no 200 winner exists) now raises `network`, not `not-found`. Mixing a 404 on one endpoint with a 5xx or transport failure on the other previously fell through to `not-found`, which masked real connectivity problems. Identified by cubic.
- `get`: wrap the post-detect download calls so `httpx.HTTPError` (transport failures and 5xx via `raise_for_status`) raises `_fail("network", ...)` (exit 2) instead of being swallowed by the default `@catch_exception` exit 1. Identified by cubic.
- Update quickstart success example to match the actual `Downloaded schema …` output.
- Add three tests: partial probe failure -> network, versioned download network error, and `--collection` flag network error.

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

* Add changelog fragment for marketplace command

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

* Address ogenstad review: enum error class, type narrowing, SDK proxy config, marketplace_url

- Replace ErrorClass Literal + _ERROR_EXIT_CODES dict with _ErrorClass(Enum)
  so the exit code mapping is co-located with the error definition
- Remove type: ignore[return-value] by using inline isinstance guards so the
  type checker narrows httpx.Response naturally in each branch
- Build httpx.AsyncClient via _make_http_client() using the SDK's proxy and
  TLS config (ConfigBase.proxy, proxy_mounts, tls_context) and follow_redirects=True
- Move marketplace_url from infrahubctl Settings to SDK ConfigBase
  (INFRAHUB_MARKETPLACE_URL); regenerate config.mdx

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

* Address code review: NoReturn _fail, _status_console rename, SETTINGS config, helper extraction

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

* Address minor review issues: module-level helper, consistent error messages, collection=False test, spec renames

- Move is_transport_failure to module level as _is_transport_failure
- Replace f"Error: {detail}" 404 messages with consistent "No schema/collection named..." format
- Remove now-unused contextlib.suppress import
- Add test_collection_false_downloads_schema covering the defensive bool|None path
- Update spec.md, plan.md, tasks.md: rename command references from download to get

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

* fix `infrahubctl marketplace get --collection`

* Address ogenstad review comments on marketplace command

- Add MarketplaceIdentifier dataclass; _parse_identifier now returns it
  instead of a bare tuple, removing positional ordering assumptions
- collection: bool | None = None → bool = False with is_flag=True;
  the if/elif/else block becomes if collection: ... else: auto-detect
- Reverse prefetched condition to lead with truthy (if prefetched:)
- if version is not None → if version
- Add MarketplaceItemType annotation on the collection branch
- Use keyword arguments throughout _download_schema / _download_collection calls

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

* Fix CI: use NamedTuple for MarketplaceIdentifier, format long _fail line

@DataClass + from __future__ import annotations triggers a Python 3.12
bug in dataclasses._is_type during docs generation. NamedTuple avoids
this entirely while providing the same immutable named-field semantics.

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

* Fix ty false positive on CliRunner(mix_stderr=False)

typer 0.25.1 (used in CI via the stable lockfile) removed explicit
mix_stderr from CliRunner.__init__, causing ty to flag the call as
unknown-argument even though it still works at runtime via **kwargs.
Silence with type: ignore[call-arg].

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

* Show exception type when httpx error has empty message

ReadTimeout and similar httpx exceptions can have an empty str()
representation, producing "Marketplace request failed: " with nothing
after the colon. Fall back to the exception class name so the output
is always informative (e.g. "Marketplace request failed: ReadTimeout").

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

* Remove mix_stderr=False from CliRunner, update stdout tests

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

* Use result.output instead of result.stdout in marketplace tests

In typer 0.25.1 result.stdout only captures stdout; error messages
written to err_console (stderr) only appear in result.output. Switching
all assertions to result.output works across both typer versions.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Wim Van Deun <7521270+wvandeun@users.noreply.github.com>
Merge stable into develop
Prepare for version 1.21.0 of the SDK
Bumps [dulwich](https://github.com/dulwich/dulwich) from 0.24.7 to 1.2.5.
- [Release notes](https://github.com/dulwich/dulwich/releases)
- [Changelog](https://github.com/jelmer/dulwich/blob/main/NEWS)
- [Commits](jelmer/dulwich@dulwich-0.24.7...dulwich-1.2.5)

---
updated-dependencies:
- dependency-name: dulwich
  dependency-version: 1.2.5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Merge stable into develop
…hub-dev-merge-develop

# Conflicts:
#	pyproject.toml
#	uv.lock
@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Jun 2, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5d96736
Status: ✅  Deploy successful!
Preview URL: https://945bf0e5.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pmi-20260602-infrahub-dev-me.infrahub-sdk-python.pages.dev

View logs

@polmichel polmichel marked this pull request as ready for review June 2, 2026 10:04
@polmichel polmichel requested a review from a team as a code owner June 2, 2026 10:04
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
infrahub_sdk/ctl/marketplace.py 90.90% 8 Missing and 6 partials ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop    #1053      +/-   ##
====================================================
- Coverage             81.87%   81.71%   -0.17%     
====================================================
  Files                   134      135       +1     
  Lines                 11676    11638      -38     
  Branches               1735     1759      +24     
====================================================
- Hits                   9560     9510      -50     
- Misses                 1569     1576       +7     
- Partials                547      552       +5     
Flag Coverage Δ
integration-tests 41.63% <31.05%> (-1.13%) ⬇️
python-3.10 55.13% <90.06%> (-0.27%) ⬇️
python-3.11 55.13% <90.06%> (-0.27%) ⬇️
python-3.12 55.13% <90.06%> (-0.27%) ⬇️
python-3.13 55.13% <90.06%> (-0.27%) ⬇️
python-3.14 55.13% <90.06%> (-0.27%) ⬇️
python-filler-3.12 22.35% <1.86%> (+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.75% <100.00%> (+0.21%) ⬆️
infrahub_sdk/config.py 91.19% <100.00%> (+0.05%) ⬆️
infrahub_sdk/ctl/cli_commands.py 72.54% <100.00%> (+0.21%) ⬆️
infrahub_sdk/ctl/config.py 67.85% <100.00%> (+0.58%) ⬆️
infrahub_sdk/node/relationship.py 81.86% <100.00%> (+2.19%) ⬆️
infrahub_sdk/ctl/marketplace.py 90.90% <90.90%> (ø)

... 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.

@polmichel polmichel changed the title Merge develop into infrahub-develop Manual merge develop into infrahub-develop Jun 2, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/docs/infrahubctl/infrahubctl-marketplace.mdx">

<violation number="1" location="docs/docs/infrahubctl/infrahubctl-marketplace.mdx:3">
P3: Marketplace docs say schemas only, but this command also supports collections.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -0,0 +1,46 @@
# `infrahubctl marketplace`

Browse and download schemas from the Infrahub Marketplace.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Marketplace docs say schemas only, but this command also supports collections.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/docs/infrahubctl/infrahubctl-marketplace.mdx, line 3:

<comment>Marketplace docs say schemas only, but this command also supports collections.</comment>

<file context>
@@ -0,0 +1,46 @@
+# `infrahubctl marketplace`
+
+Browse and download schemas from the Infrahub Marketplace.
+
+**Usage**:
</file context>
Suggested change
Browse and download schemas from the Infrahub Marketplace.
Browse and download schemas and collections from the Infrahub Marketplace.

@polmichel polmichel merged commit 18e6486 into infrahub-develop Jun 2, 2026
21 checks passed
@polmichel polmichel deleted the pmi-20260602-infrahub-dev-merge-develop branch June 2, 2026 11:39
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.

5 participants