Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13862Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13862" |
There was a problem hiding this comment.
Pull request overview
This pull request enhances the pr-review-needed GitHub Actions workflow to more accurately track PRs awaiting reviewer feedback. The workflow now runs every 2 hours (previously manual-only), implements pagination for scalability, filters out bot/Copilot activities from consideration, and presents results in a clearer format with team and community PRs separated and age-based visual indicators.
Changes:
- Added scheduled execution every 2 hours and improved pagination handling for all API calls
- Enhanced PR review detection logic with timeline events, internal/external activity tracking, and bot/Copilot filtering
- Improved issue formatting with team/community split, colored age indicators (🔴🟡🟢), and clearer column headers
Comments suppressed due to low confidence (1)
.github/workflows/pr-review-needed.yml:118
- Bot PRs are skipped at line 70 with the condition pr.user.login.endsWith('[bot]'), but then lines 108-118 contain logic to handle bot PRs and extract the prompter. This code is unreachable because all bot PRs are filtered out earlier. Either remove the early bot filtering (line 70-72) to allow the bot PR logic to execute, or remove the unreachable bot PR handling code (lines 108-118). Based on the PR description mentioning "treat Copilot PRs as authored by the first non-Copilot assignee", it seems the intent is to keep bot PR handling, so the early filter should be more selective (e.g., only skip certain bots, not Copilot).
// Skip PRs created by bots
if (pr.user.login.endsWith('[bot]')) {
continue;
}
// Get reviews to check if PR is approved
const reviews = await getAllPages(github.rest.pulls.listReviews, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number
});
// Check if there's a current approval by looking at each reviewer's most recent review
// A reviewer might approve, then later request changes - we need the latest state
const reviewerStates = new Map();
for (const review of reviews) {
// Only consider meaningful review states (not COMMENTED or PENDING)
if (['APPROVED', 'CHANGES_REQUESTED', 'DISMISSED'].includes(review.state)) {
const reviewer = review.user.login.toLowerCase();
const existingReview = reviewerStates.get(reviewer);
const reviewDate = new Date(review.submitted_at);
if (!existingReview || reviewDate > existingReview.date) {
reviewerStates.set(reviewer, { state: review.state, date: reviewDate });
}
}
}
// PR is approved if at least one reviewer's latest state is APPROVED
const isApproved = Array.from(reviewerStates.values()).some(r => r.state === 'APPROVED');
if (isApproved) {
continue;
}
// Get the PR author
const prAuthor = pr.user.login;
// For Copilot-created PRs, check if there's a prompter
// Bot accounts have '[bot]' suffix in their username
const isBotPr = prAuthor.endsWith('[bot]');
// Get the prompter from the PR body if it's a bot PR
let prompter = null;
if (isBotPr && pr.body) {
// Look for patterns like "Triggered by @username" or "Requested by @username"
const prompterMatch = pr.body.match(/(?:triggered|requested|prompted)\s+by\s+@(\w+)/i);
if (prompterMatch) {
prompter = prompterMatch[1];
}
}
| tableContent += '### Community Contributions\n\n'; | ||
| tableContent += generatePRTable(communityPRs, 'No community PRs currently need review.'); | ||
|
|
||
| tableContent += '\n_This list is automatically updated every hour._'; |
There was a problem hiding this comment.
The message says "This list is automatically updated every hour" but the workflow is configured to run every 2 hours (cron: '0 */2 * * *'). The message should be updated to say "every 2 hours" to match the actual schedule.
| tableContent += '\n_This list is automatically updated every hour._'; | |
| tableContent += '\n_This list is automatically updated every 2 hours._'; |
|
@copilot a PR that has the |
|
@copilot In this PR for the workflow, if the PR being considered in the script has the |
|
We should also mark PRs that have merge conflicts in the output table. |
* Initial plan * Skip PRs with NO-MERGE label in pr-review-needed workflow Co-authored-by: radical <1472+radical@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: radical <1472+radical@users.noreply.github.com>
|
@copilot for any PRs being considered in the workflow, if the PR has merge conflicts then add an emoji like red cross next to the PR title in the generated table. |
* Initial plan * Add merge conflict indicator to PR review tracking When a PR has merge conflicts (mergeable_state === 'dirty'), a red cross emoji (❌) is now displayed next to the PR title in the generated tracking table. This helps reviewers quickly identify PRs that need conflict resolution before they can be merged. Co-authored-by: radical <1472+radical@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: radical <1472+radical@users.noreply.github.com>
|
@copilot In the workflow don't update the tracking issue if the workflow was run via a |
…to CI skip list (#13883) * Initial plan * Skip tracking issue update for manual workflow runs and skip CI for workflow changes Co-authored-by: radical <1472+radical@users.noreply.github.com> * Output markdown to console for manual workflow runs instead of skipping job Co-authored-by: radical <1472+radical@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: radical <1472+radical@users.noreply.github.com>
|
@copilot #12346 has merge conflicts but the script still found |
* Initial plan * Fix merge conflict detection by fetching individual PR details Co-authored-by: radical <1472+radical@users.noreply.github.com> * Improve merge conflict detection to handle all mergeable states Co-authored-by: radical <1472+radical@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: radical <1472+radical@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tldr; a workflow that runs every couple of hours and finds PRs that are waiting on feedback. It updates #13834 issue with results
This is a vibed experiment to learn about GH actions, and maybe solve a problem.
Changes:
This pull request makes significant improvements to the
pr-review-neededGitHub Actions workflow. The changes enhance the accuracy of PR review tracking, improve performance for large repositories, and make the resulting tracking issue more informative and user-friendly. The workflow now distinguishes between team and community PRs, uses more precise logic for determining when a PR needs review, and presents the data in a clearer format.Workflow logic and review detection improvements:
Performance and reliability enhancements:
getAllPages) to fetch all relevant data (PRs, comments, reviews, etc.), ensuring the workflow scales to large repositories with many PRs and activities.User experience and reporting improvements:
These changes collectively make the review-tracking process more accurate, scalable, and actionable for the team.