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

moving a created field does not work (it tries to delete/insert) even when sf_beta_track_file_moves is set to true #3071

Open
defabien opened this issue Oct 20, 2024 · 5 comments
Labels
more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated

Comments

@defabien
Copy link

Expected result

when moving a field from one place to another, I expect tracking deploy to to something close to a noop

Actual result

when moving a field from one place to another, it tries to delete the field and insert it, resulting in errors when the field is being used

System Information

CLI:
@salesforce/cli/2.62.6 darwin-arm64 node-v20.17.0

Plugin Version:
@oclif/plugin-autocomplete 3.2.5 (core)
@oclif/plugin-commands 4.1.3 (core)
@oclif/plugin-help 6.2.14 (core)
@oclif/plugin-not-found 3.2.22 (core)
@oclif/plugin-plugins 5.4.14 (core)
@oclif/plugin-search 1.2.11 (core)
@oclif/plugin-update 4.6.3 (core)
@oclif/plugin-version 2.2.14 (core)
@oclif/plugin-warn-if-update-available 3.1.18 (core)
@oclif/plugin-which 3.2.15 (core)
@salesforce/cli 2.62.6 (core)
apex 3.5.1 (core)
api 1.3.1 (core)
auth 3.6.65 (core)
data 3.7.0 (core)
deploy-retrieve 3.12.17 (core)
info 3.4.9 (core)
limits 3.3.32 (core)
marketplace 1.2.26 (core)
org 4.6.0 (core)
packaging 2.8.11 (core)
schema 3.3.34 (core)
settings 2.3.23 (core)
signups 2.5.21 (user)
sobject 1.4.41 (core)
source 3.5.21 (core)
telemetry 3.6.15 (core)
templates 56.3.22 (core)
trust 3.7.33 (core)
user 3.5.32 (core)
SF ENV. VARS.
SF_BINPATH,/Users/fabien/.local/share/sf/client/bin/sf
SF_BETA_TRACK_FILE_MOVES,true
SF_AUTOUPDATE_DISABLE,true
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: false
Shell: zsh
Channel: stable

Diagnostics

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

@iowillhoit iowillhoit added the investigating We're actively investigating this issue label Oct 21, 2024
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.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Oct 21, 2024
@iowillhoit
Copy link
Contributor

iowillhoit commented Oct 22, 2024

Hey @defabien, I don't know exactly what you are trying to do based on the info you provided, but I am pretty sure this is working as designed.

Are you moving a custom field from one Object to another Object?

If you are moving a child type, the Parent has to have the same metadata type and Name. Otherwise it needs to deleted and added. If you happen to be moving from a child type from one Project directory to another and the Parent name and type are the same, it will properly track (commit to local source tracking) the move.

If that is not what you are doing, I need exact steps to replicate your findings. Thanks!

@defabien
Copy link
Author

defabien commented Oct 24, 2024

Hi @iowillhoit,

Thank you for your time!

To clarify; I'm not moving a field from one object to another, in that case I would of course understand the behavior.

The steps I can take to reproduce;

  1. sf ui: create an object TestObject__c
  2. sf cli: retrieve
  3. ide: TestObject__c appears in bar/main/default/objects (in which bar is the default project folder)
  4. ide: move TestObject__c folder to package folder foo/objects
  5. sf ui: create a field TestObject__c.TestField__c
  6. sf cli: retrieve
  7. ide: TestField__c.field-meta.xml appears in bar/main/default/objects/TestObject__c/fields
  8. ide: move TestField__c.field-meta.xml to foo/objects/TestObject__c/fields
  9. sf cli: deploy
  10. sf cli: does delete and create of TestField__c which often causes issues for obvious reasons. (used in class, etc, ...)

@iowillhoit
Copy link
Contributor

Hey @defabien, I am not seeing a "delete" when moving fields as you described. Here is a screencast, let me know if I missed something!

moving-fields.mov

@iowillhoit
Copy link
Contributor

@defabien Do you see anything that I missed in my screencast?

@WillieRuemmele WillieRuemmele added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants