Skip to content

fix(build): Stop shipping worktree checkouts as build context - #370

Merged
tyvsmith merged 2 commits into
mainfrom
fix/dockerignore-exclude-worktrees
Sep 8, 2026
Merged

fix(build): Stop shipping worktree checkouts as build context#370
tyvsmith merged 2 commits into
mainfrom
fix/dockerignore-exclude-worktrees

Conversation

@tyvsmith

@tyvsmith tyvsmith commented Sep 8, 2026

Copy link
Copy Markdown
Owner
  • exclude .worktrees/ and .claude/worktrees/ from the build context
  • target/ is root-anchored, so it never matched .worktrees/*/target/ or .claude/worktrees/*/target/; both roots live inside the main checkout and hold 508 GB today
  • verified with a fixture: with only target/ excluded, an exported image contained both nested target/ trees; with these two patterns it contained neither
  • builds run from inside a worktree are unaffected — the context root is that worktree, and a worktree holds no nested worktrees of its own

Summary by CodeRabbit

  • Chores
    • Updated container build exclusions to omit worktree directories located at the checkout root, while leaving similarly named directories elsewhere unaffected.

target/ is root-anchored, so it never matched .worktrees/*/target/ or
.claude/worktrees/*/target/. Both worktree roots live inside the main checkout,
so every build run from there streamed them as build context. They currently
hold 508 GB.

Verified against a fixture: with only target/ excluded, an exported image
contained .worktrees/wt1/target/big.bin and .claude/worktrees/wt2/target/big.bin;
with both patterns added it contained neither.

Builds run from inside a worktree are unaffected. Every recipe uses the current
checkout as its context root, and a worktree holds no nested worktrees, so the
patterns match nothing there.
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: da5e7d50-73c0-4646-8ce0-83c3df6056db

📥 Commits

Reviewing files that changed from the base of the PR and between bf85565 and 3177a22.

📒 Files selected for processing (1)
  • .dockerignore

📝 Walkthrough

Walkthrough

The Docker ignore configuration now uses root-anchored patterns for .worktrees/ and .claude/worktrees/.

Changes

Docker ignore rules

Layer / File(s) Summary
Root-anchored worktree exclusions
.dockerignore
Updated comments and changed worktree ignore patterns to apply only at the checkout root.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to bf855

Build contexts now omit nested worktree directories, preventing their contents from being sent to Docker builds. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: excluding worktree checkouts from the Docker build context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dockerignore-exclude-worktrees

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Excludes .worktrees/ and .claude/worktrees/ from the Docker build context to prevent 508 GB of nested target/ directories from being shipped. Verified with a fixture that both patterns are required; builds from within a worktree remain unaffected. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@tyvsmith
tyvsmith marked this pull request as ready for review September 8, 2026 01:06
Copilot AI lite review requested due to automatic review settings September 8, 2026 01:06

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.

🟢 Approval recommended

The change is small and scoped to build-context exclusion patterns, with only a minor doc/comment clarity tweak suggested.

Pull request overview

This PR reduces container build context size by excluding Git worktree checkouts that live inside the main repository checkout, preventing nested worktrees (and their artifacts) from being streamed into docker build/podman build contexts.

Changes:

  • Add .dockerignore rules to exclude .worktrees/ and .claude/worktrees/ from the build context.
File summaries
File Description
.dockerignore Excludes nested worktree directories from container build contexts to avoid shipping large unintended content.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .dockerignore Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@tyvsmith
tyvsmith merged commit e2622d5 into main Sep 8, 2026
13 of 14 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.

2 participants