Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tracer/src/Datadog.Trace/Ci/CodeOwners.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ private static Regex CompileGlob(string pattern)
// Escape regex metachars first.
var rx = Regex.Escape(pattern);

// A globstar surrounded by slashes matches zero or more directories.
rx = rx.Replace("/\\*\\*/", "/(?:[^/]+/)*");

// Temporary sentinel for ** that we restore after dealing with single *.
rx = rx.Replace("\\*\\*", "§§DOUBLESTAR§§");
rx = rx.Replace("\\*", "[^/]*"); // single‑level wildcard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public CodeOwnersTests()
// New GitHub quirks
[InlineData("/x/logs/error.txt", "[\"@octo-org/octocats\"]")] // **/logs pattern
[InlineData("docs/getting-started.md", "[\"docs@example.com\"]")] // docs/* pattern
[InlineData("/globstar/target", "[\"@globstar-owner\"]")]
[InlineData("/globstar/one/target", "[\"@globstar-owner\"]")]
[InlineData("/globstar/one/two/target", "[\"@globstar-owner\"]")]
public void CheckGithubCodeOwners(string value, string expected)
{
var match = _githubCodeOwners.Match(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ apps/ @octocat
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty.
/apps/ @octocat
/apps/github
/apps/github

# A globstar between slashes matches zero or more directories.
/globstar/**/target @globstar-owner
Loading