Replies: 6 comments 32 replies
-
case 1: reorganizing files/dirs between project directories (ex: Because the org doesn't require changing, we'd detect that as a "move" and not count it as something that needs to be deployed/deleted. We'd be looking for deleted files that have the same sha as a created file, and we'd omit those from the changes (basically doing a commit to the local git repo to "clear" those changes. This would solve #2035 Vote this comment up if the use case is important to you. |
Beta Was this translation helpful? Give feedback.
-
case 2: renaming rename a file in place (ex: This does require a deploy, so that the name on the server gets fixed, too. We'd differentiate case 2 vs. case 1 because the sha is the same but the deleted file and the created file have different names. This one is going to be trickier to detect because
Vote this comment up if the use case is important to you. |
Beta Was this translation helpful? Give feedback.
-
There's also the question of "auto-detection" vs. "explicit intent". For example, git has If you're moving a file to a new place but have the same basename, we know that's Feel free to comment if you think this should require a specific command vs. trying to "figure it out". |
Beta Was this translation helpful? Give feedback.
-
I just tried moving an Apex class into a different folder. git mv force-app/tests/utils/TestDataBuilder.cls* force-app/tests/default/classes/utils/ When I try to do a push the result is as follows:
Presumably it thinks that because the original file isn't there, I want to remove the class and the result is the class is undeployed. It's evidently detected there are two copies of the file and reportd both are removed. Perhaps it can sense check what's going on here, two wrongs make a right - two removes of the same API name equals a rename? It's a real hassle for us to have to reset source tracking and do a push to correct the situation, because our code bases are large. This is a real time sync for us especially when we're talking about several large teams all being impacted simultaneously. In my opinion this is the single worst thing about the sf tooling which I implore the maintainers to fix as high priority. |
Beta Was this translation helpful? Give feedback.
-
Hey all 👋 We just shipped the automatic detection of moved files last night in the Details: during a "get git status", we perform several small incremental steps and exit as early as we can to not affect performance. The general flow of how this works is:
Let me know if you have any questions or if you come across any issues! The pull request for the feature is here: forcedotcom/source-tracking#574 |
Beta Was this translation helpful? Give feedback.
-
Note: Case # 1 (moving files, reorganizing) is addressed in version 2.44.8 (Jun 5, 2024) |
Beta Was this translation helpful? Give feedback.
-
we had issues open around renames and moves
and it comes up sometimes in conversations.
The CLI hasn't supported this well because the mdapi and source tracking don't have a clean way to indicate renamed/moved files. (to the server it's a delete of the first one and a create of the second).
Let's have a discussion so y'all can comment and upvote if this is a big deal to you vs other priorities and do some solutioning
Beta Was this translation helpful? Give feedback.
All reactions