Skip to content

Skip repository hooks during filtered bundle synthesis - #50898

Merged
pelikhan merged 7 commits into
mainfrom
copilot/filtered-bundle-generation-fix
Aug 6, 2026
Merged

Skip repository hooks during filtered bundle synthesis#50898
pelikhan merged 7 commits into
mainfrom
copilot/filtered-bundle-generation-fix

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Filtered bundle generation applies the patch in a temporary detached worktree, which invokes repository post-checkout (and apply-patch) hooks. In a Git LFS repository without git-lfs on PATH, git worktree add fails with This repository is configured for Git LFS but 'git-lfs' was not found on your path, and the handler surfaces this as Branch ... does not exist locally even though the branch and its patch are valid.

Changes

  • actions/setup/js/generate_git_bundle.cjs: allocate an empty temporary hooks directory and run the internal git worktree add, git am --3way, and git worktree remove with -c core.hooksPath=<empty-dir>; remove the directory alongside the worktree in finally.
  • actions/setup/js/generate_git_bundle.test.cjs: regression test against real Git that installs a post-checkout hook exiting 2 and requires incremental filtered bundle generation to succeed.
  • Changeset: patch entry.
const tempHooksDir = fs.mkdtempSync(path.join(os.tmpdir(), "gh-aw-filtered-bundle-hooks-"));
const noHooksArgs = ["-c", `core.hooksPath=${tempHooksDir}`];
execGitSync([...noHooksArgs, "worktree", "add", "--detach", tempWorktree, baseCommitSha], { cwd });
execGitSync([...noHooksArgs, "am", "--3way", patchResult.patchPath], { cwd: tempWorktree });

Only these internal synthesis operations bypass hooks; user-facing checkout/commit paths are untouched.


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.3 AIC · ⊞ 5.9K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 6, 2026 15:34
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix filtered bundle generation checkout hooks reporting Skip repository hooks during filtered bundle synthesis Aug 6, 2026
@pelikhan
pelikhan marked this pull request as ready for review August 6, 2026 15:41
Copilot AI balanced review requested due to automatic review settings August 6, 2026 15:41
Copilot AI requested a review from pelikhan August 6, 2026 15:44
@pelikhan

pelikhan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/matt

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@pelikhan

pelikhan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/matt

Configure an explicit hooks path and cover both checkout and apply-patch hooks during filtered bundle synthesis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8b1aefe0-3e9e-499c-9774-09013c02c74a
@pelikhan
pelikhan marked this pull request as draft August 6, 2026 19:58
@pelikhan
pelikhan marked this pull request as ready for review August 6, 2026 19:58
@pelikhan

pelikhan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/matt

1 similar comment
@pelikhan

pelikhan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/matt

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please refresh this PR branch if needed and run the pr-finisher skill before handing back to maintainers. Copilot review previously errored; please retry triage and address any remaining feedback.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.3 AIC · ⊞ 5.9K ·
Comment /souschef to run again

@pelikhan

pelikhan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@copilot add git integration test

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add git integration test

Added a generateGitBundle hook bypass describe block to git_patch_integration.test.cjs (commit ce8b2f7). The test sets up a real git repository, installs a post-checkout hook that exits 2 (simulating absent git-lfs), and asserts that generateGitBundle in incremental mode still produces a valid bundle containing the expected refs.

@pelikhan
pelikhan merged commit 782af6a into main Aug 6, 2026
9 checks passed
@pelikhan
pelikhan deleted the copilot/filtered-bundle-generation-fix branch August 6, 2026 23:48
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot The latest request was addressed, but this PR still needs follow-through. Please refresh the branch if needed and run the pr-finisher skill before handing back to maintainers.

Generated by 👨🍳 PR Sous Chef · pi · gpt-5.4
Comment /souschef to run again

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.3 AIC · ⊞ 8.3K ·
Comment /souschef to run again

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.0

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.

Filtered bundle generation runs checkout hooks and misreports valid branches as missing

4 participants