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
Open
API Review Process: Add ADO Work Item metadata and assign architects to Review PRs at creation time#47534tjprescott wants to merge 2 commits into
tjprescott wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
⚠️ 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-itemintegration to capture and persistpackageWorkItemIdin 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does two main things:
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.
Adds an ARCHITECTS file to
.githubthat functions like CODEOWNERS (same format) but is only used for assigning reviews on API Review PRs.