Skip to content

Add export-section command to CodeownersTool and CODEOWNERS section change detection to codeowners-linter pipeline#14208

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/add-codeowners-section-check
Draft

Add export-section command to CodeownersTool and CODEOWNERS section change detection to codeowners-linter pipeline#14208
Copilot wants to merge 1 commit intomainfrom
copilot/add-codeowners-section-check

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Two related changes to enable detection of modifications to protected CODEOWNERS sections in PRs.

azsdk config codeowners export-section (Issue 1)

New CLI-only subcommand under CodeownersTool that reads one or more named sections from a CODEOWNERS file and writes their content to a single output file. --section is required and multi-value; missing sections log an error and exit 1.

azsdk config codeowners export-section \
  --codeowners-path .github/CODEOWNERS \
  --section "Client Libraries" \
  --output /tmp/sections.txt

Uses the existing CodeownersSectionFinder.FindSection utility.

codeowners-linter.yml section change detection (Issue 2)

Inside the existing PR-only block:

  • Installs azsdk via install-azsdk-cli.yml (always latest)
  • Exports the Client Libraries section on the base branch → $(Build.ArtifactStagingDirectory)/codeowners-sections/before.txt
  • Exports the same section on the PR branch → .../after.txt
  • Fails the build if the two files differ

No new pipeline parameters; section names are hardcoded in the step commands.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add enforcement mechanism for CODEOWNERS file Add export-section command to CodeownersTool for CODEOWNERS section enforcement Feb 27, 2026
Copilot AI changed the title Add export-section command to CodeownersTool for CODEOWNERS section enforcement Add export-section command to CodeownersTool and protected-section enforcement to codeowners-linter pipeline Feb 27, 2026
Copilot AI changed the title Add export-section command to CodeownersTool and protected-section enforcement to codeowners-linter pipeline Define export-section command for azsdk-cli and CODEOWNERS section protection in codeowners-linter pipeline Feb 27, 2026
Copilot AI changed the title Define export-section command for azsdk-cli and CODEOWNERS section protection in codeowners-linter pipeline Add export-section command to CodeownersTool and CODEOWNERS section change detection to codeowners-linter pipeline Feb 27, 2026
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

Successfully merging this pull request may close these issues.

2 participants