Skip to content

Merge develop into infrahub-develop#1043

Merged
polmichel merged 15 commits into
infrahub-developfrom
develop
Jun 2, 2026
Merged

Merge develop into infrahub-develop#1043
polmichel merged 15 commits into
infrahub-developfrom
develop

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

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


Summary by cubic

Prepare infrahub-sdk v1.21.0: adds infrahubctl marketplace get to fetch schemas or collections via the new REST API, aligns branch defaults and status, refreshes CLI docs, and bumps click/typer.

  • New Features

    • infrahubctl marketplace get: auto-detects schema vs collection; supports --version, --collection, --stdout, and --marketplace-url/INFRAHUB_MARKETPLACE_URL.
    • branch.create() now defaults sync_with_git=False to match the UI.
  • Bug Fixes

    • Added MERGING to BranchStatus to prevent validation errors during merges.
    • Clearer error when a single node is passed to a cardinality-many relationship.

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

Review in cubic

dependabot Bot and others added 6 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
@infrahub-github-bot-app infrahub-github-bot-app Bot requested a review from a team as a code owner May 25, 2026 08:39
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 25, 2026

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

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

View logs

dependabot Bot and others added 9 commits May 26, 2026 06:43
)

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
@polmichel polmichel merged commit 5d96736 into infrahub-develop Jun 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants