Improve GitLab codeowners parsing - #11999
Conversation
|
@codex review |
|
@autotest review |
|
🎯 Code Coverage (details) 🔗 Commit SHA: 8bbf56a | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
More details
GitLab section support correctly combines owners across all matching sections while preserving GitHub CODEOWNERS "last-match-wins" behavior within sections. Section name merging (case-insensitive), owner inheritance from defaults, and malformed line handling all work as intended. GitHub-style CODEOWNERS files remain unaffected.
📊 Validated against 9 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 8bbf56a · What is Autotest? · Any feedback? Reach out in #autotest
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
There was a problem hiding this comment.
More details
PR extends CODEOWNERS parsing to support GitLab section syntax with proper owner inheritance and combination. Comprehensive code analysis and adversarial validation of critical scenarios—section merging, default owner inheritance, character-class pattern detection, and empty ownership handling—confirms implementation is correct. GitHub baseline behavior unchanged. No production defects detected.
📊 Validated against 10 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 8bbf56a · What is Autotest? · Any feedback? Reach out in #autotest
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bbf56a5c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SectionHeader header = entryBuilder.parseSectionHeader(); | ||
| if (header != null) { | ||
| sectionDefaultOwners = header.getDefaultOwners(); | ||
| String key = header.getName().trim().toLowerCase(Locale.ROOT); | ||
| currentSection = namedSections.computeIfAbsent(key, k -> new ArrayDeque<>()); |
There was a problem hiding this comment.
Preserve flat precedence for GitHub headings
When CodeownersProvider.build feeds a .github/CODEOWNERS or GitHub-style root file through this parser, bracketed headings that were previously ignored now switch currentSection. Because getOwners combines one winning match from every section, a file like * @all before [Docs] and docs/ @docs after it now returns both owners instead of the later docs/ rule winning, which breaks the stated unchanged GitHub behavior for files that use bracketed headings as ignored labels.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
although technically possible, the edge case is based on an incorrectly built github codeowners file while we don't have a good way of determining whether a file is intended for github or gitlab
| if (owners.isEmpty()) { | ||
| owners = sectionDefaultOwners; |
There was a problem hiding this comment.
Do not inherit defaults for exclusion entries
In a GitLab section with default owners and an exclusion line, this turns an ownerless exclusion such as !generated.rb into a default-owned entry. Since the existing ! matcher matches every path except the excluded one, that entry wins over earlier rules for normal files, while the excluded file falls through to earlier owners instead of being exempt, so sections using exclusions produce incorrect code-owner tags.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
addressing in a follow-up pr
b85908e
into
master
What Does This Do
Motivation
CODEOWNERS files using GitLab section syntax did not produce proper ownership for Test Optimization.
Additional Notes
CodeownersTesthas been migrated to JUnit5.test-environment-trigger: skip
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: SDCT-690