component-detection icon indicating copy to clipboard operation
component-detection copied to clipboard

Investigate our use of `**` with `Dotnet.Glob`

Open JamieMagee opened this issue 3 years ago • 3 comments

I believe we are incorrectly using the ** pattern. We rolled back in #200, but would like to upgrade still.

Sources:

  • https://github.com/microsoft/component-detection/releases/tag/v1.2.1
  • https://github.com/microsoft/component-detection/pull/138
  • https://github.com/dazinator/DotNet.Glob/issues/65
  • https://github.com/dazinator/DotNet.Glob/commit/f1ee0efcc82c375e8124f08053190509eeb3de45

JamieMagee avatar Aug 16 '22 15:08 JamieMagee

The issue is here:

https://github.com/microsoft/component-detection/blob/0f3fa8a84488f6f8878532d1e5812580998a045e/src/Microsoft.ComponentDetection.Orchestrator/Services/DetectorProcessingService.cs#L188-L191

If we pass **/samples/** it throws IndexOutOfRangeException

Glob.Parse("**/samples/**").IsMatch("d:\\df\\samples") is a minimal example.

JamieMagee avatar Jan 05 '23 22:01 JamieMagee

Ideally most of these issues will be resolved after the changes from #1091 are merged.

cobya avatar May 15 '24 17:05 cobya