forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
474 stars 77 forks source link

Deployment preview incorrectly reports moved files #2941

Closed pkozuchowski closed 1 week ago

pkozuchowski commented 1 week ago

Summary

After moving files, sf project deploy preview reports all moved files under "Will Deploy", but in reality they are due to deletion.

Steps To Reproduce

1) Move files from one folder to another 2) Run sf project deploy preview 3) Check if files are under Deploy or Delete headers.

Expected result

Preview should say that files will be deleted.

Actual result

Preview says files will be deployed, but deployment will actually attempt to delete them.

Additional information

image image

System Information

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.46.6",
  "nodeVersion": "node-v18.18.2",
  "osVersion": "Windows_NT 10.0.22631",
  "rootPath": "C:\\Users\\piotr\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
  "shell": "cmd.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.2 (core)",
    "@oclif/plugin-commands 4.0.2 (core)",
    "@oclif/plugin-help 6.2.1 (core)",
    "@oclif/plugin-not-found 3.2.3 (core)",
    "@oclif/plugin-plugins 5.2.4 (core)",
    "@oclif/plugin-search 1.1.2 (core)",
    "@oclif/plugin-update 4.3.5 (core)",
    "@oclif/plugin-version 2.2.3 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.5 (core)",
    "@oclif/plugin-which 3.2.2 (core)",
    "@salesforce/cli 2.46.6 (core)",
    "apex 3.1.18 (core)",
    "auth 3.6.21 (core)",
    "data 3.4.6 (core)",
    "deploy-retrieve 3.9.4 (core)",
    "dev 2.1.12 (user) published 143 days ago (Sat Feb 03 2024) (latest is 2.3.4)",
    "info 3.3.6 (core)",
    "limits 3.3.12 (core)",
    "marketplace 1.2.12 (core)",
    "org 4.2.1 (core)",
    "packaging 1.22.1 (user) published 320 days ago (Thu Aug 10 2023) (latest is 2.6.1)",
    "schema 3.3.11 (core)",
    "settings 2.3.1 (core)",
    "sobject 1.4.11 (core)",
    "source 3.4.2 (core)",
    "telemetry 3.4.0 (core)",
    "templates 56.2.11 (core)",
    "trust 3.7.5 (core)",
    "user 3.5.13 (core)",
    "@salesforce/sfdx-scanner 3.21.0 (user) published 139 days ago (Tue Feb 06 2024) (latest is 3.25.0)",
    "sfdmu 4.32.2 (user) published 207 days ago (Thu Nov 30 2023) (latest is 4.33.17)"
  ]
}
github-actions[bot] commented 1 week ago

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.

shetzel commented 1 week ago

@pkozuchowski - It sounds like you want to use our new "source mobility" feature currently in beta. Just set the environment variable SF_BETA_TRACK_FILE_MOVES=true and move the files. The CLI handles it. No deployment is necessary since it's a client side "book keeping" action.

For more information see this discussion: https://github.com/forcedotcom/cli/discussions/2682 Also see recent CLI release notes: https://github.com/forcedotcom/cli/blob/main/releasenotes/README.md

Feel free to reopen if this doesn't solve the issue.