Skip to content

API Review: Update ADO for pending API review state#47562

Open
tjprescott wants to merge 7 commits into
mainfrom
UpdateADOForPendingReview
Open

API Review: Update ADO for pending API review state#47562
tjprescott wants to merge 7 commits into
mainfrom
UpdateADOForPendingReview

Conversation

@tjprescott

@tjprescott tjprescott commented Jun 18, 2026

Copy link
Copy Markdown
Member

Blocked by: Azure/azure-sdk-tools#16044

This PR updates the create_api_review_pr.py script so that the review PR registers itself as a pending API review on the ADO work item.

It also introduces a Github Action that runs when an API Review PR is closed or opened to update the ADO work item.

@tjprescott tjprescott changed the title Update ado for pending review API Review: Update ADO for pending API review state Jun 18, 2026
@tjprescott tjprescott marked this pull request as ready for review June 22, 2026 19:46
@tjprescott tjprescott requested review from a team and danieljurek as code owners June 22, 2026 19:46
Copilot AI review requested due to automatic review settings June 22, 2026 19:46

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.

Pull request overview

This PR extends the standalone API-review-PR tooling so that opening/closing an API review PR keeps an Azure DevOps work item's pending-review state in sync. The Python script (create_api_review_pr.py) now fetches the package's ADO work item by package name and embeds its id in the PR body sync metadata, replacing the prior find-work-item/version-derivation approach. A new event-driven GitHub Actions workflow plus a Node helper read that metadata and add/remove the PR URL on the work item's Custom.PendingAPIReviews field on PR opened/closed/reopened. The PR is explicitly blocked by a corresponding azure-sdk-tools change that adds the azsdk package get-work-item/update-work-item CLI commands.

Changes:

  • Replace package_work_item_id/find-work-item logic with get_package_work_item using azsdk package get-work-item --package-name … -o json, and rename the preflight to ensure_azsdk_work_item_commands_available.
  • Add .github/workflows/manage-pending-api-reviews.yml (pull_request_target + workflow_call) and eng/common/scripts/manage-pending-api-reviews.js to update Custom.PendingAPIReviews from PR events.
  • Substantially expand the README and replace several Python tests (also dropping tests for still-existing architect/azsdk-resolution helpers).

Note: .github/skills/create-api-review-pr/SKILL.md (not in this PR) still references the old azsdk package find-work-item command; it likely needs a follow-up update for consistency with the renamed command.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/api_md_workflow/create_api_review_pr.py Swaps work-item lookup to get-work-item by package name; new PackageWorkItem dataclass and preflight rename. Bare "azsdk" call is inconsistent with the rest of the file's executable resolution.
scripts/api_md_workflow/create_api_review_pr_test.py Adds tests for the new functions but removes tests covering still-existing helpers, reducing coverage.
eng/common/scripts/manage-pending-api-reviews.js New Node helper that reads PR body metadata and updates the ADO pending-reviews field; minor naming/fallback nits.
.github/workflows/manage-pending-api-reviews.yml New privileged workflow driving ADO updates from PR events; pull_request_target + untrusted body metadata is a security consideration.
scripts/api_md_workflow/README.md Expanded documentation describing the new flow; consistent with the implemented commands.

Comment thread scripts/api_md_workflow/create_api_review_pr.py
Comment thread scripts/api_md_workflow/create_api_review_pr_test.py
Comment on lines +4 to +6
pull_request_target:
# Merged pull requests are delivered as the closed action with pull_request.merged == true.
types: [opened, closed, reopened]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Azure/azure-sdk-eng this seems very legit! Any recommendations on the best way to proceed?

Comment thread eng/common/scripts/manage-pending-api-reviews.js Outdated
Comment thread eng/common/scripts/manage-pending-api-reviews.js Outdated
@tjprescott tjprescott force-pushed the UpdateADOForPendingReview branch from 9db8d85 to f151633 Compare June 22, 2026 22:07
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