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

fix(core): handle file renames properly for affected #15340

Merged
merged 1 commit into from Mar 1, 2023

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

Moving a file only affects the project it is moved to. This is because the underlying command to get the changed set of files does not include it:

~/p/nx-examples (test-affected-t|✔) $ git diff --relative "51431812739ffb159bf8aa0b40f4460f9aee5bfc" "HEAD" --name-only
libs/shared/product/ui/src/lib/+state/cart.actions.ts
libs/shared/product/ui/src/lib/+state/cart.reducer.spec.ts
libs/shared/product/ui/src/lib/+state/cart.reducer.ts
libs/shared/product/ui/src/lib/+state/cart.selectors.spec.ts
libs/shared/product/ui/src/lib/+state/cart.selectors.ts

Expected Behavior

Moving files affects both the project the file was moved to as well as the project the file was moved from. This is done by using the --no-renames flag. This will prevent git from collapsing the to and from file paths.

~/p/nx-examples (test-affected-t|✔) $ git diff --relative "51431812739ffb159bf8aa0b40f4460f9aee5bfc" "HEAD" --name-only --no-renames
libs/shared/cart/state/src/lib/+state/cart.actions.ts
libs/shared/cart/state/src/lib/+state/cart.reducer.spec.ts
libs/shared/cart/state/src/lib/+state/cart.reducer.ts
libs/shared/cart/state/src/lib/+state/cart.selectors.spec.ts
libs/shared/cart/state/src/lib/+state/cart.selectors.ts
libs/shared/product/ui/src/lib/+state/cart.actions.ts
libs/shared/product/ui/src/lib/+state/cart.reducer.spec.ts
libs/shared/product/ui/src/lib/+state/cart.reducer.ts
libs/shared/product/ui/src/lib/+state/cart.selectors.spec.ts
libs/shared/product/ui/src/lib/+state/cart.selectors.ts

Related Issue(s)

Fixes #13677

@vercel
Copy link

vercel bot commented Mar 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 1, 2023 at 8:52PM (UTC)

@FrozenPandaz FrozenPandaz merged commit 7aac67c into nrwl:master Mar 1, 2023
2 checks passed
FrozenPandaz added a commit that referenced this pull request Mar 2, 2023
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moving a File Does Not Trigger affected CLI for Source Project
2 participants