feat(core): filter affected projects by glob pattern on tags #8364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISSUES CLOSED: #2675
Current Behavior
When running affected command you only get
all
affected projects that have the target running affected forExpected Behavior
Can filter affected projects by glob patterns so that you can run a target for all affected projects who have a tag
scope*
(for example)Example:
There are two apps in the project
client
andapi
they are configured like so:Let's say they share a lib
dtos
, if we make a change indtos
and then runnx affected:apps
it should print outclient
andapi
(currently).What if we have two different CI machines, one does everything for servers and one does everything for apps. With this PR we could do:
A more complex example and what spurred this is, we have the need for some of our docker containers to be built on ARM resources and some to be built on x86 resources (there are definitely different ways to do this but this is just the situation that spurred this). Each of our servers could be tagged with
arm
orx86
then we could doThe
tags
flag accepts a glob pattern so you could so something like--tags "scope:*"
to run a target on all affected projects that have ascope
tag as well.Currently the CLI will accept
--tags=tag1,tag2,scope*
and thenAND
them together so a project is required to have a tag that matches all of the glob tags passed in. Not sure if this would be better as anOR
or have it as anexclude
withAND
orOR
. Open to ideas here.Related Issue(s)
Fixes #2675