Skip to content

API Review Process: Add ADO Work Item metadata and assign architects to Review PRs at creation time#47534

Open
tjprescott wants to merge 2 commits into
mainfrom
AssociateADOWorkItem
Open

API Review Process: Add ADO Work Item metadata and assign architects to Review PRs at creation time#47534
tjprescott wants to merge 2 commits into
mainfrom
AssociateADOWorkItem

Conversation

@tjprescott

Copy link
Copy Markdown
Member

This PR does two main things:

  1. Retrieves the ADO Package Work Item at the time of Review PR creation and stores it in the PR metadata block. This will be used by future phases.

  2. Adds an ARCHITECTS file to .github that functions like CODEOWNERS (same format) but is only used for assigning reviews on API Review PRs.

Copilot AI review requested due to automatic review settings June 16, 2026 19:29
@tjprescott tjprescott requested review from a team, benbp, danieljurek and l0lawrence as code owners June 16, 2026 19:29
@tjprescott tjprescott requested a review from kashifkhan June 16, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Not ready to approve

The workflow currently makes azsdk a hard prerequisite even when work item metadata is optional and uses fnmatch semantics that can diverge from CODEOWNERS-style matching, potentially requesting incorrect reviewers.

Pull request overview

This PR enhances the API review PR creation workflow by (a) enriching the PR body sync metadata with the related ADO package work item ID and (b) automatically requesting API architecture reviewers based on a new .github/ARCHITECTS ownership map.

Changes:

  • Adds azsdk package find-work-item integration to capture and persist packageWorkItemId in the hidden PR metadata block.
  • Introduces .github/ARCHITECTS (CODEOWNERS-like) and requests matching GitHub users as reviewers when the API review PR is created/reused.
  • Expands unit tests to cover azsdk lookup, ARCHITECTS resolution, and reviewer assignment behaviors.
File summaries
File Description
scripts/api_md_workflow/create_api_review_pr.py Adds azsdk work item lookup, ARCHITECTS parsing, and GitHub reviewer-request logic.
scripts/api_md_workflow/create_api_review_pr_test.py Adds coverage for new work item and architect assignment behavior.
.github/skills/create-api-review-pr/SKILL.md Updates skill prerequisites/flow to account for azsdk-driven work item lookup.
.github/ARCHITECTS Adds CODEOWNERS-style mapping for API architecture reviewer assignment.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 5

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment on lines 1258 to +1261
def main(argv: list[str] | None = None) -> int:
args = parse_args(argv or sys.argv[1:])
ensure_azsdk_find_work_item_available()

Comment on lines +1382 to +1386
package_work_item_id_value = None
if sync_working_branch_info(working_selector, args.package_name):
package_work_item_id_value = package_work_item_id(
args.package_name, target_version
)
Comment on lines +955 to +956
if package_work_item_id_value:
metadata["packageWorkItemId"] = package_work_item_id_value
Comment on lines +567 to +571
def write_simple_yaml(file_path: Path, metadata: dict[str, str]) -> None:
existing_text = file_path.read_text(encoding="utf-8") if file_path.exists() else ""
line_ending = "\r\n" if "\r\n" in existing_text else "\n"
file_path.write_text(
line_ending.join(f"{key}: {metadata[key]}" for key in sorted(metadata))
Comment on lines +705 to +710
if normalized_pattern.endswith("/"):
directory_pattern = normalized_pattern.rstrip("/")
return normalized_path == directory_pattern or normalized_path.startswith(
f"{directory_pattern}/"
)
return fnmatch.fnmatchcase(normalized_path, normalized_pattern)
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