[flutter-gold] Consider neutral checks completed (#5036)

Fixes https://github.com/flutter/flutter/issues/185832

This PR improves how Flutter Gold status updates are computed by
accounting for completed checks that end in a `NEUTRAL` conclusion
(alongside `SUCCESS`). It also streamlines logging and fortifies the
check status evaluation.

* Updates the evaluation logic so that PR checks ending in NEUTRAL are
no longer grouped alongside incomplete or failing tests.
* Added explicit status verification for check runs. If a check run does
not have the status 'COMPLETED', it is now safely and reliably
classified as incomplete.
* Moved the log.debug statement to only capture check runs that are
truly incomplete or failing, significantly reducing log output noise.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md

---------

Co-authored-by: John "codefu" McDole <john@mcdole.org>
Co-authored-by: John McDole <codefu@google.com>
2 files changed
tree: 793c0ff3c560ff6350ec84929164bb9c7fcd1f54
  1. .github/
  2. .vscode/
  3. analyze/
  4. app_dart/
  5. auto_submit/
  6. cipd_packages/
  7. cloud_build/
  8. conductor/
  9. dashboard/
  10. dev/
  11. licenses/
  12. packages/
  13. test_utilities/
  14. tooling/
  15. .ci.yaml
  16. .gitattributes
  17. .gitignore
  18. analysis_options.yaml
  19. CI_YAML.md
  20. cloudbuild_cron.yaml
  21. cocoon.code-workspace
  22. CODEOWNERS
  23. CONTRIBUTING.md
  24. cron.yaml
  25. devtools_options.yaml
  26. Dockerfile.app_dart
  27. Dockerfile.auto_submit
  28. Dockerfile.flutter
  29. flutter_image_build.yaml
  30. LICENSE
  31. pubspec.yaml
  32. README.md
  33. tests.yaml
README.md

Flutter CI Status SLSA 3

Cocoon is a Dart App Engine custom runtime (backend) with a frontend of Flutter apps (build and repository dashboard). Cocoon coordinates and aggregates the results of flutter/flutter builds.

It is not designed to help developers build Flutter apps.

Cocoon is not a Google product.

Using Cocoon

Forcing a refresh from GitHub

The server is driven by commits made to https://github.com/flutter/flutter repo. It periodically syncs new commits. If you need to manually force a refresh, query https://flutter-dashboard.appspot.com/api/refresh-github-commits.

You will need to be authenticated with Cocoon to do this.

Developing Cocoon

Cocoon has several components:

  • A server, which coordinates everything. This is a Dart App Engine application. If you have never used that before, you may want to peruse the samples for Dart App Engine. The server is found in app_dart.

  • A Flutter app (generally used as a Web app) for the build dashboards. The dashboard is found in dashboard.

Cocoon creates a checklist for each Flutter commit. A checklist is made of multiple tasks. Tasks are performed by LUCI bots.

Getting started

First, set up a Flutter development environment. This will, as a side-effect, provide you with a Dart SDK. Your life will be easier if you add that (.../flutter/bin/cache/dart-sdk/bin/) to your path.

To update the production server, you will need the Google Cloud SDK. Since there is no Dart SDK, we just use the command line tools.

Developing the server

All the commands in this section assume that you are in the app_dart/ directory.

Running a local dev server

dart bin/local_server.dart

This will output Serving requests at 0.0.0.0:8080 indicating the server is working.

New requests will be logged to the console.

Deploying a test version on Google Cloud

To run live tests, build the app, and provide instructions for deploying to Google App Engine, run this command:

dart dev/deploy.dart --project {PROJECT} --version {VERSION}

You can test the new version by accessing {VERSION}-dot-flutter-dashboard.appspot.com in your browser. If the result is satisfactory, the new version can be activated by using the Cloud Console UI: https://console.cloud.google.com/appengine/versions?project=flutter-dashboard&serviceId=default

Optional flags

--profile: Deploy a profile mode of dashboard application for debugging purposes.

--ignore-version-check: Ignore the version of Flutter on path (expects to be relatively recent)

Developing the dashboard

The dashboard application will use dummy data when it is not connected to the server, so it can be developed locally without a dev server.

To run the dashboard locally, go into the dashboard directory and run flutter run -d chrome --dart-define=FAKE_AUTH=true. The dashboard will be served from localhost (the exact address will be given on the console); copy the URL into your browser to view the application. (The dashboard should also be able to run on non-Web platforms, but since the Web is our main target that is the one that should generally be used for development.)

You can run flutter packages upgrade to update the dependencies. This may be necessary if you see a failure in the dependencies.