Repository navigation
Conversation
…hed directory Patterns are made relative to the directory they are watched in (for example /var/tmp/chart/** becomes **), but events from every watched directory were matched against every pattern. A pattern such as ** from one path therefore matched all events from the other paths and restarted the command on unrelated changes. Track the base directory per pattern and per event and only match patterns with the same base. Resolves devspace-sh#3222 Signed-off-by: Srinivas Chippagiri <[email protected]>
✅ Deploy Preview for devspace-docs canceled.Built without sensitive environment variables
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What issue type does this pull request address?
/kind bugfix
What does this pull request do? Which issues does it resolve?
resolves #3222
run_watchmakes each pattern relative to the directory it is watched in (for example/var/tmp/chart/**becomes**with/var/tmp/chartas the watched directory). Events from all watched directories were then matched against all patterns, so**from one path matched every event from the other paths (e.g. everything under.whendevspace.yamlis also watched) and restarted the command on unrelated changes.Each pattern now keeps its base directory, each event carries the base it came from, and only patterns with the same base are matched (
matchesPatterns). Exclude handling is unchanged.Tested with
go test ./pkg/devspace/pipeline/engine/basichandler/commands/. The new table test fails if the base check is removed. I did not run the end-to-endrun_watchwith a real file watcher.Please provide a short message that should be published in the DevSpace release notes
Fixed an issue where
run_watchrestarted the command for changes that did not match any of the given--pathpatterns when several paths were watched.What else do we need to know?