Repository navigation
Fix license scan exclusion regex to match ignore patterns at any depth - #6172
Conversation
The negative lookaheads for ignore patterns only checked the first path component after the repo root, but scancode --ignore matches directory names at any depth. For source-build-assets, exclusion paths like src/source-build-assets/src/externalPackages/... have an intermediate src/ directory, so the lookahead (?!externalPackages/) didn't filter them. Changed to (?!(?:.*/)?externalPackages/) to match at any depth. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Updates the license scan test’s exclusion-regex construction so additional --ignore directory patterns are treated as matching at any path depth (consistent with scancode behavior), preventing exclusions from being incorrectly marked unused for nested paths like src/source-build-assets/src/externalPackages/....
Changes:
- Adjust negative lookahead generation to match ignored directory names at any depth under the scan root.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/backport to release/10.0.1xx |
|
/backport to release/10.0.2xx |
|
Started backporting to |
|
/backport to release/10.0.3xx |
|
Started backporting to |
|
/backport to release/10.0.4xx |
|
Started backporting to |
|
Started backporting to |
|
I wanted to wait for a successful SDK diff run here to validate this is really working before backporting. So let's leave those opened PRs for now. |
The negative lookaheads for ignore patterns only checked the first path component after the repo root, but scancode
--ignorematches directory names at any depth. For source-build-assets, exclusion paths likesrc/source-build-assets/src/externalPackages/...have an intermediatesrc/directory, so the lookahead(?!externalPackages/)didn't filter them. Changed to(?!(?:.*/)?externalPackages/)to match at any depth.This fixes the issue with
source-build-assetspaths being removed from the exclusions file.Regression from #6009