Skip to content

Rewrites no-response workflow to work with pr as well#185163

Merged
auto-submit[bot] merged 8 commits into
flutter:masterfrom
chunhtai:no-response
Apr 17, 2026
Merged

Rewrites no-response workflow to work with pr as well#185163
auto-submit[bot] merged 8 commits into
flutter:masterfrom
chunhtai:no-response

Conversation

@chunhtai

@chunhtai chunhtai commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

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-assist bot 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.

@gemini-code-assist gemini-code-assist Bot 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.

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.

Comment thread .github/scripts/no-response.js Outdated
Comment on lines +41 to +55
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.`);
}
}

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.

high

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.`);
          }
        }
      }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This also is the original behavior

Comment thread .github/scripts/remove-waiting-label.js Outdated
Comment on lines +11 to +15
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;
}

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.

medium

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;
    }
  }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

pull_request_review is from the reviewer. we only care about pr author's comment

@chunhtai chunhtai requested review from Piinks, jtmcdole and mdebbar April 16, 2026 17:41
name: No Response (Issue Comment)

on:
issue_comment:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder how bad this trigger is in terms of github quota

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we did this just on a cron, every 15 minutes, it would be 2880 runs, or 57% of last months runs.

Comment thread .github/workflows/no-response.yaml

@jtmcdole jtmcdole left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we did this just on a cron, every 15 minutes, it would be 2880 runs, or 57% of last months runs.

@chunhtai

Copy link
Copy Markdown
Contributor Author

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

Comment thread .github/scripts/no-response.js Outdated
module.exports = async ({ github, context }) => {
const owner = context.repo.owner;
const repo = context.repo.repo;
const labelName = 'waiting for customer response';

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.

Since this covers PRs now, should 'waiting for customer response' --> 'waiting for response'?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sgtm, will also need to update the existing label once this lands

@github-actions github-actions Bot added c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels. d: docs/ flutter/flutter/docs, for contributors labels Apr 16, 2026
@chunhtai chunhtai requested review from Piinks and jtmcdole April 16, 2026 20:30
@chunhtai chunhtai added the CICD Run CI/CD label Apr 16, 2026

@Piinks Piinks 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.

LGTM

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 17, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 17, 2026
Merged via the queue into flutter:master with commit a8eb8eb Apr 17, 2026
19 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 19, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 20, 2026
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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. CICD Run CI/CD d: docs/ flutter/flutter/docs, for contributors framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants