nx
nx copied to clipboard
feat(core): add support for tags with `(print-)affected(:*)` and `run-many`
Current Behavior
When running the (print-)affected(:*)
command you get all affected projects for a target.
With the run-many
command filtering is only possible with --projects
.
Both accept a --all
, it being warned for in affected
.
Expected Behavior
We would expect to be able to select projects by tags
.
This PR
This could be seen as a first step only acting to select projects in the same way --projects
does it for run-many
. Tags are not applied in compound but rather as OR
statement in comma separated fashion.
That is in the example below the command would select projects that either contain the tag sdk
or the tag app
, not necessarily projects containing both tags.
nx affected --tags=sdk,app --target=test
Related Issue(s)
This relates to very long standing #1621, #2675 or #8292 and a Nx v14 compatible treatment while being different from #8364 which attempts to support globs but does not address run-many
.
Closes #1621 Closes #2675
☁️ Nx Cloud Report
CI is running/has finished running commands for commit 5cf79d1e1f9dfe727cb8268300a73baea01b9dd9. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this branch
✅ Successfully ran 12 targets
-
nx affected --target=e2e --base=39518e33ba408f253e85f70e05c80ed0c500ab5b --head=5cf79d1e1f9dfe727cb8268300a73baea01b9dd9 --exclude=e2e-storybook,e2e-storybook-angular,e2e-react-native,e2e-detox,e2e-make-angular-cli-faster --parallel=1
-
nx affected --target=test --base=39518e33ba408f253e85f70e05c80ed0c500ab5b --head=5cf79d1e1f9dfe727cb8268300a73baea01b9dd9 --parallel=1
-
nx affected --target=build --base=39518e33ba408f253e85f70e05c80ed0c500ab5b --head=5cf79d1e1f9dfe727cb8268300a73baea01b9dd9 --parallel=3
-
nx-cloud record -- yarn depcheck
-
nx affected --target=lint --base=39518e33ba408f253e85f70e05c80ed0c500ab5b --head=5cf79d1e1f9dfe727cb8268300a73baea01b9dd9 --parallel=3
-
nx-cloud record -- yarn nx workspace-lint
-
nx-cloud record -- yarn check-lock-files
-
nx-cloud record -- yarn check-commit
-
nx-cloud record -- yarn nx format:check --base=39518e33ba408f253e85f70e05c80ed0c500ab5b --head=5cf79d1e1f9dfe727cb8268300a73baea01b9dd9
-
nx-cloud record -- yarn check-imports
-
nx-cloud record -- yarn documentation
-
nx build typedoc-theme
Sent with 💌 from NxCloud.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
nx-dev | ✅ Ready (Inspect) | Visit Preview | Nov 5, 2022 at 4:00PM (UTC) |
Hello @vsavkin ! I know you had interest in looking at this over the past few years. It is the second PR opened for this feature but it addressed things slightly differently. I am happy to bring any changes required, any feedback/direction is most welcome We have a lot of need for this in our company.
Thank you for your help and valuable time 🙏🏼 !
Any update on this? I would love to use it 😁 Also, I thought it might be worth adding this to print-affected
as well
I thought it might be worth adding this to
print-affected
as well
Hello ! The print-affected
command should already work out of the box with the changes proposed at it is considered a special branch of the affected
command and the project filtering gets done upstream of that.
https://github.com/nrwl/nx/blob/7f5137da84e5d0f1b31f9011c57fc0e3bfaa9252/packages/nx/src/command-line/affected.ts#L37
https://github.com/nrwl/nx/blob/7f5137da84e5d0f1b31f9011c57fc0e3bfaa9252/packages/nx/src/command-line/affected.ts#L79-L113
I can imagine there is latent question with regard to the use/semantic of --exclude
which only applies to project names. I do not necessarily have a set opinion on this. In effect a tag filtering can very much replace the use of --exclude
.
Would love to see this merged into Nx and my PR closed.
This would be a big QoL feature for us, would love to see this in the next release! Any indications when that might be?
Can't wait for this to be merged :smile:
pls
This would be a great QoL feature for our team 👍
@gioragutt
@gioragutt
Can you add some context to why you tagged me? 😅
My team and I are so excited about this feature please release it in next version :)