Skip to content

fix: Exclude Terraform and Terragrunt cache directories from checkpoints (#4601)#5750

Merged
mrubens merged 17 commits intoRooCodeInc:mainfrom
MuriloFP:fix/issue-4601-terraform-cache-exclusion
Jul 15, 2025
Merged

fix: Exclude Terraform and Terragrunt cache directories from checkpoints (#4601)#5750
mrubens merged 17 commits intoRooCodeInc:mainfrom
MuriloFP:fix/issue-4601-terraform-cache-exclusion

Conversation

@MuriloFP
Copy link
Contributor

@MuriloFP MuriloFP commented Jul 15, 2025

Related GitHub Issue

Closes: #4601

Roo Code Task Context (Optional)

N/A

Description

This PR adds .terraform/ and .terragrunt-cache/ directories to the checkpoint exclusion patterns, preventing these large cache directories from being included in snapshots.

Key Implementation Details:

  • Added two patterns to the getBuildArtifactPatterns() function in src/services/checkpoints/excludes.ts
  • Patterns are added in alphabetical order after .sass-cache/ to maintain consistency
  • These directories contain provider binaries and other large files that can be regenerated with terraform init

Impact:

  • Significantly reduces disk space usage for users working with Terraform/Terragrunt projects
  • Prevents checkpoint bloat (sometimes 10x reduction in size)
  • No breaking changes - purely additive exclusion patterns

Test Procedure

Manual Testing:

  1. Create a Terraform project without .terraform/ in .gitignore
  2. Run terraform init to download providers and create .terraform/ directory
  3. Make code changes in Roo Code to trigger checkpoint creation
  4. Verify that .terraform/ directory is excluded from the checkpoint
  5. Check checkpoint size remains small despite large provider binaries

Terragrunt Testing:

  1. Create a Terragrunt project
  2. Run terragrunt commands to generate .terragrunt-cache/ directory
  3. Create checkpoints in Roo Code
  4. Verify cache directory is excluded from snapshots

Verification:

  • Terraform configuration files (.tf, .tfvars) are still included in checkpoints
  • Terragrunt configuration files (.hcl) are still included
  • Only the cache directories are excluded

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - No UI changes

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required.

Additional Notes

This is a simple, low-risk change that adds two directory patterns to an existing exclusion list. The patterns follow the same format as other build artifact exclusions already in the codebase.

Get in Touch

@MuriloFP

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jul 15, 2025
@MuriloFP MuriloFP requested review from cte, jr and mrubens as code owners July 15, 2025 16:47
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 15, 2025
@MuriloFP MuriloFP moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jul 15, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 15, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

LGTM

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jul 15, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 15, 2025
@mrubens mrubens merged commit d513b9c into RooCodeInc:main Jul 15, 2025
20 checks passed
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jul 15, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 15, 2025
fxcl added a commit to Anabaai/Roo-Cline that referenced this pull request Jul 16, 2025
* main:
  fix: Resolve confusing auto-approve checkbox states (RooCodeInc#5602)
  fix: prevent empty mode names from being saved (RooCodeInc#5766) (RooCodeInc#5794)
  Format time in ISO 8601 (RooCodeInc#5793)
  fix: resolve DirectoryScanner memory leak and improve file limit handling (RooCodeInc#5785)
  Fix settings dirty check (RooCodeInc#5779)
  feat: increase Ollama API timeout values and extract as constants (RooCodeInc#5778)
  fix: Exclude Terraform and Terragrunt cache directories from checkpoints (RooCodeInc#4601) (RooCodeInc#5750)
  Move less commonly used provider settings into an advanced dropdown (RooCodeInc#5762)
  feat: Add configurable error & repetition limit with unified control (RooCodeInc#5654) (RooCodeInc#5752)
  list-files must include at least the first-level directory contents (RooCodeInc#5303)
  Update evals repo link (RooCodeInc#5758)
  Feature/vertex ai model name conversion (RooCodeInc#5728)
  fix(litellm): handle baseurl with paths correctly (RooCodeInc#5697)
  Add telemetry for todos (RooCodeInc#5746)
  feat: add undo functionality for enhance prompt feature (fixes RooCodeInc#5741) (RooCodeInc#5742)
  Fix max_tokens limit for moonshotai/kimi-k2-instruct on Groq (RooCodeInc#5740)
  Changeset version bump (RooCodeInc#5735)
  Add changeset for v3.23.12 patch release (RooCodeInc#5734)
  Update the max-token calculation in model-params to use the shared logic (RooCodeInc#5720)
  Changeset version bump (RooCodeInc#5719)
  chore: add changeset for v3.23.11 patch release (RooCodeInc#5718)
  Add Kimi K2 model and better support (RooCodeInc#5717)
  Fix: Remove invalid skip-checkout parameter from GitHub Actions workflows (RooCodeInc#5676)
  feat: add Cmd+Shift+. keyboard shortcut for previous mode switching (RooCodeInc#5695)
  Changeset version bump (RooCodeInc#5708)
  chore: add changeset for v3.23.10 patch release (RooCodeInc#5707)
  Add padding to the index model options (RooCodeInc#5706)
  fix: prioritize built-in model dimensions over custom dimensions (RooCodeInc#5705)
  Update CHANGELOG.md
  Changeset version bump (RooCodeInc#5702)
  chore: add changeset for v3.23.9 patch release (RooCodeInc#5701)
  Tweaks to command timeout error (RooCodeInc#5700)
  Update contributors list (RooCodeInc#5639)
  feat: enable Claude Code provider to run natively on Windows (RooCodeInc#5615)
  feat: Add configurable timeout for command execution (RooCodeInc#5668)
  feat: add gemini-embedding-001 model to code-index service (RooCodeInc#5698)
  fix: resolve vector dimension mismatch error when switching embedding models (RooCodeInc#5616) (RooCodeInc#5617)
  fix: [5424] return the cwd in the exec tool's response so that the model is not lost after subsequent calls (RooCodeInc#5667)
  Changeset version bump (RooCodeInc#5670)
  chore: add changeset for v3.23.8 patch release (RooCodeInc#5669)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Exclude Terraform and Terragrunt cache directories from checkpoints to reduce storage usage

4 participants