Skip to content

Manual merge stable into develop#1082

Merged
polmichel merged 9 commits into
developfrom
merge-stable-into-develop-20260616
Jun 16, 2026
Merged

Manual merge stable into develop#1082
polmichel merged 9 commits into
developfrom
merge-stable-into-develop-20260616

Conversation

@polmichel

@polmichel polmichel commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Supersedes #1077, which was blocked on merge conflicts.

Summary

Merges stable into develop, bringing in the IHS-119 upsert/numberpool fix, the unfetched optional 1:1 relationship preservation fix, the .git gitlink worktree detection fix, and the infrahub-testcontainers 1.9.8 dev bump.

Conflicts resolved

  • infrahub_sdk/node/attribute.pydevelop (94559a0, IHS-183) removed the CoreNodeBase import and switched the pool checks to duck-typed hasattr(self.value, "is_resource_pool"); stable added a new is_unresolved_pool_attribute method still written against isinstance(self.value, CoreNodeBase). Kept develop's refactored is_from_pool_attribute and ported the new method to the hasattr style so it doesn't reference the now-unimported CoreNodeBase. (f7c5109)

All other files (node.py, related_node.py, repository.py, tests, uv.lock, changelog fragments, SDK-ref docs) auto-merged cleanly.

Conflicts raised for review

None — the single conflict was a mechanical consistency port of a refactor.

Validation

  • ruff check on all changed modules
  • ty + mypy on attribute.py
  • ✅ 253 unit tests pass (tests/unit/sdk/pool, test_node.py, test_repository.py)
  • ✅ SDK-ref doc attribute.mdx confirmed in sync (regeneration produced no diff)

Not run locally: CLI docs-generate (pre-existing typer/click env incompatibility, unrelated to this merge) and integration tests (require a running stack) — both will run in CI.

🤖 Generated with Claude Code


Summary by cubic

Merge stable into develop to bring in number pool upsert safeguards, preserve unfetched optional 1:1 relationships on save, add worktree-aware repo detection, and bump a dev dependency.

  • Bug Fixes

    • Upsert with CoreNumberPool in HFID: raise ValidationError before network when HFID depends on an unresolved pool value; supports explicit id or create-then-update flow; updates docs and SDK ref (IHS-119).
    • Preserve optional 1:1 relationships when unfetched: only clear on explicit node.rel = None; prevents silent nulling from partial GraphQL payloads.
    • Repository worktrees: detect .git gitlink files to open existing repos instead of re-initializing.
  • Dependencies

    • Bumped infrahub-testcontainers to 1.9.8.

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

Review in cubic

petercrocker and others added 9 commits May 16, 2026 15:45
GitRepoManager.initialize_repo() checked for `.git` with `.is_dir()`, which
misses git worktrees (`.git` is a file containing `gitdir: ...`). The
existing-repo branch was skipped and `Repo.init` then crashed with
`FileExistsError` trying to mkdir the gitlink file. This made `infrahubctl
transform` (and any other CLI relying on branch auto-detection) unusable from
a worktree.

Switch the check to `.exists()` — dulwich's `Repo(path)` already resolves
the gitlink to the real controldir, and `porcelain.active_branch` returns
the worktree's branch correctly.
fix(repository): detect existing repo when .git is a worktree gitlink
…on upsert

A node hydrated by `from_graphql` from a partial response would silently null-clear
any optional cardinality-one relationship the response did not fetch, because the
serialization gate could not distinguish "never loaded" from "explicitly cleared".

Add `_peer_has_been_mutated` on `RelatedNodeBase`, flipped by `Node.__setattr__` on
explicit assignment, and require it in the gate. Mirrors the existing
`value_has_been_mutated` pattern on attributes.
)

Bumps [infrahub-testcontainers](https://github.com/opsmill/infrahub) from 1.9.7 to 1.9.8.
- [Release notes](https://github.com/opsmill/infrahub/releases)
- [Changelog](https://github.com/opsmill/infrahub/blob/stable/CHANGELOG.md)
- [Commits](opsmill/infrahub@infrahub-v1.9.7...infrahub-v1.9.8)

---
updated-dependencies:
- dependency-name: infrahub-testcontainers
  dependency-version: 1.9.8
  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>
…ched-rels

fix(node): preserve unfetched optional one-cardinality relationships on upsert
…evelop-20260616

# Conflicts:
#	infrahub_sdk/node/attribute.py
develop (94559a0) removed the CoreNodeBase import and switched to duck-typed
hasattr(self.value, "is_resource_pool") checks. stable added the new
is_unresolved_pool_attribute method still using isinstance(self.value, CoreNodeBase).
Keep develop's refactored is_from_pool_attribute and port the new method to the
hasattr style so it doesn't reference the now-unimported CoreNodeBase.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Jun 16, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: f7c5109
Status: ✅  Deploy successful!
Preview URL: https://b61ef1ab.infrahub-sdk-python.pages.dev
Branch Preview URL: https://merge-stable-into-develop-20.infrahub-sdk-python.pages.dev

View logs

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@             Coverage Diff             @@
##           develop    #1082      +/-   ##
===========================================
- Coverage    82.25%   81.88%   -0.37%     
===========================================
  Files          135      135              
  Lines        11970    11706     -264     
  Branches      1789     1770      -19     
===========================================
- Hits          9846     9586     -260     
  Misses        1573     1573              
+ Partials       551      547       -4     
Flag Coverage Δ
integration-tests 41.66% <74.07%> (-0.80%) ⬇️
python-3.10 55.28% <77.77%> (-0.66%) ⬇️
python-3.11 55.28% <77.77%> (-0.64%) ⬇️
python-3.12 55.27% <77.77%> (-0.67%) ⬇️
python-3.13 55.27% <77.77%> (-0.67%) ⬇️
python-3.14 55.28% <77.77%> (-0.64%) ⬇️
python-filler-3.12 22.39% <11.11%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/node/attribute.py 100.00% <100.00%> (ø)
infrahub_sdk/node/node.py 87.47% <100.00%> (+0.58%) ⬆️
infrahub_sdk/node/related_node.py 91.05% <100.00%> (+0.04%) ⬆️
infrahub_sdk/repository.py 100.00% <100.00%> (ø)

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

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

No issues found across 13 files

Re-trigger cubic

@polmichel polmichel marked this pull request as ready for review June 16, 2026 08:29
@polmichel polmichel requested a review from a team as a code owner June 16, 2026 08:29
@polmichel polmichel changed the title Merge stable into develop Manual merge stable into develop Jun 16, 2026
@polmichel polmichel merged commit 9d42f09 into develop Jun 16, 2026
21 checks passed
@polmichel polmichel deleted the merge-stable-into-develop-20260616 branch June 16, 2026 22:01
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