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

Deleting scratch org should also delete corresponding source tracking files #1879

Closed
petter-eikeland opened this issue Jan 13, 2023 · 6 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@petter-eikeland
Copy link

Summary

When deleting a scratch org using sfdx force:org:delete, the corresponding source tracking files in the .sf/orgs directory should be deleted alongside the scratch org.

Steps To Reproduce:

  1. Create a scratch org
  2. Push (or deploy with source tracking) metadata from source to scratch org
  3. Delete scratch org

Expected result

Scratch org is deleted as well as the source tracking files in the corresponding .sf/orgs directory

Actual result

Scratch org (Org Id=1234) is deleted. Source tracking files for Org Id=1234 are still present in .sf/orgs directory

System Information

{
  "cliVersion": "sfdx-cli/7.183.1",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v18.12.1",
  "pluginVersions": [
    "@dxatscale/sfpowerscripts 20.5.2 (user)",
    "@eon-com/eon-sfdx 1.9.4 (user)",
    "@oclif/plugin-autocomplete 1.3.8 (core)",
    "@oclif/plugin-commands 2.2.2 (core)",
    "@oclif/plugin-help 5.1.20 (core)",
    "@oclif/plugin-not-found 2.3.13 (core)",
    "@oclif/plugin-plugins 2.1.8 (core)",
    "@oclif/plugin-search 0.0.6 (core)",
    "@oclif/plugin-update 3.0.9 (core)",
    "@oclif/plugin-version 1.1.4 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.18 (core)",
    "@oclif/plugin-which 2.2.6 (core)",
    "1commerce 0.0.10 (user)",
    "alias 2.1.14 (core)",
    "apex 1.3.0 (core)",
    "auth 2.3.8 (core)",
    "community 2.0.18 (core)",
    "config 1.4.22 (core)",
    "custom-metadata 2.0.5 (core)",
    "data 2.1.19 (core)",
    "generator 2.0.13 (core)",
    "info 2.3.1 (core)",
    "limits 2.2.0 (core)",
    "org 2.2.20 (core)",
    "packaging 1.12.2 (core)",
    "schema 2.2.2 (core)",
    "signups 1.2.12 (core)",
    "source 2.3.12 (core)",
    "telemetry 2.0.5 (core)",
    "templates 55.1.0 (core)",
    "trust 2.2.4 (core)",
    "user 2.1.24 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
    "salesforce-alm 54.8.5 (core)",
    "sfdmu 4.23.2 (user)",
    "sfpowerkit 6.0.1 (user)"
  ],
  "osVersion": "Darwin 21.6.0",
  "shell": "zsh",
  "rootPath": "/Users/user/.local/share/sfdx/client/7.183.1-3a2f5ba"
}
@petter-eikeland petter-eikeland added the investigating We're actively investigating this issue label Jan 13, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@WillieRuemmele WillieRuemmele added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Jan 13, 2023
@git2gus
Copy link

git2gus bot commented Jan 13, 2023

This issue has been linked to a new work item: W-12375821

@petter-eikeland
Copy link
Author

petter-eikeland commented Jan 21, 2023

Thank you for a swift response!

I assume this won't cover the case where the scratch orgs expire without being deleted. Thus, if I'm allowed to add a requirement it would be to also delete the same source tracking files for expired scratch orgs when running sfdx force:org:list --clean

@shetzel
Copy link
Contributor

shetzel commented Jan 23, 2023

@petter-eikeland - The current fix would cover the usecase of running sfdx force:org:list --clean since it also calls Org.remove(), which is where the fix is being applied.

@shetzel
Copy link
Contributor

shetzel commented Jan 26, 2023

UPDATE: This is fixed in the current CLI release candidate, v7.186.0 which will be promoted in a week.

@petter-eikeland
Copy link
Author

Tested the functionality with the newest release candidate, both with sfdx force:org:delete and sfdx force:org:list --clean. Works like a charm 👏 Thank you for very helpful and swift resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants