Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev-env): remove lando/compose/env directory when environment is destroyed #2181

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

sjinks
Copy link
Member

@sjinks sjinks commented Jan 3, 2025

Description

When we destroy an environment, docker compose files in ~/.local/share/vip/lando/compose/<env> remain. This may cause interesting bugs when an environment with the same name is created later.

This PR ensures that the directory is removed when the environment gets destroyed.

Pull request checklist

New release checklist

Steps to Test

  1. vip dev-env create -s test-env < /dev/null
  2. vip dev-env start -s test-env
  3. Ensure ~/.local/share/vip/lando/compose/testenv exists and contains .yml files
  4. vip dev-env destroy -s test-env
  5. Ensure ~/.local/share/vip/lando/compose/testenv is gone

@sjinks sjinks requested a review from Copilot January 3, 2025 18:26
@sjinks sjinks self-assigned this Jan 3, 2025

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/lib/dev-environment/dev-environment-core.ts:272

  • Ensure that the behavior of xdgDataDirectory() is covered by tests, specifically that it throws an error when the data directory cannot be determined.
await fs.promises.rm( path.join( xdgDataDirectory(), 'vip', 'lando', 'compose', slug ), {
Copy link
Contributor

github-actions bot commented Jan 3, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@sjinks sjinks force-pushed the remove-lando-compose-dir branch from a361e0e to c766ef2 Compare January 3, 2025 18:34
@sjinks sjinks force-pushed the remove-lando-compose-dir branch from c766ef2 to 9e85302 Compare January 3, 2025 18:37
@sjinks sjinks requested a review from Copilot January 3, 2025 18:37

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/lib/dev-environment/dev-environment-core.ts:273

  • Ensure that the directory removal behavior is covered by tests.
await fs.promises.rm(
Copy link

sonarqubecloud bot commented Jan 3, 2025

@sjinks sjinks merged commit 0a6d195 into trunk Jan 3, 2025
17 checks passed
@sjinks sjinks deleted the remove-lando-compose-dir branch January 3, 2025 20:06
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