Skip to content

AI: Add daily open PR report workflow posting to Teams - #819

Draft
Subrata (subrata-ms) with Copilot wants to merge 5 commits into
mainfrom
copilot/implement-daily-pr-report-workflow
Draft

Subrata (subrata-ms) with Copilot wants to merge 5 commits into
mainfrom
copilot/implement-daily-pr-report-workflow

Conversation

Copilot AI commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds a scheduled job that reports every open pull request in microsoft/mssql-python to a Teams channel each morning at 09:00 IST, so maintainers get a daily review queue without polling GitHub.

.github/workflows/daily-pr-report.yml

  • cron: "30 3 * * *" (Actions cron is UTC; 03:30 UTC == 09:00 IST) plus workflow_dispatch for manual runs.
  • Minimal permissions: contents: read, pull-requests: read.
  • actions/checkout and actions/setup-python pinned to commit SHAs with version comments, matching the other workflows in this repo; persist-credentials: false.
  • Passes github.token, secrets.TEAMS_WEBHOOK_URL, and TARGET_REPO as env vars — no secrets in command arguments.

scripts/daily_pr_report.py

  • Paginates GET /repos/{repo}/pulls?state=open at 100/page with a bounded page loop, so large queues aren't truncated silently.
  • Builds the markdown report (total count, then number/title, author, yyyy-mm-dd created date, URL per PR); emits the exact single-line message when nothing is open.
  • Posts {"text": report} to the webhook, matching the payload shape already used by issue-notify.yml. The webhook URL is never logged — only the response status.
  • Fails fast with a clear log line on missing GITHUB_TOKEN/TEAMS_WEBHOOK_URL, and catches only requests.RequestException / ValueError per repo standards.

Report output:

## Daily mssql-python Open PR Report

**Total Open PRs: 2**

- **PR #123: Fix macOS dylib rpath**
  - Author: bewithgaurav
  - Created: 2026-09-18
  - URL: https://github.com/microsoft/mssql-python/pull/123

Empty case sends exactly Daily mssql-python report: No open pull requests found.

TEAMS_WEBHOOK_URL already exists as a repo secret (used by issue-notify.yml), so no new secret setup should be required — worth confirming the same webhook targets the intended channel for this report.

Copilot AI lite review requested due to automatic review settings September 25, 2026 10:32

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 wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI review requested due to automatic review settings September 25, 2026 10:34
Copilot AI changed the title [WIP] Add daily GitHub Actions workflow for PR reporting AI: Add daily open PR report workflow posting to Teams Sep 25, 2026

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

🟡 Changes recommended

Critical secret-exposure risks and moderate reliability/test gaps remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 2 Medium severity

Open (4)

Comment thread .github/workflows/daily-pr-report.yml Outdated
Comment thread scripts/daily_pr_report.py
)


def fetch_open_pull_requests(repo: str, token: str) -> List[Dict[str, Any]]:
Comment thread scripts/daily_pr_report.py Outdated
Copilot AI review requested due to automatic review settings September 25, 2026 10:40
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

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

🟡 Changes recommended

Four moderate findings remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
Resolved since last review (3)

Comment on lines +3 to +6
on:
schedule:
# 09:00 IST == 03:30 UTC (GitHub Actions cron is UTC only)
- cron: "30 3 * * *"
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.

3 participants