Skip to content

Manual merge develop into infrahub-develop - #1450

Merged
polmichel merged 29 commits into
infrahub-developfrom
pmi-merge-develop-infrahub-develop-1440
Oct 26, 2026
Merged

polmichel merged 29 commits into
infrahub-developfrom
pmi-merge-develop-infrahub-develop-1440

Conversation

@polmichel

@polmichel polmichel commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #1440, which was blocked on merge conflicts.

Merges develop into infrahub-develop. The merge commit keeps the conflict markers, so each resolution below is a reviewable diff of its own.

Conflicts resolved

  • infrahub_sdk/node/node.py — develop moved the peer identifier stripping into RelatedNodeBase.__init__, where it also covers add() and remove(); infrahub-develop kept the old block and added the present flag and the _bind() call. Took the removal, kept the binding. (d4bd613c)
  • infrahub_sdk/node/relationship.py — both branches added _reload_kwargs; see the next section. (fc1e5d8d)
  • tests/unit/sdk/test_client.py — each branch added imports on the same line. Kept both. (1b2aacc8)
  • uv.lock and docs/.../node/relationship.mdx — generated, regenerated rather than hand-merged.

_reload_kwargs needs a reviewer

Each branch added this method on its own, so the merge left two definitions with no conflict marker on them and the second shadowed the first. infrahub-develop's only= handling would have shipped as dead code.

The merged method, in fc1e5d8d, keeps all three behaviours:

  • It reads self.node and raises UninitializedError on an unsaved node, from develop.
  • It reloads with only when the node itself was read with only, from infrahub-develop.
  • It passes populate_store=False on both paths, from develop.

Changes beyond the conflicts

Two changes were needed that no conflict marker pointed at.

infrahub_sdk/node/related_node.py (ba9b26b9) merged cleanly, but both branches had added statements to RelatedNodeBase.__init__ and together they crossed the 50 statement limit ruff enforces. Split out _peer_input() and _is_peer_node().

uv.lock (2cd998de, 8fdea99f, 461372f2, 021597e2) needed more than a regeneration, because develop adds Python 3.15 and infrahub-develop had never built against it:

  • The versions that cannot install on 3.15 move to the ones develop already locks. pyarrow publishes no cp315 wheel and fails to build from its sdist, and the PyO3 extensions rpds-py, orjson and pydantic-core are refused by PyO3 itself, which accepts no Python newer than 3.14 at those versions.
  • The other upgrades develop had locked are carried over. Regenerating the lockfile keeps the pins of whichever side it starts from, so develop's had to be restored package by package.

The lockfile now matches develop everywhere except ty, which infrahub-develop upgraded further, and infrahub-testcontainers, where a patch newer than both branches exists.

Checks

ruff, ty and mypy pass locally, docs-validate exits 0, and 2954 unit tests pass. CI covers the matrix from 3.10 to 3.15 and the integration tests against a running Infrahub, which are not run locally.

🤖 Generated with Claude Code

saltas888 and others added 25 commits October 19, 2026 09:58
fetch() on the ancestors or descendants of a node that was retrieved
without them raises ValueError before any request is sent. Cover the
async and the sync managers, from the reload to the resolved peers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fetch() on a cardinality-many relationship that was not loaded reloads
the node and removed the relationship's name from a list of the
schema's relationship and attribute names. ancestors and descendants
are not schema relationships, so the removal raised ValueError before
any request was sent. Build the list without that name instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fetch() on a cardinality-many relationship that was not loaded reloads the
parent node with only that relationship. The reload wrote that copy to the
client store, replacing the stored node with one that has no attribute
values. The reload now passes populate_store=False.

fetch() on a node without an id now raises UninitializedError instead of
"At least one filter must be provided to get()".

The arguments of the reload move to _reload_kwargs() on
RelationshipManagerBase, shared by the async and the sync manager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Config.clone(branch=...) and infrahubctl --branch wrote the branch into
default_branch, which the flag ignores, so the client fell back to the
local Git branch. A generator run with --branch then read from the
requested branch and created or updated nodes on the Git branch.

When a branch is requested, the config now turns the flag off.

Fixes #1295
Merge stable into develop
Passing a RelatedNode (for example a peer taken from another node's
relationship) to a cardinality-many list, RelationshipManager.add(),
RelationshipManager.remove() or a cardinality-one assignment stored the
RelatedNode object itself as the peer ID. Saving then sent invalid
GraphQL and remove() matched nothing.

RelatedNodeBase now copies only the peer identifiers (id, hfid,
__typename, kind, display_label) from another RelatedNodeBase, which
replaces the cardinality-one special case in _init_relationships.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Both callers passed self.node, so _reload_kwargs() now reads it and no
caller can pass a different node. The check that the node has an id
moves into the method from both fetch() methods; fetch() still raises
UninitializedError before any request.

Declare node on RelationshipManagerBase as optional, and with the
specific node type on each subclass, the same way as infrahub-develop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge stable into develop
…1427)

* chore(agents): suggest running Infrahub CI for changes Infrahub uses

The CI of this repository does not run Infrahub's own tests, which use the
SDK from the python_sdk submodule. A rule for files under infrahub_sdk/ asks
the agent to suggest a draft, do-not-merge pull request in opsmill/infrahub
before such a change is merged, and a guide lists the steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(agents): fix the commands and scope of the Infrahub CI guide

The guide's gh pr create command had no body, so it failed outside a
terminal. The up-to-date check read the submodule HEAD instead of the
pinned commit, and the rule for other base branches matched Infrahub
stable for every SDK branch. The rule now also loads for pyproject.toml,
whose dependencies Infrahub resolves, and AGENTS.md keeps only the
ask-first entry so the when-to-suggest text lives in the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(agents): say to check huge-runner-gate before reading backend results

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Merge stable into develop
…-iprqa

fix: honour a requested branch when default_branch_from_git is enabled
…7b9d4

fix(sdk): fix fetch() on relationships that were not loaded
Merge stable into develop
…infrahub-develop-1440

# Conflicts:
#	docs/docs/python-sdk/sdk_ref/infrahub_sdk/node/relationship.mdx
#	infrahub_sdk/node/node.py
#	infrahub_sdk/node/relationship.py
#	tests/unit/sdk/test_client.py
#	uv.lock
`develop` moved the cardinality-one peer identifier stripping out of
`_init_relationships` and into `RelatedNodeBase.__init__`, where it also
covers cardinality-many lists, `add()` and `remove()`. `infrahub-develop`
kept the old block and added the `present` flag and the `_bind()` call
around it.

Take the removal from `develop` and keep the binding from
`infrahub-develop`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Each branch added `RelationshipManagerBase._reload_kwargs` on its own, so
the merge left two definitions of it and the second shadowed the first.

The merged method keeps all three behaviours:

- It reads `self.node` and raises `UninitializedError` when the manager
  has no node or the node has no `id`, from `develop`.
- It reloads with `only` when the node itself was read with `only`, from
  `infrahub-develop`.
- It passes `populate_store=False` on both paths, so the narrow copy it
  reads does not replace the stored node, from `develop`.

Both call sites now read the hoisted `reload_kwargs` local and no longer
pass the node.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both branches added statements to `__init__`, and together they put it
over the 50 statement limit ruff enforces. `_peer_input()` now narrows
another related node to its peer identifiers and `_is_peer_node()` holds
the lazy import that detects a peer node instance.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`infrahub-develop` added `read_fixture` and `develop` added
`GitRepoManager` and `change_directory`, each on the same import line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both branches resolved the lockfile against a different `requires-python`
and a different set of extras. Regenerated from the merged
`pyproject.toml`, which widens `requires-python` to `<3.16` and keeps the
extras `infrahub-develop` restructured. No package version changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Each branch documented a different exception under `fetch`. Regenerated
from the merged docstrings, which list both.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added group/ci Issue related to the CI pipeline type/documentation Improvements or additions to documentation labels Oct 23, 2026
@polmichel polmichel changed the title Merge develop into infrahub-develop Manual merge develop into infrahub-develop Oct 23, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 021597e
Status: ✅  Deploy successful!
Preview URL: https://1367f525.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pmi-merge-develop-infrahub-d-0i6s.infrahub-sdk-python.pages.dev

View logs

`develop` widened `requires-python` to `<3.16` and added 3.15 to the unit
test matrix. The lockfile kept the versions `infrahub-develop` had
resolved against `<3.15`, and they still satisfied the constraints in
`pyproject.toml`, so regenerating it did not move them. `uv sync` on 3.15
then had to build them from source and `pyarrow` 23.0.1 failed on cmake.

Upgrade the packages that publish no cp315 wheel to the versions
`develop` already locks: pyarrow, markupsafe, orjson, pydantic,
pydantic-core, regex, rpds-py and ujson, and psutil with them.

The versions left without a cp315 wheel are not built on 3.15: pyarrow
25.0.1 and rpds-py 0.30.0 are marked for Python below 3.11, pywin32 is
Windows only, and pyyaml and ruamel-yaml-clib build from their sdist at
the same versions `develop` runs green.

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

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                 Coverage Diff                  @@
##           infrahub-develop    #1450      +/-   ##
====================================================
+ Coverage             87.38%   87.44%   +0.05%     
====================================================
  Files                   154      154              
  Lines                 15257    15266       +9     
  Branches               2058     2059       +1     
====================================================
+ Hits                  13332    13349      +17     
+ Misses                 1369     1359      -10     
- Partials                556      558       +2     
Flag Coverage Δ
integration-tests 42.57% <71.42%> (-0.02%) ⬇️
python-3.10 61.79% <85.71%> (+0.08%) ⬆️
python-3.11 61.79% <85.71%> (+0.08%) ⬆️
python-3.12 61.79% <85.71%> (+0.08%) ⬆️
python-3.13 61.78% <85.71%> (+0.06%) ⬆️
python-3.14 61.78% <85.71%> (+0.07%) ⬆️
python-3.15 61.78% <85.71%> (?)
python-filler-3.12 23.11% <19.04%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/client.py 85.92% <ø> (ø)
infrahub_sdk/config.py 91.86% <100.00%> (+0.09%) ⬆️
infrahub_sdk/ctl/client.py 65.21% <100.00%> (+1.58%) ⬆️
infrahub_sdk/node/node.py 89.44% <ø> (-0.06%) ⬇️
infrahub_sdk/node/related_node.py 95.27% <100.00%> (+0.14%) ⬆️
infrahub_sdk/node/relationship.py 93.47% <100.00%> (+3.70%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

polmichel and others added 3 commits October 26, 2026 09:38
The previous commit also upgraded markupsafe, orjson, pydantic,
pydantic-core, regex, rpds-py, ujson and psutil, on the grounds that they
publish no cp315 wheel. Lacking a wheel only means uv builds them from
their sdist, which pyyaml and ruamel-yaml-clib already do on 3.15 without
failing, so those upgrades were never shown to be needed.

Keep the pyarrow upgrade, which the CI log named as the build that
failed, and let CI say whether anything else has to move.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Upgrading pyarrow alone was not enough: CI then failed on rpds-py 0.28.0,
whose PyO3 0.27.1 refuses to build against a Python newer than 3.14.

The packages that have to move are the ones binding Python through PyO3,
not every package without a cp315 wheel. The same log shows markupsafe,
regex, ujson, pyyaml and ruamel-yaml-clib compiling from their sdist on
3.15 without complaint, so they stay where they are.

Upgrade rpds-py, orjson and pydantic with pydantic-core, alongside the
pyarrow upgrade of the previous commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Resolving the uv.lock conflict by taking the destination version and
regenerating kept the versions infrahub-develop had pinned and dropped
the ones develop had moved. `uv lock` reads pyproject.toml and the
lockfile it is given, so regenerating from one side reproduces that
side's decisions rather than merging both.

Bring the merged lockfile up to the versions develop locks, for the
packages where develop is ahead: infrahub-testcontainers, markupsafe,
psutil, pywin32, regex and ujson.

Two versions stay off develop's. `ty` 0.0.74 is infrahub-develop's own
upgrade and is newer than develop's 0.0.14. `infrahub-testcontainers`
lands on 1.11.9, a patch released after both branches locked it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@polmichel
polmichel marked this pull request as ready for review October 26, 2026 09:49
@polmichel
polmichel requested a review from a team as a code owner October 26, 2026 09:49
@polmichel
polmichel merged commit 68a7732 into infrahub-develop Oct 26, 2026
32 checks passed
@polmichel
polmichel deleted the pmi-merge-develop-infrahub-develop-1440 branch October 26, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/ci Issue related to the CI pipeline type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants