Skip to content

Restrict DevFlow PR reviews to internal contributors - #14503

Merged
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-internal-devflow-gating
Sep 29, 2026
Merged

SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-internal-devflow-gating

Conversation

@SergeyMenshykh

Copy link
Copy Markdown
Contributor

Motivation and Context

DevFlow currently starts PR reviews for all contributors. Align its review eligibility with Microsoft Agent Framework by checking membership in the internal developer team before running the review.

Description

  • Split the workflow into prepare_pr, team_check, and review jobs. The review runs only when the team check succeeds.
  • Check the PR author for automatic runs and the person starting the workflow for manual runs. Draft PRs follow the same eligibility check as other PRs.
  • Add a team-membership helper that uses the team slug supplied by DEVELOPER_TEAM, plus a team-check GitHub App token profile with member and PR read permissions.
  • Keep SK's existing spam/relevance check and DevFlow review steps.
  • Add tests for the membership helper and token profile, and include the helper in the automation test workflow's path filters.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

Copilot review overview

🔵 Needs a closer look

The security-sensitive gate still has excess permissions, and its live team and App configuration needs human validation.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR limits DevFlow pull request reviews to internal contributors while keeping the existing relevance check and review steps.

Changes:

  • Split review preparation, team eligibility, and review into separate jobs.
  • Add a team-membership helper and a read-only GitHub App token profile.
  • Add tests and update the automation test workflow’s path filters.
File Description
.github/​workflows/​github-automation-tests.yml Runs tests when the membership helper changes.
.github/​workflows/​devflow-pr-review.yml Gates reviews on team membership.
.github/​tests/​test_create_github_app_token.js Tests the new token permissions.
.github/​tests/​test_check_team_membership.js Tests eligibility behavior.
.github/​scripts/​check_team_membership.js Checks team membership.
.github/​actions/​github-app-token/​create-token.js Adds the team-check permission profile.
.github/​actions/​github-app-token/​action.yml Documents the new profile input.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/devflow-pr-review.yml
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@SergeyMenshykh
SergeyMenshykh merged commit c5868e5 into microsoft:main Sep 29, 2026
14 of 16 checks passed

This branch had an error being deployed

1 failed deployment
github-app-auth — 61b4e5ad Deployed Sep 29, 2026 by SergeyMenshykh via add_label #29162
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants