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

feat: handle file move then edit scenario #601

Merged
merged 8 commits into from
Jun 7, 2024
Merged

Conversation

mshanemc
Copy link
Contributor

@mshanemc mshanemc commented Jun 4, 2024

What does this PR do?

when a file is moved, but then also modified before doing preview|deploy|retrieve

before:

the hashes didn't match, so both the "add" and the "delete" were shown/used

after

the "add" is kept (ex: it would show up a something to deploy) but the "delete" is committed/cleared (it would not show up as something that needs deleting)

other

  • move to oclifv4 (STL only uses the Performance hook, which is now a standalone export)

What issues does this PR fix or reference?

@W-15840593@
forcedotcom/cli#2880

@mshanemc mshanemc requested a review from a team as a code owner June 4, 2024 19:56
@mshanemc mshanemc changed the title Sm/file-moves-again feat: handle file move then delete scenario Jun 4, 2024
@@ -73,7 +81,14 @@ export const getMatches = (status: StatusRow[]): AddedAndDeletedFilenames => {
return { added: addedFilenamesWithMatches, deleted: deletedFilenamesWithMatches };
};

/** build maps of the add/deletes with filenames, returning the matches Logs if non-matches */
export const getLogMessage = (matches: StringMapsForMatches): string =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the more complex result object, this made more sense to handle outside the ShadowRepo class

@mshanemc mshanemc changed the title feat: handle file move then delete scenario feat: handle file move then edit scenario Jun 4, 2024
@iowillhoit
Copy link
Contributor

QA NOTES

  • 🟢 Move files are not detected when SF_BETA_TRACK_FILE_MOVES is not set
  • 🟢 Single moved class are detected when SF_BETA_TRACK_FILE_MOVES=true
  • 🟢 Full object dir is detected
  • 🟢 Moving a decomposed md-child to a different parent is not detected as a move
    • 🟢 Moving it back clears tracking
  • 🟢 Moving and then editing a file commits the delete and shows the add
  • 🟢 Moved images are detected
  • 🟢 Moving an image and then editing it commits the delete and shows the add
  • 🟢 Moving a file out of the project directory shows as a delete
  • 🟢 Moving a full object dir AND editing one internal file:
    • 🟢 Commits the files that were just moved
    • 🟢 Commits the delete and shows the add of the file edited
  • 🟢 Editing a file (no move) shows as add
  • 🟢 Deleting a file (no move) shows as delete
  • 🟢 Copying a file to a new location shows as add as expected
  • 🟢 Nuts passing

Copy link
Contributor

@iowillhoit iowillhoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Will fix conflicts

@iowillhoit iowillhoit merged commit f8c3d86 into main Jun 7, 2024
33 checks passed
@iowillhoit iowillhoit deleted the sm/file-moves-again branch June 7, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants