Conversation
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
Deploying infrahub-sdk-python with
|
| Latest commit: |
b9bcd31
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bb566d12.infrahub-sdk-python.pages.dev |
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging stable into develop after merging pull request #1029.
Summary by cubic
Fix upsert edge cases: raise a clear
ValidationErrorwhenallow_upsert=Trueand the HFID includes an unresolvedCoreNumberPoolattribute, and prevent clearing unfetched optional 1:1 relationships on save. Also detect.gitgitlinks in worktrees so existing repos open instead of re-initializing and crashing.Bug Fixes
ValidationErrorwhen upserting and the HFID includes a pool-sourced attribute; addsAttribute.is_unresolved_pool_attributeand docs with alternatives. (IHS-119)from_graphql; only clear when explicitly set (e.g.,node.rel = None)..gitas existing when it’s a gitlink file in worktrees inGitRepoManager.initialize_repo; adds unit test.Dependencies
infrahub-testcontainersto1.9.8(dev).Written for commit b9bcd31. Summary will update on new commits.