Skip to content

[cocoon] autosubmit triggers merge before all checks have completed in flutter/packages #191610

Closed

Description

@elliette

In a recent Flutter roll to flutter/packages (flutter/packages#12453), the Merge Queue Guard was marked as passing before the Dashboard Checks had completed. When the autosubmit label was added, the PR was then erroneously merged before all the checks had passed, leading to a flutter/packages tree closure.

Image

Activity

  1. ievdokdm commented on Aug 25, 2026

    @ievdokdm
    Contributor

    @elliette is Merge Queue Guard become green right after autosubmit label was added ?

  2. elliette commented on Aug 25, 2026

    @elliette
    MemberAuthor

    Based on the timestamps on flutter/packages#12453, it looks like autosubmit label was added before the Merge Queue Guard became green:

    engine-flutter-autoroll bot added autosubmit label at 4:57 PM:

    Image

    Merge Queue Guard went green at 5:36 PM:

    Image
  3. self-assigned this
    on Aug 25, 2026
  4. ievdokdm commented on Aug 25, 2026

    @ievdokdm
    Contributor

    The reason of this failure is due to infra issues the number or remaining_jobs in presubmit_guards table become 0 before all jobs are processed.
    The suggestion is to stop using failed_jobs == 0 and remaining_jobs == 0 condition to unlock Merge Queue Guard and instead check jobs map that all the jobs are in 'Succeeded' state.

  5. added
    P2Important issues not at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Aug 25, 2026
  6. elliette commented on Aug 26, 2026

    @elliette
    MemberAuthor

    This just happened again with flutter/packages#12627 (I added autosubmit before the checks had completed, and it was auto-merged immediately). Could we bump this up to a P1? Thank you!

  7. Piinks commented on Aug 26, 2026

    @Piinks
    Contributor

    cc @jtmcdole should this be P0/1? Changes are being merged before checks are completing

  8. jtmcdole commented on Aug 26, 2026

    @jtmcdole
    Member

    Merge Queue Guard going green

    It has always done this for non-merge queue projects (like flutter/packages).

    Autosubmit should look at all scheduled tests and not merge unless they are green. This should have included dashboard checks since it was in the failed state.

  9. jtmcdole commented on Aug 26, 2026

    @jtmcdole
    Member

    @ievdokdm - status "neutral" is considered a success.

    log link

    {"name":"Dashboard Checks","id":98249538743,"external_id":"","status":"completed","head_sha":"","check_suite":{"id":89374097924},"details_url":"https://flutter-dashboard.appspot.com/#/presubmit?repo=packages&sha=a50e83b5e4bdf7ad4b036127fea428452e1e9ed6","started_at":"2026-08-26T16:57:29.000Z","conclusion":"neutral"}
  10. jtmcdole commented on Aug 26, 2026

    @jtmcdole
    Member

    flutter/packages#12453 was merged at 17:58 - the logs show that Dashboard Checks was "success" - which comes from GitHub Checkruns.

    Autosubmit performed as expected here.

  11. added
    P1High-priority issues at the top of the work list
    on Aug 26, 2026
  12. ievdokdm commented on Aug 26, 2026

    @ievdokdm
    Contributor

    @jtmcdole flutter/packages#12453 was merged on August 13, but neutral status was landed on August 20 and flutter/packages#12627 was merged because of added emergency label

  13. 9 remaining items

  14. added
    P0Critical issues such as a build break or regression
    on Sep 17, 2026
  15. jtmcdole commented on Sep 17, 2026

    @jtmcdole
    Member

    Increasing priority.

  16. jtmcdole commented on Sep 17, 2026

    @jtmcdole
    Member
  17. ievdokdm commented on Sep 18, 2026

    @ievdokdm
    Contributor

    While I'm working on switching Dashboard Checks back to in progress instead of neutral, we can mark Merge Queue Guard as required check as a temporary solution.

  18. ievdokdm commented on Sep 21, 2026

    @ievdokdm
    Contributor

    @jtmcdole you marked Merge Queue Guard as required for packages repo, that should solve the issue. Now while I'm working on permanent solution of switching Dashboard Checks in progress we several options:

    1. Switch Dashboard Checks to neutral state once all failed jogs re-run but keep Merge Queue Guard in in-progress. Which improve usability (user can apply autosubmit label and have some kind of notification in github UI that jobs are running. See: Ergonomics of re-runs + autosubmit are worse under unified checks #191005);
    2. Keep Dashboard Checks in failed state. less usability but more error pruned solution;
    3. Do not fail Dashboard Checks but publish comment with error in PR;
    4. Do not fail Dashboard Checks but either create new Presubmit check and once first job failed and mark it as failed and if re-run all recreate it in in-progress state.
  19. eyebrowsoffire commented on Sep 21, 2026

    @eyebrowsoffire
    Contributor

    My feeling is that we should leave the Dashboard Checks in a failed state until we have a long-term solution (switching back to in-progress). Marking as neutral just seems like the wrong thing here, as it unblocks the check. The Merge Queue Guard is temporarily mitigating this problem in the packages repo, but since the neutral status actually changes the check to non-blocking, it seems like too much of a footgun. I think it's important that Dashboard Checks blocks merges if it fails first and foremost, regardless of whether Merge Queue Guard is present on the repo.

    I opened a PR that removes the neutral status change here: flutter/cocoon#5154

  20. elliette commented on Sep 21, 2026

    @elliette
    MemberAuthor

    Not sure if this is the same underlying cause - dashboard checks were marked as green here despite still running: flutter/packages#12959

    (Again, causing autosubmit to erroneously submit the PR)

    Dashboard here

  21. Piinks commented on Sep 21, 2026

    @Piinks
    Contributor

    Yeah this one seemed a bit different. Filed details in #193132

  22. Piinks commented on Sep 21, 2026

    @Piinks
    Contributor

    The MQG did not block it then because it was definitely reporting green

  23. eyebrowsoffire commented on Sep 22, 2026

    @eyebrowsoffire
    Contributor

    I merged flutter/cocoon#5154 yesterday, which deployed today, which makes it so that Dashboard Checks no longer is marked as neutral on re-run, so we shouldn't have to rely on the MQG anymore. Whether that would have prevented #193132 I guess depends on whether "rerun" was clicked.

  24. eyebrowsoffire commented on Sep 28, 2026

    @eyebrowsoffire
    Contributor

    We've put fixes to mitigate the original issue here, so we're going to close this one.

    The issue with the checks being green while in progress can be tracked here: #193132

  25. github-actions commented on Oct 12, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  26. locked as resolved and limited conversation to collaborators on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressionteam-infraOwned by Infrastructure teamtriaged-infraTriaged by Infrastructure team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions