Rewrites no-response workflow to work with pr as well#185163
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces two scripts for managing the 'waiting for customer response' label: no-response.js for closing stale issues and remove-waiting-label.js for clearing the label upon author activity. Feedback suggests optimizing no-response.js by using the updated_at property to reduce API calls and expanding remove-waiting-label.js to include the pull_request_review event.
| const events = await github.paginate(github.rest.issues.listEvents, { | ||
| owner, | ||
| repo, | ||
| issue_number: issue.number, | ||
| }); | ||
|
|
||
| const labelEvent = events.reverse().find(event => event.event === 'labeled' && event.label.name === labelName); | ||
|
|
||
| if (labelEvent) { | ||
| const labeledAt = new Date(labelEvent.created_at); | ||
| if (labeledAt < closeDate) { | ||
| shouldClose = true; | ||
| console.log(`Issue #${issue.number} has label added since 21 days.`); | ||
| } | ||
| } |
There was a problem hiding this comment.
Fetching all events for every issue with the label is inefficient and can lead to hitting GitHub API rate limits in a large repository like Flutter. Since issue.updated_at is updated whenever a label is added or a comment is made, you can use it as a preliminary check. If updated_at is older than 21 days, the label must have been added at least 21 days ago, allowing you to skip the expensive event fetching. You only need to fetch events if updated_at is recent to check if the specific label event itself is old.
const updatedAt = new Date(issue.updated_at);
if (updatedAt < closeDate) {
shouldClose = true;
console.log(`Issue #${issue.number} hasn't been updated since 21 days.`);
} else {
const events = await github.paginate(github.rest.issues.listEvents, {
owner,
repo,
issue_number: issue.number,
});
const labelEvent = events.reverse().find(event => event.event === 'labeled' && event.label.name === labelName);
if (labelEvent) {
const labeledAt = new Date(labelEvent.created_at);
if (labeledAt < closeDate) {
shouldClose = true;
console.log(`Issue #${issue.number} has label added since 21 days.`);
}
}
}There was a problem hiding this comment.
we don't want every types of update to postpone the issue or pr closure. I don't think there will be a lot event updates for an issue
There was a problem hiding this comment.
This also is the original behavior
| if (context.eventName === 'issue_comment' || context.eventName === 'pull_request_review_comment') { | ||
| const comment = context.payload.comment; | ||
| if (comment && comment.user.id === item.user.id) { | ||
| isResponse = true; | ||
| } |
There was a problem hiding this comment.
The script currently misses the pull_request_review event. If an author submits a top-level review (e.g., to respond to feedback or approve changes), the label should also be removed.
if (['issue_comment', 'pull_request_review_comment', 'pull_request_review'].includes(context.eventName)) {
const user = (context.payload.comment || context.payload.review).user;
if (user && user.id === item.user.id) {
isResponse = true;
}
}There was a problem hiding this comment.
pull_request_review is from the reviewer. we only care about pr author's comment
| name: No Response (Issue Comment) | ||
|
|
||
| on: | ||
| issue_comment: |
There was a problem hiding this comment.
I wonder how bad this trigger is in terms of github quota
There was a problem hiding this comment.
there's a few types of quota; the one I've been concerned with is Cocoon's secondary quota. This doesn't affect that. Instead this affects the team / organization action minutes.
no response is the second most run action, consuming 4,952 minutes last month with 4,944 runs.
There was a problem hiding this comment.
If we did this just on a cron, every 15 minutes, it would be 2880 runs, or 57% of last months runs.
jtmcdole
left a comment
There was a problem hiding this comment.
Could we combine these? Do we need to immediately remove the label or can it be 15 minutes?
e.g.
Every 15 minutes:
- Look for all issues / prs that are open
- Look if they have the label and record the time
- Look if the author has responded since the label was created - remove label
- Look if the label was added > 21 days; close
| name: No Response (Issue Comment) | ||
|
|
||
| on: | ||
| issue_comment: |
There was a problem hiding this comment.
there's a few types of quota; the one I've been concerned with is Cocoon's secondary quota. This doesn't affect that. Instead this affects the team / organization action minutes.
no response is the second most run action, consuming 4,952 minutes last month with 4,944 runs.
| name: No Response (Issue Comment) | ||
|
|
||
| on: | ||
| issue_comment: |
There was a problem hiding this comment.
If we did this just on a cron, every 15 minutes, it would be 2880 runs, or 57% of last months runs.
|
All done. run every 15 minutes, it either remove the label if there is qualified response, or close the issue/pr when it is >21 without qualified response |
| module.exports = async ({ github, context }) => { | ||
| const owner = context.repo.owner; | ||
| const repo = context.repo.repo; | ||
| const labelName = 'waiting for customer response'; |
There was a problem hiding this comment.
Since this covers PRs now, should 'waiting for customer response' --> 'waiting for response'?
There was a problem hiding this comment.
sgtm, will also need to update the existing label once this lands
flutter/flutter@8e8a194...2844af6 2026-04-19 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from bWoigpGIb60B6C7hD... to aDbXQm6WA0wFCAUp-... (flutter/flutter#185253) 2026-04-18 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from di3JdYrdE9OFu8Iyl... to bWoigpGIb60B6C7hD... (flutter/flutter#185231) 2026-04-18 rmolivares@renzo-olivares.dev Fix: text selection context menu should reappear after a non-fling scroll on Android and iOS (flutter/flutter#185054) 2026-04-18 flar@google.com Rect constructors for circle bounds (MakeCircle/EllipseBounds) (flutter/flutter#185110) 2026-04-17 97480502+b-luk@users.noreply.github.com Change uber SDF to get pixel size (for AA) using euclidean distance rather than manhattan distance. (flutter/flutter#184984) 2026-04-17 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c2564c18770 to 9648f446f131 (7 revisions) (flutter/flutter#185223) 2026-04-17 47866232+chunhtai@users.noreply.github.com Rewrites no-response workflow to work with pr as well (flutter/flutter#185163) 2026-04-17 15619084+vashworth@users.noreply.github.com Only use LLDB breakpoint in debug mode (flutter/flutter#185158) 2026-04-17 flar@google.com add playground to test SDF primitive rendering under transforms (flutter/flutter#185010) 2026-04-17 30870216+gaaclarke@users.noreply.github.com Adds sdf rrects (and fixes opacity + color source) (flutter/flutter#184999) 2026-04-17 matt.kosarek@canonical.com Implementation of popup windows for Win32 (flutter/flutter#184516) 2026-04-17 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185207) 2026-04-17 chris@bracken.jp [iOS] Update previousCompositionOrder to return Obj-C type (flutter/flutter#185136) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#11531) flutter/flutter@8e8a194...2844af6 2026-04-19 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from bWoigpGIb60B6C7hD... to aDbXQm6WA0wFCAUp-... (flutter/flutter#185253) 2026-04-18 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from di3JdYrdE9OFu8Iyl... to bWoigpGIb60B6C7hD... (flutter/flutter#185231) 2026-04-18 rmolivares@renzo-olivares.dev Fix: text selection context menu should reappear after a non-fling scroll on Android and iOS (flutter/flutter#185054) 2026-04-18 flar@google.com Rect constructors for circle bounds (MakeCircle/EllipseBounds) (flutter/flutter#185110) 2026-04-17 97480502+b-luk@users.noreply.github.com Change uber SDF to get pixel size (for AA) using euclidean distance rather than manhattan distance. (flutter/flutter#184984) 2026-04-17 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c2564c18770 to 9648f446f131 (7 revisions) (flutter/flutter#185223) 2026-04-17 47866232+chunhtai@users.noreply.github.com Rewrites no-response workflow to work with pr as well (flutter/flutter#185163) 2026-04-17 15619084+vashworth@users.noreply.github.com Only use LLDB breakpoint in debug mode (flutter/flutter#185158) 2026-04-17 flar@google.com add playground to test SDF primitive rendering under transforms (flutter/flutter#185010) 2026-04-17 30870216+gaaclarke@users.noreply.github.com Adds sdf rrects (and fixes opacity + color source) (flutter/flutter#184999) 2026-04-17 matt.kosarek@canonical.com Implementation of popup windows for Win32 (flutter/flutter#184516) 2026-04-17 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185207) 2026-04-17 chris@bracken.jp [iOS] Update previousCompositionOrder to return Obj-C type (flutter/flutter#185136) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
The original workflow uses a third party custom action. I rewrote it and also add support for pr that doesn't have comment or branch update for 21 days.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.