Skip to content

Merge stable into develop#1077

Open
infrahub-github-bot-app[bot] wants to merge 3 commits into
developfrom
stable
Open

Merge stable into develop#1077
infrahub-github-bot-app[bot] wants to merge 3 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

Prevent opaque backend errors during upsert by rejecting save(allow_upsert=True) when the HFID depends on an unresolved CoreNumberPool attribute, raising a clear ValidationError. Also detect .git gitlinks in worktrees so existing repos open correctly instead of re-initializing and crashing.

  • Bug Fixes
    • Validate HFID before upsert and fail fast with ValidationError; add Attribute.is_unresolved_pool_attribute plus tests and docs outlining alternatives.
    • Use .exists() instead of .is_dir() for .git in GitRepoManager.initialize_repo to support worktrees; add unit test.

Written for commit 05ac997. 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: 05ac997
Status: ✅  Deploy successful!
Preview URL: https://291fdfe7.infrahub-sdk-python.pages.dev

View logs

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.

2 participants