Merge 'stable' into 'develop' with resolved conflicts#1078
Draft
ogenstad wants to merge 4 commits into
Draft
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
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## develop #1078 +/- ##
===========================================
- Coverage 82.25% 81.88% -0.38%
===========================================
Files 135 135
Lines 11970 11701 -269
Branches 1789 1770 -19
===========================================
- Hits 9846 9581 -265
Misses 1573 1573
+ Partials 551 547 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Why
Resolve merge conflict between stable and develop
What changed
infrahub_sdk/node/attribute.pyConflict:
Resolution:
Summary by cubic
Fixes upsert when a node’s HFID includes a
CoreNumberPool-sourced attribute and makes repository detection work in Git worktrees. Users now get a clearValidationErrorinstead of an opaque backend error, and CLI flows work from worktrees.allow_upsert=Trueand the HFID uses a pool-backed attribute, raiseValidationErrorbefore sending a request. AddsAttribute.is_unresolved_pool_attribute()and_validate_upsert()inInfrahubNode, used bysave()/create(). Docs updated and tests added. Addresses Linear IHS-119..gitas a file (gitlink) or directory so an existing repo is opened instead of re-initialized in worktrees. Includes a new test for worktree setups.Written for commit f219cd8. Summary will update on new commits.