-
Notifications
You must be signed in to change notification settings - Fork 78
feat: skip_path
option in watch
#88
base: master
Are you sure you want to change the base?
Conversation
Add support for skip_path option Add tests Update README
@@ -154,6 +154,10 @@ Declare a list of | |||
- assets/images/email | |||
config: | |||
trigger: email-deploy | |||
- path: services/webhooks | |||
skip_path: services/webhooks/*.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what would be the best name for this tbh
@xzyfer could you take a look at this please? 🙂 TIA! |
@voluntadpear the capability proposed is valuable but a better approach would be to use a more robust globbing library with support for pattern negation i.e. https://github.com/gobwas/glob. That way we can consolidate all the matches in the |
Codecov Report
@@ Coverage Diff @@
## master #88 +/- ##
==========================================
- Coverage 78.48% 77.40% -1.08%
==========================================
Files 4 4
Lines 158 177 +19
==========================================
+ Hits 124 137 +13
- Misses 22 27 +5
- Partials 12 13 +1
Continue to review full report at Codecov.
|
@xzyfer I've taken a look at https://github.com/gobwas/glob/ and there's also a similar issue to the one of Also, it seems it hasn't been actively maintained for a while now. I've tried something like I saw that the turborepo team faced the same issue (vercel/turborepo#445) with What do you think? |
@voluntadpear Sorry for delay. how about we do something as below. Option 1: add a new property we do something like
Basically allow the path to be either Option 2: add a new property like you suggested but rename it to I prefer option1 though |
Just to offer some encouragement - this would be really useful to have! 🙏 |
Hi! Any news on this? We'd greatly need it, let me know if I can contribute to anything in order to speed up the integration |
This PR adds support for specifying a
skip_path
option that support either a path or a list of paths that shouldn't result in adding thetrigger
step as part of the dynamically generated pipeline.Note even in cases where a line in the
diff
is skipped due toskip_path
and there are other paths in thediff
that matchpath
but doesn't matchskip_path
, the step will still be added to the dynamically generated pipeline. i.e. for the step to be effectively ignored, the paths inskip_path
should match all of those in the givendiff
.Motivation
The motivation for this is the lack of support for negation cases in
doublestar
(the package used for glob pattern matching) See bmatcuk/doublestar#49.I had a use case where I needed to avoid changes in certain subdirectories to trigger a step (if there were the only changes in the diff) and I tried to use the following pattern:
path: "/main/{*,!(subdir1|subdir2)/**/*}"
which should be a valid glob for filtering outsubdir1
andsubdir2
, but didn't work.With this, I could instead do something like:
and the result would be the same.