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

Dev mode: Match glob pattern file watches when detecting changes #25338

Open
knutwannheden opened this issue May 3, 2022 · 0 comments
Open
Labels
area/devmode env/windows Impacts Windows machines kind/enhancement New feature or request

Comments

@knutwannheden
Copy link
Contributor

Description

The merged PR #16005 added support for glob patterns in the watched file support of dev mode. As pointed out in the PR description, this only happens the first time:

One limitation of this implementation is that we look for matching file only the first time. A new file matching the glob pattern won't be watched once devmode is started. Should we look for matching file everytime?

So when Quarkus checks for files changed since the last restart, it won't find any new files matching the glob pattern, because the patterns are not matched again.

For some use cases (e.g. Flyway; see #25256) it would be nice if this limitation could be addressed, which would be the scope of this issue.

Implementation ideas

The current implementation always traverses the file system, when a watched file path isn't found. I think this can be improved by checking if the path even is a pattern (i.e. contains any wildcard characters). This would also slightly improve the status quo, as the tree walking would normally not be performed (I haven't found any uses of glob patterns in Quarkus core). So, also when checking for changes, the file system tree should only be walked for the watched files with glob patterns.

Additionally, I noticed that the glob pattern support doesn't appear to work correctly on Windows. Whenever a Path is constructed from a glob pattern a InvalidPathException is thrown. This requires some fixes to RuntimeUpdatesProcessor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode env/windows Impacts Windows machines kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant