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

Source Mobility fails when multiple `All.listView-meta.xml` source files are moved at the same time #2945

Open VivekMChawla opened 4 days ago

VivekMChawla commented 4 days ago

Summary

Source Mobility is not properly detecting that moving multiple objects between package directories is not a source change when All.listView-meta.xml source files are part of the collection of files being moved.

from one Package Directory to another as part of a exhibits unexpected behavior when Source Mobility is enabled (i.e. SF_BETA_TRACK_FILE_MOVES=true)

Steps To Reproduce

  1. Ensure the SF_BETA_TRACK_FILE_MOVES env var is set to true
  2. Create an SFDX project with two packageDirectories defined
    1. defaultPackageDir
    2. otherPackageDir
  3. Create a default scratch org for the project
  4. Create two custom objects, each with multiple fields
    1. ObjectOne__c
    2. ObjectTwo__c
  5. Retrieve all source with sf project retrieve start
  6. Ensure the retrieved object source folders in defaultPackageDir/main/default/objects each has a listViews/All.listView-meta.xml source file
  7. Move BOTH object source folders from defaultPackageDir/main/default/objects to otherPackageDir/main/objects
  8. Run sf project deploy preview

Expected result

No conflicts found.

No files will be deleted.

No files will be deployed.

No files were ignored. Update your .forceignore file if you want to ignore certain files.

Actual result

Warning: Files were found that have the same basename and hash. Skipping the commit of these files
Warning: Files were found that have the same basename and hash. Skipping the commit of these files

No conflicts found.

No files will be deleted.

Will Deploy [4] files.
 Type     Fullname        Path                                                                                  
 ──────── ─────────────── ───────────────────────────────────────────────────────────────────────────────────── 
 ListView ObjectOne__c.All sfdx-source/otherPackageDir/main/objects/ObjectOne__c/listViews/All.listView-meta.xml 
 ListView ObjectOne__c.All sfdx-source/otherPackageDir/main/objects/ObjectOne__c/listViews/All.listView-meta.xml 
 ListView ObjectTwo__c.All sfdx-source/otherPackageDir/main/objects/ObjectTwo__c/listViews/All.listView-meta.xml 
 ListView ObjectTwo__c.All sfdx-source/otherPackageDir/main/objects/ObjectTwo__c/listViews/All.listView-meta.xml 

No files were ignored. Update your .forceignore file if you want to ignore certain files.

Additional information

System Information

CLI:
@salesforce/cli/2.48.6 darwin-x64 node-v20.10.0

Plugin Version:
@oclif/plugin-autocomplete 3.1.4 (core)
@oclif/plugin-commands 4.0.4 (core)
@oclif/plugin-help 6.2.3 (core)
@oclif/plugin-not-found 3.2.6 (core)
@oclif/plugin-plugins 5.3.2 (core)
@oclif/plugin-search 1.1.5-dev.1 (user)
@oclif/plugin-update 4.4.3 (core)
@oclif/plugin-version 2.2.4 (core)
@oclif/plugin-warn-if-update-available 3.1.6 (core)
@oclif/plugin-which 3.2.4 (core)
@salesforce/cli 2.48.6 (core)
apex 3.2.0 (core)
auth 3.6.27 (core)
data 3.5.2 (core)
deploy-retrieve 3.9.9 (core)
dev 2.3.1 (user)
devops-center 1.2.13 (user)
env 3.0.30 (user)
info 3.3.11 (core)
limits 3.3.15 (core)
marketplace 1.2.17 (core)
org 4.3.0 (core)
packaging 2.6.1 (core)
schema 3.3.16 (core)
settings 2.3.6 (core)
sobject 1.4.14 (core)
source 3.4.8 (core)
telemetry 3.5.1 (core)
templates 56.3.0 (core)
trust 3.7.10 (core)
user 3.5.17 (core)
@salesforce/sfdx-scanner 3.25.0 (user)
SF ENV. VARS.
SF_AUTOUPDATE_DISABLE,true
SF_BETA_TRACK_FILE_MOVES,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: false
Shell: zsh
Channel: stable

Diagnostics

:white_check_mark: pass - salesforcedx plugin isn’t installed :white_check_mark: pass - you don't have any linked plugins :white_check_mark: pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org :white_check_mark: pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com :white_check_mark: pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/ :white_check_mark: pass - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion :white_check_mark: pass - [@salesforce/plugin-deploy-retrieve] default target DevHub max apiVersion matches default target org max apiVersion :x: warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches default target org max apiVersion :white_check_mark: pass - can access: https://appexchange.salesforce.com/services/data :white_check_mark: pass - can access: https://test.salesforce.com :white_check_mark: pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest :x: fail - [@salesforce/plugin-auth] CLI supports v2 crypto :white_check_mark: pass - using latest or latest-rc CLI version

github-actions[bot] commented 4 days 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.

git2gus[bot] commented 3 days ago

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