Skip to content

Add automated PR review workflow for PRs filed in the last 3 days#22629

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/review-open-pr-comments
Draft

Add automated PR review workflow for PRs filed in the last 3 days#22629
Copilot wants to merge 2 commits intomasterfrom
copilot/review-open-pr-comments

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 26, 2026

No mechanism existed to automatically flag incomplete PR descriptions for recently opened PRs against the repository template.

Changes

.github/workflows/pr_auto_review.yml

  • Runs daily at 08:00 UTC (also manually triggerable via workflow_dispatch)
  • Accepts a days_back input (default: 3) to control the review window
  • Requires only pull-requests: write + issues: write permissions via GITHUB_TOKEN

.github/scripts/pr_auto_review.py

  • Fetches open PRs sorted newest-first; stops iteration once PRs exceed the cutoff age
  • Checks each PR body against the standard template sections:
    • ### Description of PR — non-empty, placeholder text replaced
    • ### Type of change — at least one [x] checked
    • #### What is the motivation for this PR? — has content
    • #### How did you do it? — has content
    • #### How did you verify/test it? — has content
  • Posts a comment listing any failing checks; posts a ✅ comment if all pass
  • Idempotent: detects prior bot comments via <!-- pr-auto-review-bot --> marker and skips already-reviewed PRs

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

Copilot AI changed the title [WIP] Review and comment on recent pull requests Add automated PR review workflow for PRs filed in the last 3 days Feb 26, 2026
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

Comment on lines +152 to +153
"The PR description looks complete. Thank you for filling in all the "
"required sections! :tada:",
Comment on lines +163 to +164
"Hi! The automated PR review found the following items that need "
"attention:",
Comment on lines +168 to +169
"Please update the PR description to address these points so that "
"reviewers have all the context they need.",
Comment on lines +171 to +173
"> *This comment was generated automatically by the PR review bot. "
"If you believe this is a false positive, please update the description "
"or ignore this comment.*",
# ---------------------------------------------------------------------------

# Checklist items that indicate an unchecked checkbox in markdown
_UNCHECKED_RE = re.compile(r"^\s*-\s*\[\s*\]", re.MULTILINE)
Copy link
Copy Markdown
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

AI agent on behalf of Ying: Reviewed. The workflow/script look reasonable for template enforcement and are idempotent. No issues spotted.

Copy link
Copy Markdown
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

Looks good. AI agent on behalf of Ying.

Copy link
Copy Markdown
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

LGTM. AI agent on behalf of Ying.

Copy link
Copy Markdown
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

Approved (AI agent on behalf of Ying). Workflow and script look reasonable for automated PR-template checks; permissions scoped to PRs/issues and idempotent comment marker used.

kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…lly (sonic-net#22629)

src/sonic-swss

* 43529026 - (HEAD -> 202405, origin/202405) [202405] Setting default nexthop weight to 1 in `fpmsyncd` (sonic-net#3648) (7 hours
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.

4 participants