Skip to content

Merge stable into develop#1077

Merged
polmichel merged 7 commits into
developfrom
stable
Jun 16, 2026
Merged

Merge stable into develop#1077
polmichel merged 7 commits into
developfrom
stable

Conversation

@infrahub-github-bot-app

@infrahub-github-bot-app infrahub-github-bot-app Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Merging stable into develop after merging pull request #1029.


Summary by cubic

Fix upsert edge cases: raise a clear ValidationError when allow_upsert=True and the HFID includes an unresolved CoreNumberPool attribute, and prevent clearing unfetched optional 1:1 relationships on save. Also detect .git gitlinks in worktrees so existing repos open instead of re-initializing and crashing.

  • Bug Fixes

    • Fail fast with ValidationError when upserting and the HFID includes a pool-sourced attribute; adds Attribute.is_unresolved_pool_attribute and docs with alternatives. (IHS-119)
    • Preserve optional one-cardinality relationships for nodes hydrated by from_graphql; only clear when explicitly set (e.g., node.rel = None).
    • Treat .git as existing when it’s a gitlink file in worktrees in GitRepoManager.initialize_repo; adds unit test.
  • Dependencies

    • Bump infrahub-testcontainers to 1.9.8 (dev).

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

Review in cubic

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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: b9bcd31
Status: ✅  Deploy successful!
Preview URL: https://bb566d12.infrahub-sdk-python.pages.dev

View logs

iddocohen and others added 4 commits June 15, 2026 07:10
…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
@polmichel polmichel marked this pull request as draft June 16, 2026 09:40
@polmichel polmichel merged commit f8bf7ca into develop Jun 16, 2026
21 of 22 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.

4 participants