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

"/**/*" behavior is unusual, effectively ".*$" rather than "/.*$" #558

Open
dagood opened this issue Jan 31, 2020 · 0 comments
Open

"/**/*" behavior is unusual, effectively ".*$" rather than "/.*$" #558

dagood opened this issue Jan 31, 2020 · 0 comments

Comments

@dagood
Copy link
Member

dagood commented Jan 31, 2020

The behavior of /**/* is defined here:

if (path.EndsWith("/**/*", StringComparison.OrdinalIgnoreCase))
{
string rootPath = path.Substring(0, path.Length - 5);
return modifiedFile.FullPath.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase);
}

This means /**/* matches file changes where the url starts with everything up to the /, exclusive. For example, release/3.0/**/* will match release/3.0/foo/bar but also, unexpectedly, release/3.0.5/foo/bar.

To work around the issue and make the pattern behave as expected, you must instead use //**/*. release/3.0//**/* will match release/3.0/foo/bar but not release/3.0.5/foo/bar.

This could be fixed. subscriptions.json is the only place this behavior is depended on, and it lives in this repo. A complication is is that the service reads subscriptions.json live, from GitHub, but the service must be manually deployed. (The service is deployed extremely rarely.)


Note that general glob patterns are not generally supported. /**/* is detected specifically. See #207 proposing more general support, or switching over to regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant