├── app_dart ├── .vscode │ └── settings.json ├── tool │ └── ensure_file ├── .gitignore ├── protofu.yaml ├── build.yaml ├── lib │ ├── protos.dart │ ├── ci_yaml.dart │ └── src │ │ ├── model │ │ ├── proto │ │ │ ├── protos.dart │ │ │ └── internal │ │ │ │ ├── github_webhook.pbenum.dart │ │ │ │ ├── scheduler.pbserver.dart │ │ │ │ ├── github_webhook.pbserver.dart │ │ │ │ ├── github_webhook.proto │ │ │ │ └── github_webhook.pbjson.dart │ │ ├── github │ │ │ ├── annotations.g.dart │ │ │ └── annotations.dart │ │ ├── google │ │ │ ├── grpc.g.dart │ │ │ └── firebase_jwt_claim.g.dart │ │ ├── bbv2_extension.dart │ │ ├── commit_ref.dart │ │ └── common │ │ │ └── firestore_extensions.dart │ │ ├── request_handlers │ │ ├── readiness_check.dart │ │ └── get_repos.dart │ │ ├── service │ │ ├── flags │ │ │ ├── ci_yaml_flags.g.dart │ │ │ ├── content_aware_hashing_flags.g.dart │ │ │ ├── consolidated_check_run_flow_flags.g.dart │ │ │ └── ci_yaml_flags.dart │ │ ├── exceptions.dart │ │ └── luci_build_service │ │ │ └── cipd_version.dart │ │ └── foundation │ │ ├── typedefs.dart │ │ └── providers.dart ├── analysis_options.yaml ├── test │ ├── src │ │ ├── utilities │ │ │ └── matchers.dart │ │ ├── request_handling │ │ │ ├── fake_pubsub.dart │ │ │ ├── fake_request_handler.dart │ │ │ └── request_handler_tester.dart │ │ ├── service │ │ │ ├── fake_firebase_jwt_validator.dart │ │ │ └── fake_get_files_changed.dart │ │ ├── delegate_matcher.dart │ │ └── model │ │ │ ├── _pr_check_run.dart │ │ │ └── _build_status_snapshot.dart │ └── model │ │ ├── firestore │ │ ├── commit_test.dart │ │ ├── github_gold_status_test.dart │ │ └── github_build_status_test.dart │ │ └── bbv2_extension_test.dart ├── config.yaml ├── integration_test │ ├── common.dart │ └── generate_jspb_test.dart ├── index.yaml ├── bin │ └── validate_scheduler_config.dart └── app.yaml ├── cipd_packages ├── ruby │ ├── cocoapods_version.txt │ ├── ruby_metadata.txt │ ├── third_party │ │ └── ruby_ship │ │ │ ├── README │ │ │ └── LICENSE.txt │ └── README.md ├── ktlint │ ├── ktlint_metadata.txt │ ├── README.md │ └── tools │ │ └── build.sh ├── device_doctor │ ├── tool │ │ ├── infra-dialog │ │ │ ├── .gitignore │ │ │ ├── infra-dialog.xcodeproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── infra-dialogUITests │ │ │ │ └── Info.plist │ │ ├── ensure_file │ │ ├── ensure_file_windows │ │ ├── build.bat │ │ └── build.sh │ ├── .gitignore │ ├── lib │ │ └── device_doctor.dart │ ├── pubspec.yaml │ ├── test │ │ └── src │ │ │ └── fake_ios_device.dart │ └── bin │ │ └── ios_debug_symbol_doctor.dart ├── codesign │ ├── analysis_options.yaml │ ├── tool │ │ ├── ensure_file │ │ └── build.sh │ ├── .gitignore │ ├── lib │ │ ├── codesign.dart │ │ └── src │ │ │ └── log.dart │ ├── pubspec.yaml │ └── bin │ │ └── verify.dart └── doxygen │ └── .gitignore ├── dashboard ├── analysis_options.yaml ├── assets │ ├── apple.png │ ├── linux.png │ ├── chromium.png │ ├── fuchsia.png │ ├── windows.png │ └── googleLogo.png ├── web │ ├── favicon.png │ ├── favicon-failure.png │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ └── Icon-maskable-512.png │ ├── flutter_bootstrap.js │ ├── .well-known │ │ └── apple-app-site-association │ └── manifest.json ├── tool │ ├── dashboard-stdout.png │ └── luci-failing-check.png ├── test │ ├── widgets │ │ ├── goldens │ │ │ ├── commit_box_test.idle.png │ │ │ ├── commit_box_test.open.png │ │ │ ├── task_grid_test.withL.png │ │ │ ├── task_grid_test.withSkips.png │ │ │ ├── task_grid_test.withoutL.png │ │ │ ├── task_grid_test.dev.origin.png │ │ │ ├── sign_in_button.authenticated.png │ │ │ ├── task_grid_test.dev.scroll_x.png │ │ │ ├── task_grid_test.dev.scroll_y.png │ │ │ ├── task_grid_test.dev.origin.dark.png │ │ │ ├── sign_in_button.not_authenticated.png │ │ │ ├── task_grid_test.dev.mouse_scroll_x.png │ │ │ ├── task_grid_test.dev.mouse_scroll_y.png │ │ │ ├── task_grid_test.dev.scroll_x.dark.png │ │ │ ├── task_grid_test.dev.scroll_y.dark.png │ │ │ ├── task_overlay_test.flaky_overlay_open.png │ │ │ ├── task_overlay_test.nondevicelab_open.png │ │ │ ├── task_overlay_test.flaky_overlay_closed.png │ │ │ ├── task_overlay_test.nondevicelab_closed.png │ │ │ ├── task_overlay_test.normal_overlay_closed.png │ │ │ ├── task_overlay_test.normal_overlay_open.png │ │ │ ├── task_grid_test.filterDefault.differentTypes.png │ │ │ └── task_grid_test.filterShowBringup.differentTypes.png │ │ ├── optional_image_test.dart │ │ └── commit_author_avatar_test.dart │ ├── goldens │ │ ├── build_dashboard.defaultPropertySheet.png │ │ └── build_dashboard.defaultPropertySheet.dark.png │ ├── utils │ │ ├── fake_flutter_app_icons.dart │ │ ├── mocks.dart │ │ ├── generate_commit_for_tests.dart │ │ ├── fake_url_launcher.dart │ │ └── output.dart │ └── rpc_model │ │ ├── branch_test.dart │ │ └── build_status_response_test.dart ├── devtools_options.yaml └── lib │ └── widgets │ ├── sign_in_button │ ├── sign_in_button.dart │ └── sign_in_button_native.dart │ ├── header_text.dart │ ├── app_bar.dart │ └── state_provider.dart ├── auto_submit ├── CHANGELOG.md ├── README.md ├── .dockerignore ├── .gitignore ├── build.yaml ├── analysis_options.yaml ├── test │ ├── utilities │ │ └── mocks.dart │ ├── src │ │ ├── service │ │ │ ├── fake_approver_service.dart │ │ │ └── fake_discord_notification.dart │ │ ├── validations │ │ │ ├── fake_validation_filter.dart │ │ │ ├── fake_mergeable.dart │ │ │ ├── fake_approval.dart │ │ │ └── fake_required_check_runs.dart │ │ ├── request_handling │ │ │ └── fake_authentication.dart │ │ └── action │ │ │ └── fake_revert_method.dart │ ├── model │ │ └── pull_request_change_type.dart │ ├── git │ │ └── cli_command_test.dart │ ├── validations │ │ └── base_commit_date_allowed_test_data.dart │ └── request_handling │ │ └── authentication_test.dart ├── lib │ ├── service │ │ ├── process_method.dart │ │ └── discord_notification.dart │ ├── exception │ │ ├── retryable_exception.dart │ │ └── configuration_exception.dart │ ├── foundation │ │ ├── typedefs.dart │ │ └── providers.dart │ ├── action │ │ └── revert_method.dart │ ├── model │ │ ├── pull_request_data_types.dart │ │ ├── discord_message.dart │ │ └── discord_message.g.dart │ ├── requests │ │ ├── readiness_check.dart │ │ ├── github_pull_request_event.g.dart │ │ └── github_pull_request_event.dart │ ├── git │ │ └── utilities.dart │ ├── server │ │ └── authenticated_request_handler.dart │ └── revert │ │ └── revert_discord_message.dart ├── app.yaml ├── pubspec.yaml └── cloudbuild_auto_submit.yaml ├── dev ├── githubanalysis │ ├── analysis_options.yaml │ ├── .gitignore │ ├── pubspec.yaml │ ├── bin │ │ └── githubanalysis.dart │ └── lib │ │ └── debug_http.dart ├── cocoon_code_health │ ├── README.md │ ├── pubspec.yaml │ └── lib │ │ └── src │ │ └── checks.dart ├── salt.minion.plist └── prs_to_main.sh ├── packages ├── cocoon_common │ ├── analysis_options.yaml │ ├── lib │ │ ├── cocoon_common.dart │ │ ├── is_release_branch.dart │ │ ├── src │ │ │ ├── internal.dart │ │ │ └── rpc_model │ │ │ │ ├── branch.g.dart │ │ │ │ ├── content_hash_lookup.dart │ │ │ │ ├── content_hash_lookup.g.dart │ │ │ │ ├── commit_status.dart │ │ │ │ ├── commit_status.g.dart │ │ │ │ ├── build_status_response.g.dart │ │ │ │ └── tree_status_change.dart │ │ └── is_dart_internal.dart │ ├── pubspec.yaml │ ├── test │ │ ├── is_dart_internal_test.dart │ │ ├── is_release_branch_test.dart │ │ └── severity_test.dart │ └── README.md ├── cocoon_server │ ├── analysis_options.yaml │ ├── lib │ │ ├── logging.dart │ │ ├── google_auth_provider.dart │ │ ├── access_client_provider.dart │ │ ├── big_query_pull_request_record.dart │ │ └── generate_github_jws.dart │ ├── README.md │ ├── build.yaml │ └── pubspec.yaml ├── cocoon_common_test │ ├── analysis_options.yaml │ ├── README.md │ ├── lib │ │ └── cocoon_common_test.dart │ └── pubspec.yaml ├── cocoon_server_test │ ├── analysis_options.yaml │ ├── README.md │ ├── build.yaml │ ├── pubspec.yaml │ ├── test │ │ └── test_logging_test.dart │ └── lib │ │ ├── mocks.dart │ │ └── fake_secret_manager.dart └── buildbucket-dart │ ├── .gitignore │ ├── pubspec.yaml │ ├── lib │ └── src │ │ └── generated │ │ ├── google │ │ ├── rpc │ │ │ ├── status.pbenum.dart │ │ │ └── status.pbjson.dart │ │ └── protobuf │ │ │ ├── any.pbenum.dart │ │ │ ├── empty.pbenum.dart │ │ │ ├── duration.pbenum.dart │ │ │ ├── timestamp.pbenum.dart │ │ │ ├── wrappers.pbenum.dart │ │ │ ├── field_mask.pbenum.dart │ │ │ ├── struct.pbserver.dart │ │ │ ├── duration.pbserver.dart │ │ │ ├── wrappers.pbserver.dart │ │ │ ├── timestamp.pbserver.dart │ │ │ ├── empty.pbjson.dart │ │ │ ├── field_mask.pbjson.dart │ │ │ ├── any.pbjson.dart │ │ │ ├── duration.pbjson.dart │ │ │ ├── timestamp.pbjson.dart │ │ │ └── struct.pbenum.dart │ │ └── go.chromium.org │ │ └── luci │ │ ├── buildbucket │ │ └── proto │ │ │ ├── step.pbenum.dart │ │ │ ├── task.pbenum.dart │ │ │ ├── launcher.pbenum.dart │ │ │ ├── notification.pbenum.dart │ │ │ ├── builder_common.pbenum.dart │ │ │ ├── builds_service.pbenum.dart │ │ │ ├── build.pbserver.dart │ │ │ ├── step.pbserver.dart │ │ │ ├── task.pbserver.dart │ │ │ ├── common.pbserver.dart │ │ │ ├── builder_common.pbserver.dart │ │ │ └── project_config.pbserver.dart │ │ ├── resultdb │ │ ├── proto │ │ │ └── v1 │ │ │ │ ├── common.pbenum.dart │ │ │ │ ├── artifact.pbenum.dart │ │ │ │ ├── resultdb.pbenum.dart │ │ │ │ ├── test_metadata.pbenum.dart │ │ │ │ ├── failure_reason.pbenum.dart │ │ │ │ ├── common.pbserver.dart │ │ │ │ ├── invocation.pbserver.dart │ │ │ │ └── predicate.pbserver.dart │ │ └── sink │ │ │ └── proto │ │ │ └── v1 │ │ │ ├── sink.pbenum.dart │ │ │ └── location_tag.pbenum.dart │ │ └── common │ │ └── proto │ │ └── structmask │ │ ├── structmask.pbenum.dart │ │ └── structmask.pbjson.dart │ ├── test │ └── buildbucket_pb_test.dart │ ├── example │ └── buildbucket_pb_example.dart │ ├── CHANGELOG.md │ ├── README.md │ └── analysis_options.yaml ├── .gitattributes ├── licenses ├── README.md └── pubspec.yaml ├── CODEOWNERS ├── .gitignore ├── analyze └── pubspec.yaml ├── cloud_build ├── deploy_cron_jobs.sh ├── dashboard_build.sh ├── deploy_app_dart.sh └── deploy_auto_submit.sh ├── test_utilities └── bin │ ├── code_health_check.sh │ ├── prepare_environment.sh │ ├── analyze.sh │ ├── licenses.sh │ ├── config_test_runner.sh │ └── flutter_test_runner.sh ├── tests.yaml ├── cocoon.code-workspace ├── pubspec.yaml ├── tooling └── tooling_test.go ├── Dockerfile.app_dart ├── Dockerfile.auto_submit ├── cloudbuild_cron.yaml ├── .github └── workflows │ ├── common_validation.yaml │ ├── app_dart_tests.yaml │ └── dashboard_tests.yaml └── analysis_options.yaml /app_dart/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /cipd_packages/ruby/cocoapods_version.txt: -------------------------------------------------------------------------------- 1 | 1.16.2 2 | -------------------------------------------------------------------------------- /cipd_packages/ktlint/ktlint_metadata.txt: -------------------------------------------------------------------------------- 1 | 1.5.0,ktlint 2 | -------------------------------------------------------------------------------- /cipd_packages/ruby/ruby_metadata.txt: -------------------------------------------------------------------------------- 1 | 3.1,ruby-3.1.3.tar.gz 2 | -------------------------------------------------------------------------------- /dashboard/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/infra-dialog/.gitignore: -------------------------------------------------------------------------------- 1 | **/xcuserdata/ 2 | -------------------------------------------------------------------------------- /auto_submit/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | - Initial checkin of basic server 4 | -------------------------------------------------------------------------------- /dev/githubanalysis/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /cipd_packages/codesign/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /packages/cocoon_common/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /packages/cocoon_server/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /packages/cocoon_common_test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /auto_submit/README.md: -------------------------------------------------------------------------------- 1 | # Autosubmit 2 | 3 | RFC is available in https://flutter.dev/go/autosubmit 4 | -------------------------------------------------------------------------------- /dashboard/assets/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/assets/apple.png -------------------------------------------------------------------------------- /dashboard/assets/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/assets/linux.png -------------------------------------------------------------------------------- /dashboard/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/web/favicon.png -------------------------------------------------------------------------------- /dashboard/assets/chromium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/assets/chromium.png -------------------------------------------------------------------------------- /dashboard/assets/fuchsia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/assets/fuchsia.png -------------------------------------------------------------------------------- /dashboard/assets/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/assets/windows.png -------------------------------------------------------------------------------- /dashboard/assets/googleLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/assets/googleLogo.png -------------------------------------------------------------------------------- /dashboard/web/favicon-failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/web/favicon-failure.png -------------------------------------------------------------------------------- /dashboard/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/web/icons/Icon-192.png -------------------------------------------------------------------------------- /dashboard/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/web/icons/Icon-512.png -------------------------------------------------------------------------------- /dashboard/tool/dashboard-stdout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/tool/dashboard-stdout.png -------------------------------------------------------------------------------- /app_dart/tool/ensure_file: -------------------------------------------------------------------------------- 1 | $ServiceURL https://chrome-infra-packages.appspot.com/ 2 | 3 | dart/dart-sdk/${os}-${arch} stable 4 | -------------------------------------------------------------------------------- /dashboard/tool/luci-failing-check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/tool/luci-failing-check.png -------------------------------------------------------------------------------- /dashboard/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /dashboard/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | **/*.mocks.dart linguist-generated=true 2 | **/*.pb*.dart linguist-generated=true 3 | **/*.g.dart linguist-generated=true 4 | -------------------------------------------------------------------------------- /cipd_packages/codesign/tool/ensure_file: -------------------------------------------------------------------------------- 1 | $ServiceURL https://chrome-infra-packages.appspot.com/ 2 | 3 | dart/dart-sdk/${os}-${arch} beta 4 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/ensure_file: -------------------------------------------------------------------------------- 1 | $ServiceURL https://chrome-infra-packages.appspot.com/ 2 | 3 | dart/dart-sdk/${os}-${arch} dev 4 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/ensure_file_windows: -------------------------------------------------------------------------------- 1 | $ServiceURL https://chrome-infra-packages.appspot.com/ 2 | 3 | dart/dart-sdk/${os}-${arch} dev 4 | -------------------------------------------------------------------------------- /cipd_packages/ruby/third_party/ruby_ship/README: -------------------------------------------------------------------------------- 1 | Scripts in this directory are copied from 2 | https://github.com/stephan-nordnes-eriksen/ruby_ship/. 3 | -------------------------------------------------------------------------------- /auto_submit/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | Dockerfile 3 | build/ 4 | .dart_tool/ 5 | .git/ 6 | .github/ 7 | .gitignore 8 | .idea/ 9 | .packages 10 | -------------------------------------------------------------------------------- /auto_submit/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build output. 6 | build/ 7 | -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/commit_box_test.idle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/commit_box_test.idle.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/commit_box_test.open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/commit_box_test.open.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.withL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.withL.png -------------------------------------------------------------------------------- /licenses/README.md: -------------------------------------------------------------------------------- 1 | # Licenses 2 | 3 | Test utility for verifying LICENSES and headers are in compliance. 4 | 5 | To run on Cocoon, do `dart check_licenses.dart` -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.withSkips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.withSkips.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.withoutL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.withoutL.png -------------------------------------------------------------------------------- /cipd_packages/codesign/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build output. 6 | build/ 7 | -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.origin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.origin.png -------------------------------------------------------------------------------- /app_dart/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build output. 6 | build/ 7 | 8 | coverage/ 9 | -------------------------------------------------------------------------------- /dashboard/test/goldens/build_dashboard.defaultPropertySheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/goldens/build_dashboard.defaultPropertySheet.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/sign_in_button.authenticated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/sign_in_button.authenticated.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.scroll_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.scroll_x.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.scroll_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.scroll_y.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.origin.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.origin.dark.png -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | app_dart/lib/src/request_handlers/push_gold_status_to_github.dart @Piinks 2 | cipd_packages/ktlint/** @gmackall 3 | -------------------------------------------------------------------------------- /app_dart/protofu.yaml: -------------------------------------------------------------------------------- 1 | compiler: 2 | version: 27.2 3 | 4 | plugin: 5 | version: 21.1.2 6 | 7 | sources: 8 | - lib/src/model/proto 9 | 10 | output: lib/src/model/proto 11 | -------------------------------------------------------------------------------- /dashboard/test/goldens/build_dashboard.defaultPropertySheet.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/goldens/build_dashboard.defaultPropertySheet.dark.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/sign_in_button.not_authenticated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/sign_in_button.not_authenticated.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.mouse_scroll_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.mouse_scroll_x.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.mouse_scroll_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.mouse_scroll_y.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.scroll_x.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.scroll_x.dark.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.dev.scroll_y.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.dev.scroll_y.dark.png -------------------------------------------------------------------------------- /packages/cocoon_common_test/README.md: -------------------------------------------------------------------------------- 1 | # Cocoon Commons Test 2 | 3 | This package includes testing functionality for [`cocoon_common`][]. 4 | 5 | [`cocoon_common`]: ../cocoon_common 6 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/README.md: -------------------------------------------------------------------------------- 1 | # Cocoon Server Test 2 | 3 | This package includes testing functionality for [`cocoon_server`][]. 4 | 5 | [`cocoon_server`]: ../cocoon_server 6 | -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_overlay_test.flaky_overlay_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_overlay_test.flaky_overlay_open.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_open.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_overlay_test.flaky_overlay_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_overlay_test.flaky_overlay_closed.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_closed.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_overlay_test.normal_overlay_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_overlay_test.normal_overlay_closed.png -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_overlay_test.normal_overlay_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_overlay_test.normal_overlay_open.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .dart_tool 2 | .DS_Store 3 | *~ 4 | .packages 5 | .pub 6 | **/pubspec.lock 7 | .flutter-plugins-dependencies 8 | # IntelliJ 9 | .idea 10 | *.iml 11 | 12 | # VSCode 13 | .vscode/ 14 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/.gitignore: -------------------------------------------------------------------------------- 1 | # CIPD and Dart-SDK binaries 2 | .cipd/ 3 | dart-sdk/ 4 | 5 | # Build outputs 6 | .dart_tool/ 7 | build/ 8 | .ssh/ 9 | 10 | # Dart 11 | .packages 12 | -------------------------------------------------------------------------------- /dev/githubanalysis/.gitignore: -------------------------------------------------------------------------------- 1 | # https://dart.dev/guides/libraries/private-files 2 | # Created by `dart pub` 3 | .dart_tool/ 4 | .github-token 5 | cache/ 6 | output/ 7 | members.txt 8 | exmembers.txt 9 | -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.filterDefault.differentTypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.filterDefault.differentTypes.png -------------------------------------------------------------------------------- /cipd_packages/doxygen/.gitignore: -------------------------------------------------------------------------------- 1 | # CIPD and Dart-SDK binaries 2 | .cipd/ 3 | dart-sdk/ 4 | 5 | # Build outputs 6 | .dart_tool/ 7 | build/ 8 | doxygen_src/ 9 | .ssh/ 10 | 11 | # Dart 12 | .packages 13 | -------------------------------------------------------------------------------- /dashboard/test/widgets/goldens/task_grid_test.filterShowBringup.differentTypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter/cocoon/HEAD/dashboard/test/widgets/goldens/task_grid_test.filterShowBringup.differentTypes.png -------------------------------------------------------------------------------- /dashboard/devtools_options.yaml: -------------------------------------------------------------------------------- 1 | description: This file stores settings for Dart & Flutter DevTools. 2 | documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states 3 | extensions: 4 | -------------------------------------------------------------------------------- /dev/githubanalysis/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: githubanalysis 2 | 3 | environment: 4 | sdk: ^3.9.0 5 | 6 | dependencies: 7 | github: ^9.9.0 8 | http: ^1.0.0 9 | 10 | dev_dependencies: 11 | dart_flutter_team_lints: 3.5.0 12 | -------------------------------------------------------------------------------- /app_dart/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | source_gen|combining_builder: 5 | options: 6 | ignore_for_file: 7 | - always_specify_types 8 | - implicit_dynamic_parameter 9 | -------------------------------------------------------------------------------- /app_dart/lib/protos.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/model/proto/protos.dart'; 6 | -------------------------------------------------------------------------------- /packages/cocoon_server/lib/logging.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/logging.dart' show log; 6 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | sources: 4 | - $package$ 5 | - lib/$lib$ 6 | - lib/**.dart 7 | builders: 8 | mockito|mockBuilder: 9 | generate_for: 10 | - lib/**.dart 11 | -------------------------------------------------------------------------------- /licenses/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: license_checks 2 | description: Script to check licenses. 3 | 4 | environment: 5 | sdk: ^3.9.0 6 | 7 | dependencies: 8 | path: 1.9.1 9 | platform: 3.1.6 10 | 11 | dev_dependencies: 12 | mockito: ^5.4.6 13 | test_api: 0.7.8 14 | -------------------------------------------------------------------------------- /app_dart/lib/ci_yaml.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/model/ci_yaml/ci_yaml.dart'; 6 | export 'src/model/ci_yaml/target.dart'; 7 | -------------------------------------------------------------------------------- /auto_submit/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | json_serializable: 5 | options: 6 | # Options configure how source code is generated for every 7 | # `@JsonSerializable`-annotated class in the package. 8 | field_rename: snake 9 | -------------------------------------------------------------------------------- /cipd_packages/codesign/lib/codesign.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/file_codesign_visitor.dart'; 6 | export 'src/utils.dart'; 7 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/infra-dialog/infra-dialog.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /dashboard/web/flutter_bootstrap.js: -------------------------------------------------------------------------------- 1 | {{flutter_js}} 2 | {{flutter_build_config}} 3 | 4 | _flutter.loader.load({ 5 | onEntrypointLoaded: async function(engineInitializer) { 6 | let appRunner = await engineInitializer.initializeEngine(); 7 | appRunner.runApp(); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/proto/protos.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'internal/github_webhook.pb.dart'; 6 | export 'internal/scheduler.pb.dart'; 7 | -------------------------------------------------------------------------------- /auto_submit/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | 3 | analyzer: 4 | language: 5 | strict-raw-types: false # TODO: Remove this lint 6 | 7 | linter: 8 | rules: 9 | constant_identifier_names: false # we have all capitalized enums in check_for_waiting_pull_requests_test.dart -------------------------------------------------------------------------------- /cipd_packages/codesign/lib/src/log.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:logging/logging.dart'; 6 | 7 | final Logger log = Logger('codesign'); 8 | -------------------------------------------------------------------------------- /analyze/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cocoon_analyze 2 | description: Cocoon static analysis scripts 3 | publish_to: none 4 | 5 | environment: 6 | sdk: ^3.9.0 7 | 8 | dependencies: 9 | file: 7.0.1 10 | path: 1.9.0 11 | platform: 3.1.6 12 | 13 | dev_dependencies: 14 | mockito: ^5.4.6 15 | test_api: 0.7.8 16 | -------------------------------------------------------------------------------- /dashboard/lib/widgets/sign_in_button/sign_in_button.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'sign_in_button_native.dart' 6 | if (dart.library.js_interop) 'sign_in_button_web.dart'; 7 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/cocoon_common.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/logging/buffered_logger.dart'; 6 | export 'src/logging/log_sink.dart'; 7 | export 'src/logging/severity.dart'; 8 | -------------------------------------------------------------------------------- /packages/cocoon_common_test/lib/cocoon_common_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/buffered_logger_matchers.dart'; 6 | export 'src/json_matchers.dart'; 7 | export 'src/severity_matchers.dart'; 8 | -------------------------------------------------------------------------------- /dashboard/web/.well-known/apple-app-site-association: -------------------------------------------------------------------------------- 1 | { 2 | "applinks": { 3 | "apps": [], 4 | "details": [ 5 | { 6 | "appIDs": ["EQHXZ8M8AV.com.google.experimental0.dev"], 7 | "paths": ["*"] 8 | } 9 | ] 10 | }, 11 | "webcredentials": { 12 | "apps": ["EQHXZ8M8AV.com.google.experimental0.dev"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /dev/cocoon_code_health/README.md: -------------------------------------------------------------------------------- 1 | # Cocoon Code Health 2 | 3 | Tests and tools that try to keep the `flutter/cocoon` repo healthy. 4 | 5 | Note that this package currently has some overlap in responsibility (but not 6 | precise implementation) with the root [`analyze`](../../analyze/) package, but 7 | new functionality should be added here (and migrated from `analyze`). 8 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/infra-dialog/infra-dialog.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cloud_build/deploy_cron_jobs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Deploy latest cron jobs to google cloud. 7 | # This includes cron jobs for both app_dart and auto_submit. 8 | 9 | gcloud app deploy --project "$1" cron.yaml 10 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs. 6 | build/ 7 | 8 | # Omit committing pubspec.lock for library packages; see 9 | # https://dart.dev/guides/libraries/private-files#pubspeclock. 10 | pubspec.lock 11 | 12 | # Directory used to checkout proto deps to process them. 13 | buildbucket_tmp 14 | -------------------------------------------------------------------------------- /test_utilities/bin/code_health_check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | set -ex 7 | 8 | dir=$(dirname $0) 9 | 10 | pushd $dir/../../dev/cocoon_code_health >/dev/null 11 | dart pub get 12 | dart run bin/check.dart 13 | 14 | popd >/dev/null 15 | -------------------------------------------------------------------------------- /packages/cocoon_common_test/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cocoon_common_test 2 | description: Testing specific functionality for package:cocoon_common 3 | publish_to: none 4 | 5 | environment: 6 | sdk: ^3.9.0 7 | 8 | resolution: workspace 9 | 10 | dependencies: 11 | cocoon_common: 12 | path: ../cocoon_common 13 | matcher: ^0.12.17 14 | 15 | dev_dependencies: 16 | dart_flutter_team_lints: 17 | test: ^1.25.15 18 | -------------------------------------------------------------------------------- /dev/githubanalysis/bin/githubanalysis.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:io' show exit; 6 | 7 | import 'package:githubanalysis/main.dart' as lib show main; 8 | 9 | void main(final List arguments) async { 10 | exit(await lib.main(arguments)); 11 | } 12 | -------------------------------------------------------------------------------- /auto_submit/test/utilities/mocks.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/service/approver_service.dart'; 6 | import 'package:mockito/annotations.dart'; 7 | 8 | export 'mocks.mocks.dart'; 9 | 10 | @GenerateMocks([ApproverService]) 11 | void main() {} 12 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/lib/device_doctor.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'src/device.dart'; 6 | export 'src/health.dart'; 7 | export 'src/host_utils.dart'; 8 | export 'src/ios_debug_symbol_doctor.dart'; 9 | export 'src/ios_device.dart'; 10 | export 'src/utils.dart'; 11 | -------------------------------------------------------------------------------- /test_utilities/bin/prepare_environment.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # List of commands to be run once per PR before running dart and flutter 7 | # tests. 8 | 9 | set -ex 10 | 11 | dart pub global activate tuneup 12 | flutter channel master 13 | flutter upgrade 14 | -------------------------------------------------------------------------------- /auto_submit/lib/service/process_method.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /// Enum to tell the auto-submit bot which action to take based on the label 6 | /// found. 7 | enum ProcessMethod { 8 | processAutosubmit, 9 | processEmergency, 10 | processRevert, 11 | doNotProcess, 12 | } 13 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: buildbucket 2 | description: LUCI Buildbucket library. Protos and utilities to communicate with LUCI buildbucket service. 3 | publish_to: none 4 | 5 | resolution: workspace 6 | 7 | environment: 8 | sdk: ^3.9.0 9 | 10 | dependencies: 11 | protoc_plugin: 21.1.2 12 | fixnum: ^1.1.1 13 | protobuf: 3.1.0 14 | grpc: ^4.0.1 15 | 16 | dev_dependencies: 17 | lints: ^5.1.1 18 | test: ^1.25.15 19 | -------------------------------------------------------------------------------- /test_utilities/bin/analyze.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # General flutter/cocoon repo static analysis. 7 | 8 | set -ex 9 | 10 | dir=$(dirname $0) 11 | 12 | pushd $dir/../../analyze > /dev/null 13 | dart pub get 14 | dart --enable-asserts analyze.dart 15 | 16 | popd > /dev/null 17 | -------------------------------------------------------------------------------- /tests.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # Tests configuration file. 6 | # 7 | # It is used to define the tests that will be run on this repository 8 | # it uses a very simple schema: 9 | # 10 | # tasks: 11 | # - task: 12 | # script: 13 | 14 | tasks: 15 | -------------------------------------------------------------------------------- /app_dart/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | # a few rules listed below are the ones we would like to exclude from flutter_lint package, for app_dart 6 | # reasons for exclusions are provided in the comments to the right 7 | avoid_print: false # we have necessary print calls in the code 8 | constant_identifier_names: false # we have all capitalized enums in check_for_waiting_pull_requests_test.dart 9 | -------------------------------------------------------------------------------- /auto_submit/lib/exception/retryable_exception.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /// General exception for retryable error catching. 6 | class RetryableException implements Exception { 7 | const RetryableException(this.cause); 8 | 9 | final String cause; 10 | 11 | @override 12 | String toString() => cause; 13 | } 14 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/proto/internal/github_webhook.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: internal/github_webhook.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/rpc/status.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/rpc/status.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/any.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/any.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /app_dart/test/src/utilities/matchers.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:test/test.dart'; 6 | 7 | Matcher throwsExceptionWith(String messageSubString) { 8 | return throwsA( 9 | isA().having( 10 | (T e) => e.toString(), 11 | 'description', 12 | contains(messageSubString), 13 | ), 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /auto_submit/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | runtime: custom 6 | env: flex 7 | service: auto-submit 8 | 9 | resources: 10 | memory_gb: 2.0 11 | 12 | readiness_check: 13 | path: "/readiness_check" 14 | check_interval_sec: 20 15 | timeout_sec: 20 16 | failure_threshold: 10 17 | success_threshold: 2 18 | app_start_timeout_sec: 300 19 | -------------------------------------------------------------------------------- /auto_submit/lib/exception/configuration_exception.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | class ConfigurationException implements Exception { 6 | /// Create a custom exception for Autosubmit Configuration Errors. 7 | ConfigurationException(this.cause); 8 | 9 | final String cause; 10 | 11 | @override 12 | String toString() => cause; 13 | } 14 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/empty.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/empty.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/duration.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/duration.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/timestamp.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/timestamp.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/wrappers.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/wrappers.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/field_mask.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/field_mask.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/is_release_branch.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /// Returns whether [branchName] "looks like" a release candidate build. 6 | bool isReleaseCandidateBranch({required String branchName}) { 7 | return _isReleaseCandidate.hasMatch(branchName); 8 | } 9 | 10 | final _isReleaseCandidate = RegExp(r'flutter-\d+\.\d+-candidate\.\d+'); 11 | -------------------------------------------------------------------------------- /test_utilities/bin/licenses.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Runner for dart tests. It expects a single parameter with the full 7 | # path to the start folder where tests will be run. 8 | 9 | set -ex 10 | 11 | dir=$(dirname $0) 12 | 13 | pushd $dir/../../licenses > /dev/null 14 | dart pub get 15 | dart check_licenses.dart 16 | 17 | popd > /dev/null 18 | -------------------------------------------------------------------------------- /cocoon.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "analyze" 5 | }, 6 | { 7 | "path": "app_dart" 8 | }, 9 | { 10 | "path": "auto_submit" 11 | }, 12 | { 13 | "path": "cipd_packages" 14 | }, 15 | { 16 | "path": "cloud_build" 17 | }, 18 | { 19 | "path": "dev" 20 | }, 21 | { 22 | "path": "licenses" 23 | }, 24 | { 25 | "path": "packages" 26 | }, 27 | { 28 | "path": "test_utilities" 29 | }, 30 | { 31 | "path": "tooling" 32 | } 33 | ], 34 | "settings": {} 35 | } -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/step.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/step.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/task.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/task.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/common.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/common.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/struct.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/struct.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'struct.pb.dart'; 9 | -------------------------------------------------------------------------------- /auto_submit/lib/foundation/typedefs.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:http/http.dart' as http; 6 | 7 | /// Signature for a function that returns an [HttpClient]. 8 | /// 9 | /// This is used by [CronAuthProvider] to provide the HTTP client that 10 | /// will be used (if necessary) to verify OAuth ID tokens (JWT tokens). 11 | typedef HttpClientProvider = http.Client Function(); 12 | -------------------------------------------------------------------------------- /dev/cocoon_code_health/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cocoon_code_health 2 | description: Tests and tools that try to keep the flutter/cocoon repo healthy. 3 | publish_to: none 4 | 5 | environment: 6 | sdk: ^3.9.0 7 | 8 | resolution: workspace 9 | 10 | executables: 11 | check: 12 | 13 | dependencies: 14 | args: ^2.7.0 15 | cocoon_common: 16 | path: ../../packages/cocoon_common 17 | file: ^7.0.1 18 | glob: ^2.1.3 19 | meta: ^1.16.0 20 | path: ^1.9.1 21 | 22 | dev_dependencies: 23 | dart_flutter_team_lints: 24 | test: ^1.25.15 25 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/launcher.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/launcher.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/artifact.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/artifact.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/resultdb.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/resultdb.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/duration.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/duration.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'duration.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/wrappers.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/wrappers.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'wrappers.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/sink/proto/v1/sink.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/sink/proto/v1/sink.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/timestamp.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/timestamp.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'timestamp.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/notification.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/notification.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/test_metadata.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/test_metadata.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/builder_common.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/builder_common.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/builds_service.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/builds_service.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/common/proto/structmask/structmask.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/common/proto/structmask/structmask.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/failure_reason.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/failure_reason.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /packages/cocoon_common/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cocoon_common 2 | description: Shared functionality and interfaces across flutter/cocoon 3 | publish_to: none 4 | 5 | environment: 6 | sdk: ^3.9.0 7 | 8 | resolution: workspace 9 | 10 | dependencies: 11 | collection: ^1.19.1 12 | json_annotation: ^4.9.0 13 | meta: ^1.16.0 14 | stack_trace: ^1.12.1 15 | 16 | dev_dependencies: 17 | build_runner: ^2.4.15 18 | cocoon_common_test: 19 | path: ../cocoon_common_test 20 | dart_flutter_team_lints: 21 | json_serializable: ^6.9.4 22 | test: ^1.25.15 23 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | # This file represents a "workspace" that applies to the whole repository. 2 | # 3 | # See for details. 4 | 5 | name: _cocoon_workspace 6 | 7 | # Required for workspace support. 8 | environment: 9 | sdk: ^3.9.0 10 | 11 | workspace: 12 | - packages/buildbucket-dart 13 | - packages/cocoon_common 14 | - packages/cocoon_common_test 15 | - packages/cocoon_server 16 | - packages/cocoon_server_test 17 | - dev/cocoon_code_health 18 | 19 | dev_dependencies: 20 | dart_flutter_team_lints: 3.5.0 21 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/sink/proto/v1/location_tag.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/sink/proto/v1/location_tag.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | -------------------------------------------------------------------------------- /tooling/tooling_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This file is used so that slsa-verifier can be updated by dependabot. 6 | // Additional context can be found at: 7 | // https://github.com/slsa-framework/slsa-verifier#option-1-install-via-go 8 | 9 | //go:build tools 10 | // +build tools 11 | 12 | package main 13 | 14 | import ( 15 | _ "github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier" 16 | ) 17 | -------------------------------------------------------------------------------- /auto_submit/test/src/service/fake_approver_service.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/service/approver_service.dart'; 6 | import 'package:github/github.dart' as gh; 7 | 8 | class FakeApproverService extends ApproverService { 9 | FakeApproverService(super.config); 10 | 11 | @override 12 | Future autoApproval(gh.PullRequest pullRequest) async { 13 | // no op 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /auto_submit/test/src/service/fake_discord_notification.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/service/discord_notification.dart'; 6 | 7 | class FakeDiscordNotification extends DiscordNotification { 8 | FakeDiscordNotification({required super.targetUri}); 9 | 10 | @override 11 | Future notifyDiscordChannelWebhook(String jsonMessageString) async { 12 | // do nothing 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: device_doctor 2 | description: A Dart tool to check device healthiness and implement recovery mechanisms to get the device back to a working state. 3 | version: 1.0.1 4 | 5 | environment: 6 | sdk: ^3.9.0 7 | 8 | dependencies: 9 | args: 2.7.0 10 | file: any 11 | logging: 1.2.0 12 | meta: 1.16.0 13 | path: 1.9.1 14 | platform: any 15 | process: 5.0.4 16 | retry: 3.1.2 17 | yaml: 3.1.2 18 | 19 | dev_dependencies: 20 | build_runner: 2.4.13 21 | fake_async: 1.3.3 22 | mockito: 5.4.4 23 | test: 1.26.3 24 | -------------------------------------------------------------------------------- /dashboard/test/utils/fake_flutter_app_icons.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter_app_icons/flutter_app_icons_platform_interface.dart'; 6 | 7 | class FakeFlutterAppIcons extends FlutterAppIconsPlatform { 8 | @override 9 | Future setIcon({ 10 | required String icon, 11 | String oldIcon = '', 12 | String appleTouchIcon = '', 13 | }) async { 14 | return icon; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/proto/internal/scheduler.pbserver.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: internal/scheduler.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names 9 | // ignore_for_file: deprecated_member_use_from_same_package, library_prefixes 10 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 11 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 12 | 13 | export 'scheduler.pb.dart'; 14 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/build.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/build.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'build.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/step.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/step.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'step.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/task.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/task.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'task.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/common.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/common.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'common.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/common.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/common.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'common.pb.dart'; 9 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/proto/internal/github_webhook.pbserver.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: internal/github_webhook.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names 9 | // ignore_for_file: deprecated_member_use_from_same_package, library_prefixes 10 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 11 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 12 | 13 | export 'github_webhook.pb.dart'; 14 | -------------------------------------------------------------------------------- /cipd_packages/codesign/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: codesign 2 | description: A standalone app to codesign Mac engine binaries. 3 | version: 1.0.0 4 | homepage: https://github.com/flutter/cocoon 5 | 6 | environment: 7 | sdk: ^3.9.0 8 | 9 | dependencies: 10 | archive: 4.0.7 11 | args: 2.7.0 12 | crypto: 3.0.7 13 | fake_async: 1.3.3 14 | file: 7.0.1 15 | flutter_lints: 5.0.0 16 | logging: 1.3.0 17 | meta: 1.17.0 18 | platform: 3.1.6 19 | process: 5.0.5 20 | retry: 3.1.2 21 | 22 | dev_dependencies: 23 | dart_flutter_team_lints: 3.5.1 24 | lints: 5.0.0 25 | test: 1.28.0 26 | -------------------------------------------------------------------------------- /cloud_build/dashboard_build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Build flutter build dashboard. 7 | 8 | pushd dashboard > /dev/null 9 | set -e 10 | rm -rf build 11 | flutter channel stable 12 | flutter upgrade 13 | flutter doctor 14 | flutter pub get 15 | flutter config --enable-web 16 | flutter build web --source-maps 17 | rm -rf ../app_dart/build 18 | cp -r build ../app_dart/build 19 | flutter clean 20 | popd > /dev/null 21 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/invocation.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/invocation.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'invocation.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/resultdb/proto/v1/predicate.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/resultdb/proto/v1/predicate.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'predicate.pb.dart'; 9 | -------------------------------------------------------------------------------- /app_dart/lib/src/request_handlers/readiness_check.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import '../request_handling/request_handler.dart'; 8 | import '../request_handling/response.dart'; 9 | 10 | final class ReadinessCheck extends RequestHandler { 11 | const ReadinessCheck({required super.config}); 12 | 13 | @override 14 | Future get(Request request) async { 15 | return Response.emptyOk; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app_dart/lib/src/service/flags/ci_yaml_flags.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: always_specify_types, implicit_dynamic_parameter 4 | 5 | part of 'ci_yaml_flags.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | CiYamlFlags _$CiYamlFlagsFromJson(Map json) => CiYamlFlags(); 12 | 13 | Map _$CiYamlFlagsToJson(CiYamlFlags instance) => 14 | {}; 15 | -------------------------------------------------------------------------------- /test_utilities/bin/config_test_runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Runner for cocoon scheduler config tests. It expects a single parameter with 7 | # the full path to the config file under test. 8 | 9 | set -ex 10 | 11 | # Build and analyze 12 | echo "Running config tests on $1" 13 | pushd app_dart > /dev/null 14 | flutter clean 15 | pub get 16 | 17 | dart bin/validate_scheduler_config.dart "$1" 18 | 19 | popd > /dev/null 20 | -------------------------------------------------------------------------------- /Dockerfile.app_dart: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # Dart Docker official images can be found here: https://hub.docker.com/_/dart 6 | FROM dart:stable 7 | 8 | # Packages are PATH dependencies of app_dart, and need to be copied/accessible. 9 | WORKDIR /packages 10 | COPY packages . 11 | 12 | WORKDIR /app 13 | COPY app_dart . 14 | 15 | RUN dart pub get 16 | 17 | # Start server. 18 | EXPOSE 8080 19 | CMD ["/usr/lib/dart/bin/dart", "/app/bin/gae_server.dart"] 20 | -------------------------------------------------------------------------------- /auto_submit/lib/action/revert_method.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:github/github.dart' as github; 6 | 7 | import '../service/config.dart'; 8 | 9 | abstract class RevertMethod { 10 | // Allows substitution of the method of creating the revert request. 11 | Future createRevert( 12 | Config config, 13 | String initiatingAuthor, 14 | String reasonForRevert, 15 | github.PullRequest pullRequest, 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/builder_common.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/builder_common.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'builder_common.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/buildbucket/proto/project_config.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/buildbucket/proto/project_config.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name 7 | 8 | export 'project_config.pb.dart'; 9 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cocoon_server_test 2 | description: Testing specific functionality for package:cocoon_server 3 | publish_to: none 4 | 5 | resolution: workspace 6 | 7 | environment: 8 | sdk: ^3.9.0 9 | 10 | dependencies: 11 | cocoon_common: 12 | path: ../cocoon_common 13 | cocoon_server: 14 | path: ../cocoon_server 15 | github: ^9.24.0 16 | googleapis: 14.0.0 17 | http: ^1.3.0 18 | matcher: ^0.12.17 19 | mockito: ^5.4.6 20 | test_api: ^0.7.4 21 | 22 | dev_dependencies: 23 | build_runner: ^2.4.15 24 | dart_flutter_team_lints: 3.5.0 25 | test: ^1.25.15 26 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/test/test_logging_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/cocoon_common.dart'; 6 | import 'package:cocoon_server/logging.dart'; 7 | import 'package:cocoon_server_test/test_logging.dart'; 8 | import 'package:test/test.dart'; 9 | 10 | void main() { 11 | useTestLoggerPerTest(); 12 | 13 | test('should create a BufferedLogger in every test instance', () { 14 | expect(log, isA()); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /auto_submit/lib/foundation/providers.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:http/http.dart' as http; 6 | 7 | /// Signature for a function that returns an [http.Client]. 8 | typedef HttpProvider = http.Client Function(); 9 | 10 | /// Class that holds static default providers. 11 | class Providers { 12 | const Providers._(); 13 | 14 | /// Creates a [http.Client] that interacts with the internet. 15 | static http.Client freshHttpClient() => http.Client(); 16 | } 17 | -------------------------------------------------------------------------------- /cipd_packages/ruby/README.md: -------------------------------------------------------------------------------- 1 | # Ruby at Flutter 2 | 3 | The scripts in this folder are used to build and package 4 | ruby as a self contained CIPD package. This package is intended 5 | for flutter/flutter repository testing. 6 | 7 | # Updating to new ruby versions. 8 | 9 | Update `ruby_metadata.txt` with the major version 10 | and the file name. E.g. `3.1,ruby-3.1.4.tar.gz` to 11 | change the version of ruby to build. 12 | 13 | # Installing cocoapods. 14 | 15 | The CIPD package will bundle cocoapods with its corresponding 16 | wrapper scripts. 17 | 18 | Update `cococapods_version.txt` with the version of cocoapods 19 | to use. 20 | -------------------------------------------------------------------------------- /packages/cocoon_server/README.md: -------------------------------------------------------------------------------- 1 | # Cocoon Server 2 | 3 | This package contains server-side functionality shared between [`app_dart`][] 4 | and [`auto_submit`][]. 5 | 6 | [`app_dart`]: ../../app_dart/ 7 | [`auto_submit`]: ../../auto_submit/ 8 | 9 | What should go into this package: 10 | 11 | - Shared code used directly in a server package in `flutter/cocoon` 12 | 13 | What should _not_ go into this package: 14 | 15 | - Code that imports or uses the Flutter SDK 16 | - Code that will be imported or used _outside_ of `flutter/cocoon` 17 | - Code that is used _exclusively_ for testing[^1], i.e. depends on `package:test` or similar 18 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/proto/internal/github_webhook.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | syntax = "proto2"; 6 | 7 | package cocoon; 8 | 9 | // For full spec, see: 10 | // * https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads 11 | message GithubWebhookMessage { 12 | // X-GitHub-Event HTTP Header indicating the webhook action. 13 | optional string event = 1; 14 | // JSON encoded webhook payload from GitHub. 15 | optional string payload = 2; 16 | } 17 | -------------------------------------------------------------------------------- /Dockerfile.auto_submit: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # Dart Docker official images can be found here: https://hub.docker.com/_/dart 6 | FROM dart:stable 7 | 8 | # Packages are PATH dependencies of app_dart, and need to be copied/accessible. 9 | WORKDIR /packages 10 | COPY packages . 11 | 12 | WORKDIR /app 13 | 14 | # Copy app source code (except anything in .dockerignore). 15 | COPY auto_submit . 16 | RUN dart pub get 17 | 18 | # Start server. 19 | EXPOSE 8080 20 | CMD ["/usr/lib/dart/bin/dart", "/app/bin/server.dart"] 21 | -------------------------------------------------------------------------------- /auto_submit/lib/model/pull_request_data_types.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /// The type of the change in the pull request we have processed. 6 | enum PullRequestChangeType { 7 | /// Merge is any submitted pull request change that does not undo previous changes. 8 | change, 9 | 10 | /// Revert is specifically for undoing changes. 11 | revert, 12 | } 13 | 14 | /// Values representing the current states of a pull requests we process with 15 | /// the autosubmit service. 16 | enum PullRequestState { open, closed } 17 | -------------------------------------------------------------------------------- /auto_submit/test/model/pull_request_change_type.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/model/pull_request_data_types.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | void main() { 9 | final expectedNames = ['change', 'revert']; 10 | 11 | test('Expected string value for enum is returned.', () { 12 | for (var prChangeType in PullRequestChangeType.values) { 13 | assert(expectedNames.contains(prChangeType.name)); 14 | } 15 | expect(PullRequestChangeType.values.length, 2); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /auto_submit/test/src/validations/fake_validation_filter.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/validations/validation.dart'; 6 | import 'package:auto_submit/validations/validation_filter.dart'; 7 | 8 | class FakeValidationFilter implements ValidationFilter { 9 | final Set validations = {}; 10 | 11 | void registerValidation(Validation newValidation) { 12 | validations.add(newValidation); 13 | } 14 | 15 | @override 16 | Set getValidations() { 17 | return validations; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /dashboard/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app_flutter", 3 | "short_name": "app_flutter", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /dashboard/lib/widgets/header_text.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/material.dart'; 6 | 7 | /// Text header. 8 | /// 9 | /// Displays the given text using font headline4. 10 | class HeaderText extends StatelessWidget { 11 | const HeaderText(this.text, {super.key}); 12 | 13 | final String text; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Text( 18 | text, 19 | style: Theme.of(context).textTheme.headlineMedium, 20 | textAlign: TextAlign.center, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/internal.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | @internal 6 | library; 7 | 8 | import 'package:meta/meta.dart'; 9 | 10 | /// Whether `assert` is enabled in the current runtime. 11 | /// 12 | /// This will evaluate to `false` when an application is run normally 13 | /// (i.e. `dart run` or similar for an AOT-compiled app), and `true` when 14 | /// run in debug mode or a testing environment (i.e. `dart test`). 15 | bool get assertionsEnabled { 16 | var enabled = false; 17 | assert(enabled = true); 18 | return enabled; 19 | } 20 | -------------------------------------------------------------------------------- /cipd_packages/ktlint/README.md: -------------------------------------------------------------------------------- 1 | # ktlint at Flutter 2 | 3 | The scripts in this folder are used to package the kotlin linter 4 | ktlint as a self contained CIPD package. This package is used 5 | for linting kotlin code in the flutter/flutter repository. 6 | 7 | # Updating to new ktlint versions. 8 | 9 | Update `ktlint_metadata.txt` with the major version 10 | and the file name. New versions can be found at the releases page for ktlint 11 | (https://github.com/pinterest/ktlint/releases). Before changing the version here, 12 | you must also identify and resolve any new lints in flutter/flutter, by 13 | running the new version of ktlint from the root of flutter/flutter (passing in the 14 | current baseline). 15 | -------------------------------------------------------------------------------- /auto_submit/lib/requests/readiness_check.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import 'package:shelf/shelf.dart'; 8 | 9 | import '../server/request_handler.dart'; 10 | 11 | /// Handler for readiness checks. 12 | class ReadinessCheck extends RequestHandler { 13 | const ReadinessCheck({required super.config}); 14 | 15 | @override 16 | Future get() async { 17 | return Response.ok('OK'); 18 | } 19 | 20 | @override 21 | Future run(Request request) async { 22 | return super.run(request); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/test/buildbucket_pb_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:buildbucket/buildbucket_pb.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | Map buildJson = { 9 | 'builder': {'project': 'flutter', 'bucket': 'try', 'builder': 'buildabc'}, 10 | }; 11 | 12 | void main() { 13 | group('Build proto', () { 14 | test('From json and to json', () { 15 | Build build = Build(); 16 | build.mergeFromProto3Json(buildJson); 17 | expect(build.toProto3Json(), buildJson); 18 | }); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /app_dart/config.yaml: -------------------------------------------------------------------------------- 1 | # Defines the config options for Flutter CI (Cocoon) 2 | # 3 | # The schema for this file is defined in DynamicConfig of 4 | # app_dart/lib/src/service/config.dart 5 | 6 | # TODO(matanlurey): Remove this flag, it is currently unused. 7 | allowManualTreeClosures: true 8 | 9 | backfillerCommitLimit: 50 10 | 11 | ciYaml: 12 | 13 | contentAwareHashing: 14 | # This will cause PRs that enter the merge queue to wait on CAH hashing 15 | # to happen before scheduling builds. 16 | waitOnContentHash: true 17 | 18 | # Whether to close the MQ guard right after LUCI presubmit completed 19 | # instead of doing that as part of the `check_run` GitHub event handling. 20 | closeMqGuardAfterPresubmit: true 21 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/lib/mocks.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | @GenerateNiceMocks([ 6 | MockSpec(), 7 | MockSpec(), 8 | MockSpec(), 9 | MockSpec(), 10 | ]) 11 | import 'package:github/github.dart'; 12 | 13 | @GenerateNiceMocks([MockSpec()]) 14 | import 'package:googleapis/bigquery/v2.dart'; 15 | 16 | @GenerateNiceMocks([MockSpec()]) 17 | import 'package:http/http.dart' as http; 18 | import 'package:mockito/annotations.dart'; 19 | 20 | export 'mocks.mocks.dart'; 21 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/is_dart_internal.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /// Returns whether [builderName] "looks like" a build from `dart-internal`. 6 | /// 7 | /// See https://github.com/flutter/flutter/issues/165718. 8 | bool isTaskFromDartInternalBuilder({required String builderName}) { 9 | // TODO(matanlurey): Store this information in Task and remove this. 10 | return _isDartInternalBuilderName.hasMatch(builderName); 11 | } 12 | 13 | final _isDartInternalBuilderName = RegExp( 14 | r'(Linux|Mac|Windows)\s+(packaging_release_builder|flutter_release_builder)', 15 | ); 16 | -------------------------------------------------------------------------------- /app_dart/lib/src/service/exceptions.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | class NoBuildFoundException implements Exception { 6 | /// Create a custom exception for no build found Errors. 7 | NoBuildFoundException(this.cause); 8 | 9 | final String cause; 10 | 11 | @override 12 | String toString() => cause; 13 | } 14 | 15 | class UnfinishedBuildException implements Exception { 16 | /// Create a custom exception for an unfinished buildbucket build 17 | UnfinishedBuildException(this.cause); 18 | 19 | final String cause; 20 | 21 | @override 22 | String toString() => cause; 23 | } 24 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/example/buildbucket_pb_example.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | 7 | import 'package:buildbucket/buildbucket_pb.dart'; 8 | 9 | void main() { 10 | // Create a BuildBucket build from a json string. 11 | Build build = Build(); 12 | final String json = 13 | '{"builder": {"project": "flutter", "bucket": "try", "builder": "buildabc"}}'; 14 | Map jsonObject = jsonDecode(json); 15 | build.mergeFromProto3Json(jsonObject); 16 | // Enconding the Build instance to a json object. 17 | print(build.toProto3Json()); 18 | } 19 | -------------------------------------------------------------------------------- /dashboard/test/utils/mocks.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:firebase_auth/firebase_auth.dart'; 6 | import 'package:flutter_dashboard/service/cocoon.dart'; 7 | import 'package:flutter_dashboard/service/firebase_auth.dart'; 8 | import 'package:flutter_dashboard/state/build.dart'; 9 | import 'package:http/http.dart'; 10 | import 'package:mockito/annotations.dart'; 11 | 12 | export 'mocks.mocks.dart'; 13 | 14 | @GenerateMocks([ 15 | Client, 16 | CocoonService, 17 | BuildState, 18 | FirebaseAuthService, 19 | FirebaseAuth, 20 | UserCredential, 21 | ]) 22 | void main() {} 23 | -------------------------------------------------------------------------------- /auto_submit/lib/model/discord_message.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:json_annotation/json_annotation.dart'; 6 | 7 | part 'discord_message.g.dart'; 8 | 9 | @JsonSerializable() 10 | class Message { 11 | Message({this.content, this.username, this.avatarUrl}); 12 | 13 | String? content; 14 | String? username; 15 | // avatar_url 16 | @JsonKey(name: 'avatar_url', includeIfNull: false) 17 | String? avatarUrl; 18 | 19 | factory Message.fromJson(Map input) => 20 | _$MessageFromJson(input); 21 | Map toJson() => _$MessageToJson(this); 22 | } 23 | -------------------------------------------------------------------------------- /packages/cocoon_common/test/is_dart_internal_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/is_dart_internal.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | void main() { 9 | for (final platform in ['Linux', 'Mac', 'Windows']) { 10 | for (final builder in [ 11 | 'packaging_release_builder', 12 | 'flutter_release_builder', 13 | ]) { 14 | final name = '$platform $builder'; 15 | test('$name is a dart-internal release builder', () { 16 | expect(isTaskFromDartInternalBuilder(builderName: name), isTrue); 17 | }); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app_dart/lib/src/service/flags/content_aware_hashing_flags.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: always_specify_types, implicit_dynamic_parameter 4 | 5 | part of 'content_aware_hashing_flags.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | ContentAwareHashing _$ContentAwareHashingFromJson(Map json) => 12 | ContentAwareHashing(waitOnContentHash: json['waitOnContentHash'] as bool?); 13 | 14 | Map _$ContentAwareHashingToJson( 15 | ContentAwareHashing instance, 16 | ) => {'waitOnContentHash': instance.waitOnContentHash}; 17 | -------------------------------------------------------------------------------- /auto_submit/lib/git/utilities.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /// There are two ways to clone the repository which will be configurable in the 6 | /// repository configuration in .github. 7 | enum GitAccessMethod { SSH, HTTP } 8 | 9 | /// Wrapper class to create a revert branch that is comprised of the prefix 10 | /// revert_ and the commit sha so the branch is easily identifiable. 11 | class GitRevertBranchName { 12 | final String _commitSha; 13 | 14 | const GitRevertBranchName(this._commitSha); 15 | 16 | static const String _branchPrefix = 'revert'; 17 | 18 | String get branch => '${_branchPrefix}_$_commitSha'; 19 | } 20 | -------------------------------------------------------------------------------- /auto_submit/lib/model/discord_message.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'discord_message.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Message _$MessageFromJson(Map json) => Message( 10 | content: json['content'] as String?, 11 | username: json['username'] as String?, 12 | avatarUrl: json['avatar_url'] as String?, 13 | ); 14 | 15 | Map _$MessageToJson(Message instance) => { 16 | 'content': instance.content, 17 | 'username': instance.username, 18 | if (instance.avatarUrl case final value?) 'avatar_url': value, 19 | }; 20 | -------------------------------------------------------------------------------- /packages/cocoon_server/build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | sources: 4 | - $package$ 5 | - lib/$lib$ 6 | - lib/**.dart 7 | - test/**.dart 8 | builders: 9 | json_serializable: 10 | generate_for: 11 | - test/**.dart 12 | - lib/**.dart 13 | options: 14 | # Options configure how source code is generated for every 15 | # `@JsonSerializable`-annotated class in the package. 16 | field_rename: snake 17 | source_gen|combining_builder: 18 | options: 19 | ignore_for_file: 20 | - always_specify_types 21 | - implicit_dynamic_parameter 22 | mockito|mockBuilder: 23 | generate_for: 24 | - test/**.dart 25 | - lib/**.dart 26 | -------------------------------------------------------------------------------- /dashboard/test/widgets/optional_image_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter_dashboard/widgets/optional_image.dart'; 6 | 7 | import 'package:flutter_test/flutter_test.dart'; 8 | 9 | void main() { 10 | testWidgets('OptionalImage.enabled', (WidgetTester tester) async { 11 | expect( 12 | const OptionalImage(imageUrl: 'url').enabled, 13 | isFalse, 14 | ); // because this is a test 15 | expect( 16 | const OptionalImage(imageUrl: 'url', enabled: false).enabled, 17 | isFalse, 18 | ); 19 | expect(const OptionalImage(imageUrl: 'url', enabled: true).enabled, isTrue); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/github/annotations.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: always_specify_types, implicit_dynamic_parameter 4 | 5 | part of 'annotations.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | Annotation _$AnnotationFromJson(Map json) => Annotation( 12 | annotationLevel: json['annotation_level'] as String?, 13 | message: json['message'] as String?, 14 | ); 15 | 16 | Map _$AnnotationToJson(Annotation instance) => 17 | { 18 | 'annotation_level': instance.annotationLevel, 19 | 'message': instance.message, 20 | }; 21 | -------------------------------------------------------------------------------- /app_dart/lib/src/request_handlers/get_repos.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import 'package:github/github.dart'; 8 | 9 | import '../request_handling/request_handler.dart'; 10 | import '../request_handling/response.dart'; 11 | import '../service/config.dart'; 12 | 13 | /// Returns [Config.supportedRepos] as a list of repo names. 14 | final class GetRepos extends RequestHandler { 15 | const GetRepos({required super.config}); 16 | 17 | @override 18 | Future get(Request request) async { 19 | return Response.json([ 20 | ...config.supportedRepos.map((RepositorySlug slug) => slug.name), 21 | ]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/google/grpc.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: always_specify_types, implicit_dynamic_parameter 4 | 5 | part of 'grpc.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | GrpcStatus _$GrpcStatusFromJson(Map json) => GrpcStatus( 12 | code: (json['code'] as num).toInt(), 13 | message: json['message'] as String?, 14 | details: json['details'], 15 | ); 16 | 17 | Map _$GrpcStatusToJson(GrpcStatus instance) => 18 | { 19 | 'code': instance.code, 20 | 'message': ?instance.message, 21 | 'details': ?instance.details, 22 | }; 23 | -------------------------------------------------------------------------------- /dashboard/test/rpc_model/branch_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/rpc_model.dart'; 6 | import 'package:flutter_test/flutter_test.dart'; 7 | 8 | void main() { 9 | test('implements == and hashCode', () { 10 | final stable1 = Branch(channel: 'stable', reference: '1234'); 11 | final stable2 = Branch(channel: 'stable', reference: '5678'); 12 | 13 | expect(stable1, stable1); 14 | expect(stable1, isNot(stable2)); 15 | }); 16 | 17 | test('encodes and decodes to JSON', () { 18 | final example = Branch(channel: 'stable', reference: '1234'); 19 | 20 | expect(Branch.fromJson(example.toJson()), example); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /app_dart/test/src/request_handling/fake_pubsub.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_service/src/request_handling/pubsub.dart'; 6 | import 'package:googleapis/pubsub/v1.dart'; 7 | 8 | class FakePubSub extends PubSub { 9 | List messages = []; 10 | bool exceptionFlag = false; 11 | int exceptionRepetition = 1; 12 | 13 | @override 14 | Future> publish(String topicName, dynamic json) async { 15 | if (exceptionFlag && exceptionRepetition > 0) { 16 | exceptionRepetition--; 17 | throw DetailedApiRequestError(500, 'test api error'); 18 | } 19 | messages.add(json); 20 | return []; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /auto_submit/test/src/request_handling/fake_authentication.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/request_handling/authentication.dart'; 6 | import 'package:auto_submit/requests/exceptions.dart'; 7 | import 'package:shelf/shelf.dart'; 8 | 9 | // ignore: must_be_immutable 10 | class FakeCronAuthProvider implements CronAuthProvider { 11 | FakeCronAuthProvider({this.authenticated = true}); 12 | 13 | bool authenticated; 14 | 15 | @override 16 | Future authenticate(Request request) async { 17 | if (authenticated) { 18 | return true; 19 | } else { 20 | throw const Unauthenticated('Not authenticated'); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/branch.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'branch.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Branch _$BranchFromJson(Map json) => 10 | $checkedCreate('Branch', json, ($checkedConvert) { 11 | final val = Branch( 12 | channel: $checkedConvert('channel', (v) => v as String), 13 | reference: $checkedConvert('reference', (v) => v as String), 14 | ); 15 | return val; 16 | }); 17 | 18 | Map _$BranchToJson(Branch instance) => { 19 | 'channel': instance.channel, 20 | 'reference': instance.reference, 21 | }; 22 | -------------------------------------------------------------------------------- /cloudbuild_cron.yaml: -------------------------------------------------------------------------------- 1 | # Provide instructions for google Cloud Build to deploy cron jobs 2 | # to flutter-dashboard project. It will be triggered 3 | # by daily schedule on `main` branch. 4 | # 5 | # The deploy will be skipped if no new commits since last deployment. 6 | 7 | steps: 8 | # Deploy a new version to google cloud. 9 | - name: gcr.io/cloud-builders/gcloud 10 | entrypoint: '/bin/bash' 11 | args: 12 | - '-c' 13 | - |- 14 | gcloud config set project $PROJECT_ID 15 | latest_version=$(gcloud app versions list --hide-no-traffic --format 'value(version.id)') 16 | if [ "$latest_version" = "version-$SHORT_SHA" ]; then 17 | echo "No updates since last deployment." 18 | else 19 | bash cloud_build/deploy_cron_jobs.sh $PROJECT_ID 20 | fi 21 | 22 | timeout: 600s 23 | -------------------------------------------------------------------------------- /app_dart/test/src/request_handling/fake_request_handler.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_service/src/request_handling/request_handler.dart'; 6 | import 'package:cocoon_service/src/request_handling/response.dart'; 7 | 8 | // ignore: must_be_immutable 9 | final class FakeRequestHandler extends RequestHandler { 10 | FakeRequestHandler({required this.body, required super.config}); 11 | 12 | final Response body; 13 | int callCount = 0; 14 | 15 | @override 16 | Future get(_) async { 17 | callCount++; 18 | return body; 19 | } 20 | 21 | @override 22 | Future post(_) async { 23 | callCount++; 24 | return body; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cipd_packages/ktlint/tools/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Script to build a self contained ktlint cipd package. 7 | 8 | set -e 9 | set -x 10 | 11 | # Get the directory of this script. 12 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 13 | 14 | # Get versions from config files. 15 | KTLINT_MAJOR_VERSION=$(cat $DIR/../ktlint_metadata.txt | cut -d ',' -f 1) 16 | KTLINT_FILE_NAME=$(cat $DIR/../ktlint_metadata.txt | cut -d ',' -f 2) 17 | 18 | # Create the package structure. 19 | rm -rf $DIR/../build && mkdir -p $DIR/../build 20 | 21 | curl -L https://github.com/pinterest/ktlint/releases/download/"$KTLINT_MAJOR_VERSION"/"$KTLINT_FILE_NAME" -o $DIR/../build/ktlint 22 | -------------------------------------------------------------------------------- /auto_submit/test/src/action/fake_revert_method.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/action/revert_method.dart'; 6 | import 'package:auto_submit/service/config.dart'; 7 | import 'package:github/src/common/model/pulls.dart'; 8 | 9 | class FakeRevertMethod implements RevertMethod { 10 | Object? object; 11 | bool throwException = false; 12 | 13 | @override 14 | Future createRevert( 15 | Config config, 16 | String initiatingAuthor, 17 | String reasonForRevert, 18 | PullRequest pullRequest, 19 | ) async { 20 | if (throwException) { 21 | throw 'Crappy github exception not related to the actual error.'; 22 | } 23 | return object; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/common_validation.yaml: -------------------------------------------------------------------------------- 1 | name: Common workflows 2 | 3 | on: 4 | pull_request: 5 | branches: [main] 6 | push: 7 | branches: [main] 8 | 9 | jobs: 10 | common-validations: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: dart-lang/setup-dart@v1 14 | 15 | - name: Checkout code 16 | uses: actions/checkout@v6 17 | 18 | - name: Run analyze.dart 19 | working-directory: analyze 20 | run: | 21 | dart pub get 22 | dart --enable-asserts analyze.dart 23 | 24 | - name: Run cocoon_code_health 25 | run: | 26 | dart pub get 27 | dart run dev/cocoon_code_health/bin/check.dart 28 | 29 | - name: Run license check 30 | working-directory: licenses 31 | run: | 32 | dart pub get 33 | dart run check_licenses.dart 34 | -------------------------------------------------------------------------------- /app_dart/lib/src/foundation/typedefs.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:appengine/appengine.dart'; 6 | import 'package:http/http.dart' as http; 7 | 8 | /// Signature for a function that returns an App Engine [ClientContext]. 9 | /// 10 | /// This is used in [AuthenticationProvider] to provide the client context 11 | /// as part of the [AuthenticatedContext]. 12 | typedef ClientContextProvider = ClientContext Function(); 13 | 14 | /// Signature for a function that returns an [HttpClient]. 15 | /// 16 | /// This is used by [AuthenticationProvider] to provide the HTTP client that 17 | /// will be used (if necessary) to verify OAuth ID tokens (JWT tokens). 18 | typedef HttpClientProvider = http.Client Function(); 19 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/infra-dialog/infra-dialogUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /packages/cocoon_common/README.md: -------------------------------------------------------------------------------- 1 | # Cocoon Commons 2 | 3 | This package includes functionality used across services and UIs in Cocoon, 4 | including [`app_dart`][], [`auto_submit`][], and [`dashboard`][]. 5 | 6 | [`app_dart`]: ../../app_dart/ 7 | [`auto_submit`]: ../../auto_submit/ 8 | [`dashboard`]: ../../dashboard 9 | 10 | What should go into this package: 11 | 12 | - Shared code and interfaces used directly in a package in `flutter/cocoon` 13 | 14 | What should _not_ go into this package: 15 | 16 | - Code that is dependent on running on the server; see [`cocoon_server`](../../cocoon_server/) 17 | - Code that imports or uses the Flutter SDK 18 | - Code that will be imported or used _outside_ of `flutter/cocoon` 19 | - Code that is used _exclusively_ for testing[^1], i.e. depends on `package:test` or similar 20 | 21 | [^1]: See [`cocoon_common_test`](../cocoon_common_test/) for the testing package. 22 | -------------------------------------------------------------------------------- /packages/cocoon_server/lib/google_auth_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:googleapis_auth/auth_io.dart' as g; 6 | import 'package:http/http.dart' as http; 7 | 8 | /// Creates and returns an [http.Client] for accessing Google APIs. 9 | interface class GoogleAuthProvider { 10 | const GoogleAuthProvider(); 11 | 12 | /// Creates an [http.Client] for accessing [scopes]. 13 | /// 14 | /// If [baseClient] is not provided, a default [http.Client.new] is used. 15 | Future createClient({ 16 | required List scopes, 17 | http.Client? baseClient, 18 | }) { 19 | return g.clientViaApplicationDefaultCredentials( 20 | scopes: scopes, 21 | baseClient: baseClient, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/empty.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/empty.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use emptyDescriptor instead') 17 | const Empty$json = { 18 | '1': 'Empty', 19 | }; 20 | 21 | /// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List emptyDescriptor = 23 | $convert.base64Decode('CgVFbXB0eQ=='); 24 | -------------------------------------------------------------------------------- /cloud_build/deploy_app_dart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Deploy a new flutter dashboard version to google cloud. 7 | 8 | pushd app_dart > /dev/null 9 | set -e 10 | # app_dart 11 | gcloud app deploy --project "$1" --version "version-$2" -q --no-promote --no-stop-previous-version --image-url "us-docker.pkg.dev/$1/appengine/default.version-$2" 12 | gcloud app services set-traffic default --splits version-$2=1 --quiet 13 | # Google Cloud quota only allows 30 versions. 14 | # For daily builds, this will keep the 10 most recent versions, but wipe the rest. 15 | gcloud app versions list --format="value(version.id)" --sort-by="~version.createTime" --service=default | tail -n +11 | xargs -r gcloud app versions delete --quiet 16 | popd > /dev/null 17 | -------------------------------------------------------------------------------- /cloud_build/deploy_auto_submit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Deploy a new auto submit version to google cloud. 7 | 8 | pushd auto_submit > /dev/null 9 | # auto_submit 10 | gcloud app deploy --project "$1" --version "version-$2" -q --no-promote --no-stop-previous-version --image-url "us-docker.pkg.dev/$1/appengine/auto-submit.version-$2" 11 | gcloud app services set-traffic auto-submit --splits version-$2=1 --quiet 12 | # Google Cloud quota only allows 30 versions. 13 | # For daily builds, this will keep the 10 most recent versions, but wipe the rest. 14 | gcloud app versions list --format="value(version.id)" --sort-by="~version.createTime" --service=auto-submit | tail -n +20 | xargs -r gcloud app versions delete --quiet 15 | popd > /dev/null 16 | -------------------------------------------------------------------------------- /auto_submit/test/git/cli_command_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | import 'package:auto_submit/git/cli_command.dart'; 8 | import 'package:cocoon_server_test/test_logging.dart'; 9 | import 'package:test/test.dart'; 10 | 11 | void main() { 12 | useTestLoggerPerTest(); 13 | 14 | group('Testing git command locally', () { 15 | test('Checkout locally.', () async { 16 | var executable = 'ls'; 17 | if (Platform.isWindows) { 18 | executable = 'dir'; 19 | } 20 | 21 | final cliCommand = CliCommand(); 22 | final processResult = await cliCommand.runCliCommand( 23 | executable: executable, 24 | arguments: [], 25 | ); 26 | expect(processResult.exitCode, isZero); 27 | }); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /auto_submit/test/src/validations/fake_mergeable.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/model/auto_submit_query_result.dart'; 6 | import 'package:auto_submit/validations/mergeable.dart'; 7 | import 'package:auto_submit/validations/validation.dart'; 8 | import 'package:github/github.dart' as github; 9 | 10 | class FakeMergeable extends Mergeable { 11 | FakeMergeable({required super.config}); 12 | 13 | ValidationResult? validationResult; 14 | 15 | @override 16 | String get name => 'FakeMergeable'; 17 | 18 | @override 19 | Future validate( 20 | QueryResult result, 21 | github.PullRequest messagePullRequest, 22 | ) async { 23 | return validationResult ?? ValidationResult(true, Action.REMOVE_LABEL, ''); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app_dart/test/src/service/fake_firebase_jwt_validator.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_service/src/model/google/token_info.dart'; 6 | import 'package:cocoon_service/src/service/firebase_jwt_validator.dart'; 7 | import 'package:jose_plus/src/jwk.dart'; 8 | 9 | class FakeFirebaseJwtValidator implements FirebaseJwtValidator { 10 | final jwts = []; 11 | 12 | @override 13 | Future decodeAndVerify(String jwtString) async { 14 | if (jwts.isEmpty) { 15 | throw JwtException('JWT invalid'); 16 | } 17 | return jwts.removeAt(0); 18 | } 19 | 20 | @override 21 | JsonWebKeyStore get keyStore => throw UnimplementedError(); 22 | 23 | @override 24 | Future maybeRefreshKeyStore() { 25 | throw UnimplementedError(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/bbv2_extension.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:buildbucket/buildbucket_pb.dart' as bbv2; 6 | import 'package:cocoon_common/task_status.dart'; 7 | 8 | extension StatusExtension on bbv2.Status { 9 | /// Converts from a [bbv2.Status] to a [TaskStatus]. 10 | /// 11 | /// An unrecognized status is disallowed. 12 | TaskStatus toTaskStatus() { 13 | return switch (this) { 14 | bbv2.Status.SCHEDULED || bbv2.Status.STARTED => TaskStatus.inProgress, 15 | bbv2.Status.SUCCESS => TaskStatus.succeeded, 16 | bbv2.Status.CANCELED => TaskStatus.cancelled, 17 | bbv2.Status.INFRA_FAILURE => TaskStatus.infraFailure, 18 | bbv2.Status.FAILURE => TaskStatus.failed, 19 | _ => throw StateError('Unexpected status: $this'), 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dashboard/test/rpc_model/build_status_response_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/rpc_model.dart'; 6 | import 'package:flutter_test/flutter_test.dart'; 7 | 8 | void main() { 9 | final success = BuildStatusResponse( 10 | buildStatus: BuildStatus.success, 11 | failingTasks: [], 12 | ); 13 | final failure = BuildStatusResponse( 14 | buildStatus: BuildStatus.failure, 15 | failingTasks: ['failing_task'], 16 | ); 17 | 18 | test('implements == and hashCode', () { 19 | expect(success, success); 20 | expect(failure, failure); 21 | }); 22 | 23 | test('encodes and decodes to JSON', () { 24 | expect(BuildStatusResponse.fromJson(success.toJson()), success); 25 | expect(BuildStatusResponse.fromJson(failure.toJson()), failure); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /app_dart/lib/src/service/flags/consolidated_check_run_flow_flags.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: always_specify_types, implicit_dynamic_parameter 4 | 5 | part of 'consolidated_check_run_flow_flags.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | ConsolidatedCheckRunFlow _$ConsolidatedCheckRunFlowFromJson( 12 | Map json, 13 | ) => ConsolidatedCheckRunFlow( 14 | useForAll: json['useForAll'] as bool?, 15 | useForUsers: (json['useForUsers'] as List?) 16 | ?.map((e) => e as String) 17 | .toList(), 18 | ); 19 | 20 | Map _$ConsolidatedCheckRunFlowToJson( 21 | ConsolidatedCheckRunFlow instance, 22 | ) => { 23 | 'useForAll': instance.useForAll, 24 | 'useForUsers': instance.useForUsers, 25 | }; 26 | -------------------------------------------------------------------------------- /auto_submit/test/src/validations/fake_approval.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/model/auto_submit_query_result.dart'; 6 | 7 | import 'package:auto_submit/validations/approval.dart'; 8 | import 'package:auto_submit/validations/validation.dart'; 9 | import 'package:github/github.dart' as github; 10 | 11 | class FakeApproval extends Approval { 12 | FakeApproval({required super.config}); 13 | 14 | ValidationResult? validationResult; 15 | 16 | @override 17 | String get name => 'FakeApproval'; 18 | 19 | /// Implements the code review approval logic. 20 | @override 21 | Future validate( 22 | QueryResult result, 23 | github.PullRequest messagePullRequest, 24 | ) async { 25 | return validationResult ?? ValidationResult(true, Action.REMOVE_LABEL, ''); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 1.0.12 2 | 3 | - Adding dependencies for resultdb. 4 | 5 | # 1.0.11 6 | 7 | - Add resultsDb protos to the lib. 8 | 9 | # 1.0.10 10 | 11 | - Expose Builder_Item and Builder_Metadata. 12 | 13 | # 1.0.9 14 | 15 | - Pin versions due to https://github.com/flutter/flutter/issues/110272 16 | 17 | # 1.0.8 18 | 19 | - Update dependencies. 20 | 21 | # 1.0.7 22 | 23 | - Expose the google.protobuf dependency objects. 24 | 25 | # 1.0.6 26 | 27 | - Expose all objects in build, builds_service and builder_service. 28 | 29 | # 1.0.5 30 | 31 | - Expose build bucket clients and supporting fields like StringPair. 32 | 33 | # 1.0.4 34 | 35 | - Expose status enums and related status fields from the Build proto. 36 | 37 | # 1.0.1 38 | 39 | - Update required Dart revisions for sound null safety. 40 | - Add the notification proto for buildbucket v2. 41 | 42 | 43 | # 1.0.0 44 | 45 | - Initial version generating dart code for Buildbucket protos. 46 | -------------------------------------------------------------------------------- /auto_submit/test/src/validations/fake_required_check_runs.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/model/auto_submit_query_result.dart' as auto; 6 | import 'package:auto_submit/validations/required_check_runs.dart'; 7 | import 'package:auto_submit/validations/validation.dart'; 8 | import 'package:github/github.dart' as github; 9 | 10 | class FakeRequiredCheckRuns extends RequiredCheckRuns { 11 | FakeRequiredCheckRuns({required super.config}); 12 | 13 | ValidationResult? validationResult; 14 | 15 | @override 16 | String get name => 'FakeRequiredCheckRuns'; 17 | 18 | @override 19 | Future validate( 20 | auto.QueryResult result, 21 | github.PullRequest messagePullRequest, 22 | ) async { 23 | return validationResult ?? ValidationResult(true, Action.REMOVE_LABEL, ''); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /cipd_packages/codesign/bin/verify.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:io' as io; 6 | 7 | import 'package:codesign/verify.dart'; 8 | import 'package:logging/logging.dart'; 9 | 10 | Future main(List args) async { 11 | final logger = Logger('root'); 12 | logger.onRecord.listen((LogRecord record) { 13 | io.stdout.writeln(record.message); 14 | }); 15 | if (args.length != 1) { 16 | logger.info('Usage: dart verify.dart [FILE]'); 17 | io.exit(1); 18 | } 19 | if (!io.Platform.isMacOS) { 20 | logger.severe('This tool must be run from macOS.'); 21 | io.exit(1); 22 | } 23 | final inputFile = args[0]; 24 | final result = await VerificationService( 25 | binaryPath: inputFile, 26 | logger: logger, 27 | ).run(); 28 | io.exit(result == VerificationResult.codesignedAndNotarized ? 0 : 1); 29 | } 30 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/content_hash_lookup.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:json_annotation/json_annotation.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | import 'base.dart'; 9 | 10 | part 'content_hash_lookup.g.dart'; 11 | 12 | @JsonSerializable(checked: true) 13 | @immutable 14 | final class ContentHashLookup extends Model { 15 | ContentHashLookup({required this.contentHash, required this.gitShas}); 16 | 17 | factory ContentHashLookup.fromJson(Map json) { 18 | return _$ContentHashLookupFromJson(json); 19 | } 20 | 21 | @JsonKey(name: 'contentHash') 22 | final String contentHash; 23 | 24 | @JsonKey(name: 'gitShas') 25 | final List gitShas; 26 | 27 | @override 28 | Map toJson() { 29 | return _$ContentHashLookupToJson(this); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/test/src/fake_ios_device.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import 'package:device_doctor/src/ios_device.dart'; 8 | import 'package:process/process.dart'; 9 | 10 | class FakeIosDeviceDiscovery extends IosDeviceDiscovery { 11 | FakeIosDeviceDiscovery(super._outputFilePath) : super.testing(); 12 | 13 | List? _outputs; 14 | int _pos = 0; 15 | 16 | set outputs(List outputs) { 17 | _pos = 0; 18 | _outputs = outputs; 19 | } 20 | 21 | @override 22 | Future deviceListOutput({ 23 | ProcessManager processManager = const LocalProcessManager(), 24 | }) async { 25 | _pos++; 26 | if (_outputs?[_pos - 1] is String) { 27 | return _outputs?[_pos - 1] as String; 28 | } else { 29 | throw _outputs?[_pos - 1] as String; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /dev/salt.minion.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.saltstack.salt.minion 7 | RunAtLoad 8 | 9 | KeepAlive 10 | 11 | EnvironmentVariables 12 | 13 | PATH 14 | /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/salt/bin 15 | 16 | ProgramArguments 17 | 18 | /opt/salt/bin/salt-minion 19 | 20 | SoftResourceLimits 21 | 22 | NumberOfFiles 23 | 100000 24 | 25 | HardResourceLimits 26 | 27 | NumberOfFiles 28 | 100000 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /packages/cocoon_common/test/is_release_branch_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/is_release_branch.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | void main() { 9 | test('master is not a release branch', () { 10 | expect(isReleaseCandidateBranch(branchName: 'master'), isFalse); 11 | }); 12 | 13 | test('main is not a release branch', () { 14 | expect(isReleaseCandidateBranch(branchName: 'main'), isFalse); 15 | }); 16 | 17 | test('flutter-x.x-candidate.x is a release branch', () { 18 | expect( 19 | isReleaseCandidateBranch(branchName: 'flutter-2.1-candidate.0'), 20 | isTrue, 21 | ); 22 | }); 23 | 24 | test('flutter-xx.xx-candidate.xx is a release branch', () { 25 | expect( 26 | isReleaseCandidateBranch(branchName: 'flutter-11.22-candidate.33'), 27 | isTrue, 28 | ); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/content_hash_lookup.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'content_hash_lookup.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ContentHashLookup _$ContentHashLookupFromJson(Map json) => 10 | $checkedCreate('ContentHashLookup', json, ($checkedConvert) { 11 | final val = ContentHashLookup( 12 | contentHash: $checkedConvert('contentHash', (v) => v as String), 13 | gitShas: $checkedConvert( 14 | 'gitShas', 15 | (v) => (v as List).map((e) => e as String).toList(), 16 | ), 17 | ); 18 | return val; 19 | }); 20 | 21 | Map _$ContentHashLookupToJson(ContentHashLookup instance) => 22 | { 23 | 'contentHash': instance.contentHash, 24 | 'gitShas': instance.gitShas, 25 | }; 26 | -------------------------------------------------------------------------------- /auto_submit/lib/requests/github_pull_request_event.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'github_pull_request_event.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GithubPullRequestEvent _$GithubPullRequestEventFromJson( 10 | Map json, 11 | ) => GithubPullRequestEvent( 12 | pullRequest: json['pull_request'] == null 13 | ? null 14 | : PullRequest.fromJson(json['pull_request'] as Map), 15 | action: json['action'] as String?, 16 | sender: json['sender'] == null 17 | ? null 18 | : User.fromJson(json['sender'] as Map), 19 | ); 20 | 21 | Map _$GithubPullRequestEventToJson( 22 | GithubPullRequestEvent instance, 23 | ) => { 24 | 'pull_request': instance.pullRequest, 25 | 'action': instance.action, 26 | 'sender': instance.sender, 27 | }; 28 | -------------------------------------------------------------------------------- /dashboard/lib/widgets/sign_in_button/sign_in_button_native.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | import '../../service/firebase_auth.dart'; 9 | 10 | /// Widget that users can click to initiate the Sign In process. 11 | class SignInButton extends StatelessWidget { 12 | const SignInButton({super.key}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | final authService = Provider.of(context); 17 | final textButtonForeground = Theme.of(context).brightness == Brightness.dark 18 | ? Colors.white 19 | : Colors.black87; 20 | 21 | return TextButton( 22 | style: TextButton.styleFrom(foregroundColor: textButtonForeground), 23 | onPressed: authService.signInWithGithub, 24 | child: const Text('SIGN IN'), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/commit_status.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:json_annotation/json_annotation.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | import 'base.dart'; 9 | import 'commit.dart'; 10 | import 'task.dart'; 11 | 12 | part 'commit_status.g.dart'; 13 | 14 | @JsonSerializable(checked: true) 15 | @immutable 16 | final class CommitStatus extends Model { 17 | CommitStatus({required this.commit, required Iterable tasks}) 18 | : tasks = List.unmodifiable(tasks); 19 | 20 | factory CommitStatus.fromJson(Map json) { 21 | return _$CommitStatusFromJson(json); 22 | } 23 | 24 | @JsonKey(name: 'Commit') 25 | final Commit commit; 26 | 27 | @JsonKey(name: 'Tasks') 28 | final List tasks; 29 | 30 | @override 31 | Map toJson() { 32 | return _$CommitStatusToJson(this); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dashboard/test/utils/generate_commit_for_tests.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/rpc_model.dart'; 6 | 7 | import 'generate_task_for_tests.dart' show utc$2020_9_1_12_30; 8 | export 'generate_task_for_tests.dart' show utc$2020_9_1_12_30; 9 | 10 | /// Generates a [Commit] for use in a test fixture. 11 | Commit generateCommitForTest({ 12 | DateTime? timestamp, 13 | String author = 'author', 14 | String avatarUrl = '', 15 | String sha = 'abc123', 16 | String branch = 'master', 17 | String message = 'Commit message', 18 | String repository = 'flutter/flutter', 19 | }) { 20 | timestamp ??= utc$2020_9_1_12_30; 21 | return Commit( 22 | timestamp: timestamp.millisecondsSinceEpoch, 23 | sha: sha, 24 | author: CommitAuthor(login: author, avatarUrl: avatarUrl), 25 | branch: branch, 26 | message: message, 27 | repository: repository, 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/field_mask.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/field_mask.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use fieldMaskDescriptor instead') 17 | const FieldMask$json = { 18 | '1': 'FieldMask', 19 | '2': [ 20 | {'1': 'paths', '3': 1, '4': 3, '5': 9, '10': 'paths'}, 21 | ], 22 | }; 23 | 24 | /// Descriptor for `FieldMask`. Decode as a `google.protobuf.DescriptorProto`. 25 | final $typed_data.Uint8List fieldMaskDescriptor = 26 | $convert.base64Decode('CglGaWVsZE1hc2sSFAoFcGF0aHMYASADKAlSBXBhdGhz'); 27 | -------------------------------------------------------------------------------- /packages/cocoon_common/test/severity_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/cocoon_common.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | void main() { 9 | test('is ordered in a rational way', () { 10 | expect(Severity.values, orderedEquals([...Severity.values]..sort())); 11 | }); 12 | 13 | test('operator >', () { 14 | expect(Severity.warning, greaterThan(Severity.info)); 15 | }); 16 | 17 | test('operator >=', () { 18 | expect(Severity.warning, greaterThanOrEqualTo(Severity.info)); 19 | expect(Severity.warning, greaterThanOrEqualTo(Severity.warning)); 20 | }); 21 | test('operator <', () { 22 | expect(Severity.info, lessThan(Severity.warning)); 23 | }); 24 | 25 | test('operator <=', () { 26 | expect(Severity.info, lessThanOrEqualTo(Severity.info)); 27 | expect(Severity.info, lessThanOrEqualTo(Severity.warning)); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/README.md: -------------------------------------------------------------------------------- 1 | # Dart Buildbucket 2 | 3 | Dart LUCI buildbucket protobufs. 4 | 5 | ## Details 6 | 7 | These protobufs are used to communicate with LUCI Buildbucket services from Dart Language. 8 | 9 | ## Regenerating the protos 10 | 11 | * Run `dart pub global activate protoc_plugin`. 12 | * From `packages/buildbucket-dart` run `bash tool/regenerate.sh`. 13 | 14 | That will checkout protobuf, buildbucket and googleapis repositories. It will also compile the protos 15 | and generate their correspondent Dart classes. 16 | 17 | ## Validating Changes 18 | 19 | In order to validate the changes you have made before releasing a new version you can point your project 20 | to the local directory for packages/buildbucket-dart by doing the following in your project's pubspec.yaml: 21 | 22 | ```dart 23 | dependencies: 24 | buildbucket-dart: 25 | path: /your/path/to/packages/buildbucket-dart 26 | ``` 27 | 28 | ## Feedback 29 | 30 | File an issue in flutter/flutter with the word 'buildbucket-dart' clearly in the title and cc @godofredoc. 31 | -------------------------------------------------------------------------------- /test_utilities/bin/flutter_test_runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # This file is used by 7 | # https://github.com/flutter/tests/tree/master/registry/flutter_cocoon.test 8 | # to run the tests of certain packages in this repository as a presubmit 9 | # for the flutter/flutter repository. 10 | # Changes to this file (and any tests in this repository) are only honored 11 | # after the commit hash in the "flutter_cocoon.test" mentioned above has 12 | # been updated. 13 | 14 | # Runner for flutter tests. It expects a single parameter with the full 15 | # path to the flutter project where tests will be run. 16 | 17 | set -ex 18 | 19 | echo "Running flutter tests from $1" 20 | pushd "$1" > /dev/null 21 | 22 | flutter packages get 23 | flutter analyze --no-fatal-infos 24 | dart format --set-exit-if-changed . 25 | flutter test --test-randomize-ordering-seed=random --reporter expanded 26 | 27 | popd > /dev/null 28 | -------------------------------------------------------------------------------- /cipd_packages/codesign/tool/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Fetches corresponding dart sdk from CIPD for different platforms, builds 7 | # an executable binary of codesign to `build` folder. 8 | # 9 | # This build script will be triggered on Mac code signing machines. 10 | 11 | set -e 12 | 13 | command -v cipd > /dev/null || { 14 | echo "Please install CIPD (available from depot_tools) and add to path first."; 15 | exit -1; 16 | } 17 | 18 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)" 19 | OS="`uname`" 20 | 21 | cipd ensure -ensure-file $DIR/ensure_file -root $DIR 22 | 23 | pushd $DIR/.. 24 | 25 | if [[ -d "build" ]]; then 26 | echo "Please remove the build directory before proceeding" 27 | exit -1 28 | fi 29 | 30 | mkdir -p build 31 | tool/bin/dart pub get 32 | tool/bin/dart compile exe bin/codesign.dart -o build/codesign 33 | 34 | cp -f LICENSE build/ 35 | 36 | popd 37 | -------------------------------------------------------------------------------- /packages/cocoon_server_test/lib/fake_secret_manager.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:typed_data'; 6 | 7 | import 'package:cocoon_server/secret_manager.dart'; 8 | 9 | /// A fake (in-memory) implementation of [SecretManager]. 10 | final class FakeSecretManager extends SecretManager { 11 | final _secrets = {}; 12 | 13 | /// Adds (or replaces an existing) secret as bytes. 14 | void putBytes(String name, List value) { 15 | _secrets[name] = Uint8List.fromList(value); 16 | } 17 | 18 | /// Adds (or replace an existing) secrets as a UTF-16 string. 19 | void putString(String name, String value) { 20 | putBytes(name, value.codeUnits); 21 | } 22 | 23 | /// Removes a secret. 24 | void remove(String name) { 25 | _secrets.remove(name); 26 | } 27 | 28 | @override 29 | Future tryGetBytes(String name) async { 30 | return _secrets[name]?.sublist(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/google/firebase_jwt_claim.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ignore_for_file: always_specify_types, implicit_dynamic_parameter 4 | 5 | part of 'firebase_jwt_claim.dart'; 6 | 7 | // ************************************************************************** 8 | // JsonSerializableGenerator 9 | // ************************************************************************** 10 | 11 | FirebaseJwtClaim _$FirebaseJwtClaimFromJson(Map json) => 12 | FirebaseJwtClaim( 13 | identities: (json['identities'] as Map?)?.map( 14 | (k, e) => 15 | MapEntry(k, (e as List).map((e) => e as String).toList()), 16 | ), 17 | signInProvider: json['sign_in_provider'] as String?, 18 | tenant: json['tenant'] as String?, 19 | ); 20 | 21 | Map _$FirebaseJwtClaimToJson(FirebaseJwtClaim instance) => 22 | { 23 | 'identities': instance.identities, 24 | 'sign_in_provider': instance.signInProvider, 25 | 'tenant': instance.tenant, 26 | }; 27 | -------------------------------------------------------------------------------- /packages/cocoon_server/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cocoon_server 2 | description: server-side functionality shared between `app_dart` and `auto_submit`. 3 | publish_to: none 4 | 5 | resolution: workspace 6 | 7 | environment: 8 | sdk: ^3.9.0 9 | 10 | # Version constraints in this package are intentionally relaxed, because the 11 | # exact versions are locked by app_dart and auto_submit apps. 12 | dependencies: 13 | _discoveryapis_commons: any 14 | cocoon_common: 15 | path: ../cocoon_common 16 | github: ^9.24.0 17 | googleapis: 14.0.0 18 | googleapis_auth: 2.0.0 19 | gql: ^1.0.1-alpha+1709845491443 20 | graphql: ^5.2.0-beta.9 21 | http: ^1.2.2 22 | jose_plus: ^0.4.6 23 | json_annotation: ^4.8.1 24 | logging: ^1.2.0 25 | meta: ^1.16.0 26 | path: ^1.9.1 27 | retry: ^3.1.2 28 | 29 | dev_dependencies: 30 | build_runner: ^2.4.13 31 | cocoon_server_test: 32 | path: ../cocoon_server_test 33 | dart_flutter_team_lints: 3.5.0 34 | fake_async: ^1.3.2 35 | json_serializable: ^6.7.1 36 | mockito: ^5.4.6 37 | test: ^1.25.8 38 | 39 | builders: 40 | json_serializable: ^3.3.0 41 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/any.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/any.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use anyDescriptor instead') 17 | const Any$json = { 18 | '1': 'Any', 19 | '2': [ 20 | {'1': 'type_url', '3': 1, '4': 1, '5': 9, '10': 'typeUrl'}, 21 | {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, 22 | ], 23 | }; 24 | 25 | /// Descriptor for `Any`. Decode as a `google.protobuf.DescriptorProto`. 26 | final $typed_data.Uint8List anyDescriptor = $convert.base64Decode( 27 | 'CgNBbnkSGQoIdHlwZV91cmwYASABKAlSB3R5cGVVcmwSFAoFdmFsdWUYAiABKAxSBXZhbHVl'); 28 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/go.chromium.org/luci/common/proto/structmask/structmask.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: go.chromium.org/luci/common/proto/structmask/structmask.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use structMaskDescriptor instead') 17 | const StructMask$json = { 18 | '1': 'StructMask', 19 | '2': [ 20 | {'1': 'path', '3': 1, '4': 3, '5': 9, '10': 'path'}, 21 | ], 22 | }; 23 | 24 | /// Descriptor for `StructMask`. Decode as a `google.protobuf.DescriptorProto`. 25 | final $typed_data.Uint8List structMaskDescriptor = 26 | $convert.base64Decode('CgpTdHJ1Y3RNYXNrEhIKBHBhdGgYASADKAlSBHBhdGg='); 27 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/commit_status.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'commit_status.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | CommitStatus _$CommitStatusFromJson(Map json) => 10 | $checkedCreate('CommitStatus', json, ($checkedConvert) { 11 | final val = CommitStatus( 12 | commit: $checkedConvert( 13 | 'Commit', 14 | (v) => Commit.fromJson(v as Map), 15 | ), 16 | tasks: $checkedConvert( 17 | 'Tasks', 18 | (v) => (v as List).map( 19 | (e) => Task.fromJson(e as Map), 20 | ), 21 | ), 22 | ); 23 | return val; 24 | }, fieldKeyMap: const {'commit': 'Commit', 'tasks': 'Tasks'}); 25 | 26 | Map _$CommitStatusToJson(CommitStatus instance) => 27 | {'Commit': instance.commit, 'Tasks': instance.tasks}; 28 | -------------------------------------------------------------------------------- /app_dart/integration_test/common.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | import 'package:github/github.dart'; 8 | import 'package:test/test.dart'; 9 | 10 | /// Validates the local tree has no outstanding changes. 11 | void expectNoDiff(String path) { 12 | final gitResult = Process.runSync('git', [ 13 | 'diff', 14 | '--exit-code', 15 | path, 16 | ]); 17 | if (gitResult.exitCode != 0) { 18 | final gitDiffOutput = Process.runSync('git', ['diff', path]); 19 | fail( 20 | 'The working tree has a diff. Ensure changes are checked in:\n${gitDiffOutput.stdout}', 21 | ); 22 | } 23 | } 24 | 25 | /// Wrapper class to make it easy to add new repos + branches to the validation suite. 26 | class SupportedConfig { 27 | SupportedConfig(this.slug, [this.branch = 'main']); 28 | 29 | final RepositorySlug slug; 30 | final String branch; 31 | 32 | @override 33 | String toString() => '${slug.fullName}/$branch'; 34 | } 35 | -------------------------------------------------------------------------------- /app_dart/lib/src/foundation/providers.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:appengine/appengine.dart' as gae; 6 | import 'package:http/http.dart' as http; 7 | 8 | import 'typedefs.dart'; 9 | 10 | /// Class that holds static default providers. 11 | class Providers { 12 | const Providers._(); 13 | 14 | /// Default [http.Client] provider. 15 | /// 16 | /// See also: 17 | /// 18 | /// * [HttpClientProvider], which defines this interface. 19 | static http.Client freshHttpClient() => http.Client(); 20 | 21 | /// Default [gae.Logging] provider. 22 | /// 23 | /// See also: 24 | /// 25 | /// * [LoggingProvider], which defines this interface. 26 | static gae.Logging serviceScopeLogger() => gae.loggingService; 27 | 28 | /// Default [gae.ClientContext] provider. 29 | /// 30 | /// See also: 31 | /// 32 | /// * [ClientContextProvider], which defines this interface. 33 | static gae.ClientContext serviceScopeContext() => gae.context; 34 | } 35 | -------------------------------------------------------------------------------- /dev/prs_to_main.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Run via ./prs_to_main.sh $GITHUB_USERNAME $GITHUB_TOKEN $REPOSITORY_NAME_WITH_OWNER 7 | # 8 | # To keep this script simple, you'll need to rerun this multiple times until it stops 9 | # outputting PRs (indicating it processed all PRs) 10 | 11 | GITHUB_ACTOR=$1 12 | GITHUB_TOKEN=$2 13 | GITHUB_REPOSITORY=$3 14 | PREVIOUS_DEFAULT="master" 15 | NEW_DEFAULT="main" 16 | GITHUB_API_URL="https://api.github.com" 17 | 18 | # Check all existing PRs to see if we should change their base 19 | PRS=$(curl --silent -u $GITHUB_ACTOR:$GITHUB_TOKEN "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?base=$PREVIOUS_DEFAULT&state=open") 20 | 21 | for row in $(echo $PRS | jq -r 'map(select(.locked == false)) | .[].url'); do 22 | echo "Attempting to update $row" 23 | curl --silent --show-error -w "Status Code: %{http_code}\n" --request PATCH --data '{"base": "'$NEW_DEFAULT'"}' -u $GITHUB_ACTOR:$GITHUB_TOKEN "$row" 24 | done 25 | -------------------------------------------------------------------------------- /app_dart/test/model/firestore/commit_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_server_test/test_logging.dart'; 6 | import 'package:cocoon_service/src/model/firestore/commit.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | import '../../src/service/fake_firestore_service.dart'; 10 | import '../../src/utilities/entity_generators.dart'; 11 | 12 | void main() { 13 | useTestLoggerPerTest(); 14 | 15 | late FakeFirestoreService firestoreService; 16 | 17 | setUp(() { 18 | firestoreService = FakeFirestoreService(); 19 | }); 20 | 21 | test('generates commit correctly', () async { 22 | final storedCommit = generateFirestoreCommit(1); 23 | firestoreService.putDocument(storedCommit); 24 | 25 | final resultedCommit = await Commit.fromFirestoreBySha( 26 | firestoreService, 27 | sha: storedCommit.sha, 28 | ); 29 | expect(resultedCommit.name, storedCommit.name); 30 | expect(resultedCommit.fields, storedCommit.fields); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /.github/workflows/app_dart_tests.yaml: -------------------------------------------------------------------------------- 1 | name: Test app_dart 2 | 3 | on: 4 | pull_request: 5 | branches: [main] 6 | paths: 7 | - "app_dart/**" 8 | - "packages/**" 9 | - ".github/workflows/app_dart_tests.yaml" 10 | push: 11 | branches: [main] 12 | 13 | jobs: 14 | test-app-dart: 15 | runs-on: ubuntu-latest 16 | defaults: 17 | run: 18 | working-directory: app_dart 19 | 20 | steps: 21 | - name: Set up Flutter 22 | uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e 23 | with: 24 | channel: stable 25 | architecture: x64 # only needed for running locally (mac) 26 | 27 | - name: Checkout code 28 | uses: actions/checkout@v6 29 | 30 | - name: Get packages 31 | run: | 32 | dart pub get 33 | 34 | - name: dart analyze app_dart 35 | run: | 36 | dart analyze --fatal-infos 37 | 38 | - name: dart format app_dart 39 | run: | 40 | dart format --set-exit-if-changed . 41 | 42 | - name: dart test app_dart 43 | run: | 44 | dart test test 45 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/build_status_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'build_status_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | BuildStatusResponse _$BuildStatusResponseFromJson(Map json) => 10 | $checkedCreate('BuildStatusResponse', json, ($checkedConvert) { 11 | final val = BuildStatusResponse( 12 | buildStatus: $checkedConvert( 13 | 'buildStatus', 14 | (v) => BuildStatus._byName(v as String), 15 | ), 16 | failingTasks: $checkedConvert( 17 | 'failingTasks', 18 | (v) => (v as List?)?.map((e) => e as String) ?? [], 19 | ), 20 | ); 21 | return val; 22 | }); 23 | 24 | Map _$BuildStatusResponseToJson( 25 | BuildStatusResponse instance, 26 | ) => { 27 | 'buildStatus': BuildStatus._toName(instance.buildStatus), 28 | 'failingTasks': instance.failingTasks, 29 | }; 30 | -------------------------------------------------------------------------------- /packages/cocoon_server/lib/access_client_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:http/http.dart'; 6 | 7 | /// Creates a Firestore base client for none (default) database. 8 | /// 9 | /// A default header is required for none (default) Firestore API calls. 10 | /// Both `project_id` and `database_id` are required. 11 | /// 12 | /// https://firebase.google.com/docs/firestore/manage-databases#access_a_named_database_with_a_client_library 13 | class FirestoreBaseClient extends BaseClient { 14 | FirestoreBaseClient({required this.projectId, required this.databaseId}); 15 | final String databaseId; 16 | final String projectId; 17 | final Client client = Client(); 18 | @override 19 | Future send(BaseRequest request) { 20 | final defaultHeaders = { 21 | 'x-goog-request-params': 'project_id=$projectId&database_id=$databaseId', 22 | }; 23 | request.headers.addAll(defaultHeaders); 24 | return client.send(request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dev/cocoon_code_health/lib/src/checks.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_common/cocoon_common.dart'; 6 | import 'package:file/file.dart'; 7 | import 'package:glob/glob.dart'; 8 | 9 | /// A check that can be made against a file. 10 | abstract base class Check { 11 | const Check(); 12 | 13 | /// What files should be checked by this check. 14 | /// 15 | /// Assume the context is relative to the Cocoon repository root. 16 | Iterable get include; 17 | 18 | /// Whether to exclude certian files from this check. 19 | /// 20 | /// If omitted, does nothing. 21 | /// 22 | /// Assume the context is relative to the Cocoon repository root. 23 | Iterable get exclude => const []; 24 | 25 | /// Checks [file] for violations of `this`. 26 | /// 27 | /// May optionally emit diagnostic information to [logger]. 28 | Future check(LogSink logger, File file); 29 | } 30 | 31 | /// Possible reuslts for [Check.check]. 32 | enum CheckResult { failed, passed } 33 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/duration.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/duration.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use durationDescriptor instead') 17 | const Duration$json = { 18 | '1': 'Duration', 19 | '2': [ 20 | {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'}, 21 | {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'}, 22 | ], 23 | }; 24 | 25 | /// Descriptor for `Duration`. Decode as a `google.protobuf.DescriptorProto`. 26 | final $typed_data.Uint8List durationDescriptor = $convert.base64Decode( 27 | 'CghEdXJhdGlvbhIYCgdzZWNvbmRzGAEgASgDUgdzZWNvbmRzEhQKBW5hbm9zGAIgASgFUgVuYW' 28 | '5vcw=='); 29 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/commit_ref.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:github/github.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | /// Represents components of a GitHub commit without specifying the backend. 9 | @immutable 10 | final class CommitRef { 11 | CommitRef({required this.sha, required this.branch, required this.slug}); 12 | 13 | /// The commit SHA. 14 | final String sha; 15 | 16 | /// The commit branch. 17 | final String branch; 18 | 19 | /// The commit repository (owner and repo) on GitHub. 20 | final RepositorySlug slug; 21 | 22 | @override 23 | bool operator ==(Object other) { 24 | if (other is! CommitRef) { 25 | return false; 26 | } 27 | return sha == other.sha && branch == other.branch && slug == other.slug; 28 | } 29 | 30 | @override 31 | int get hashCode { 32 | return Object.hash(sha, branch, slug); 33 | } 34 | 35 | @override 36 | String toString() { 37 | return 'Commit <$sha (${slug.fullName}/$branch)>'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/github/annotations.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | 7 | import 'package:json_annotation/json_annotation.dart'; 8 | 9 | part 'annotations.g.dart'; 10 | 11 | /// Data models for json messages coming from GitHub Annotations. 12 | @JsonSerializable(fieldRename: FieldRename.snake) 13 | class Annotation { 14 | /// Support parsing directly from the API's `[{},]` response. 15 | static List fromJsonList(List input) => 16 | input.whereType>().map(Annotation.fromJson).toList(); 17 | 18 | Annotation({this.annotationLevel, this.message}); 19 | factory Annotation.fromJson(Map input) => 20 | _$AnnotationFromJson(input); 21 | 22 | String? annotationLevel; 23 | String? message; 24 | 25 | Map toJson() => _$AnnotationToJson(this); 26 | 27 | @override 28 | String toString() { 29 | return '$Annotation ${const JsonEncoder.withIndent(' ').convert(toJson())}'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/timestamp.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/timestamp.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use timestampDescriptor instead') 17 | const Timestamp$json = { 18 | '1': 'Timestamp', 19 | '2': [ 20 | {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'}, 21 | {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'}, 22 | ], 23 | }; 24 | 25 | /// Descriptor for `Timestamp`. Decode as a `google.protobuf.DescriptorProto`. 26 | final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode( 27 | 'CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbm' 28 | 'Fub3M='); 29 | -------------------------------------------------------------------------------- /app_dart/lib/src/service/luci_build_service/cipd_version.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:meta/meta.dart'; 6 | 7 | /// Which LUCI Executable (e.g. recipe) to use. 8 | /// 9 | /// See also: `exe_cipd_version` in [`class BuildbucketApi(RecipeApi`)](https://chromium.googlesource.com/infra/luci/recipes-py/+/HEAD/README.recipes.md#class-buildbucketapi_recipeapi). 10 | @immutable 11 | final class CipdVersion { 12 | const CipdVersion({required String branch}) : version = 'refs/heads/$branch'; 13 | 14 | /// The default recipe to use 15 | static const defaultRecipe = CipdVersion(branch: 'main'); 16 | 17 | /// The version string, in the format, `refs/heads/{{branch}}`. 18 | final String version; 19 | 20 | @override 21 | int get hashCode => version.hashCode; 22 | 23 | @override 24 | bool operator ==(Object other) { 25 | return other is CipdVersion && other.version == version; 26 | } 27 | 28 | @override 29 | String toString() { 30 | return 'CipdVersion <$version>'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /auto_submit/lib/service/discord_notification.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_server/logging.dart'; 6 | 7 | import '../foundation/providers.dart'; 8 | 9 | class DiscordNotification { 10 | DiscordNotification({required this.targetUri, Map? headers}) { 11 | this.headers = headers ??= defaultHeaders; 12 | } 13 | 14 | Uri? targetUri; 15 | Map? headers; 16 | Map defaultHeaders = { 17 | 'content-type': 'application/json', 18 | }; 19 | 20 | final HttpProvider httpProvider = Providers.freshHttpClient; 21 | 22 | Future notifyDiscordChannelWebhook(String jsonMessageString) async { 23 | final client = httpProvider(); 24 | 25 | final response = await client.post( 26 | targetUri!, 27 | headers: defaultHeaders, 28 | body: jsonMessageString, 29 | ); 30 | 31 | log.info('discord webhook status: ${response.statusCode}'); 32 | log.info('discord webhook response body: ${response.body}'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the static analysis results for your project (errors, 2 | # warnings, and lints). 3 | # 4 | # This enables the 'recommended' set of lints from `package:lints`. 5 | # This set helps identify many issues that may lead to problems when running 6 | # or consuming Dart code, and enforces writing Dart using a single, idiomatic 7 | # style and format. 8 | # 9 | # If you want a smaller set of lints you can change this to specify 10 | # 'package:lints/core.yaml'. These are just the most critical lints 11 | # (the recommended set includes the core lints). 12 | # The core lints are also what is used by pub.dev for scoring packages. 13 | 14 | include: package:lints/recommended.yaml 15 | 16 | # Uncomment the following section to specify additional rules. 17 | 18 | # linter: 19 | # rules: 20 | # - camel_case_types 21 | 22 | analyzer: 23 | exclude: 24 | - lib/src/generated/** 25 | 26 | # For more information about the core and recommended set of lints, see 27 | # https://dart.dev/go/core-lints 28 | 29 | # For additional information about configuring this file, see 30 | # https://dart.dev/guides/language/analysis-options 31 | -------------------------------------------------------------------------------- /app_dart/index.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | indexes: 6 | - kind: Checklist 7 | ancestor: yes 8 | properties: 9 | - name: CreateTimestamp 10 | direction: desc 11 | - kind: Checklist 12 | properties: 13 | - name: Branch 14 | - name: CreateTimestamp 15 | direction: desc 16 | - kind: Checklist 17 | properties: 18 | - name: FlutterRepositoryPath 19 | - name: Branch 20 | - name: CreateTimestamp 21 | direction: desc 22 | - kind: Task 23 | ancestor: yes 24 | properties: 25 | - name: StageName 26 | direction: desc 27 | - kind: Task 28 | properties: 29 | - name: Status 30 | - name: CreateTimestamp 31 | direction: desc 32 | - kind: Task 33 | ancestor: yes 34 | properties: 35 | - name: Name 36 | - name: CreateTimestamp 37 | direction: desc 38 | - kind: Task 39 | ancestor: yes 40 | properties: 41 | - name: CreateTimestamp 42 | direction: desc 43 | - kind: LogChunk 44 | ancestor: no 45 | properties: 46 | - name: OwnerKey 47 | - name: CreateTimestamp 48 | direction: asc 49 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/common/firestore_extensions.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:googleapis/firestore/v1.dart'; 6 | 7 | extension StringToValue on String { 8 | Value toValue() => Value(stringValue: this); 9 | } 10 | 11 | extension IntToValue on int { 12 | Value toValue() => Value(integerValue: '$this'); 13 | } 14 | 15 | extension BooleanToValue on bool { 16 | Value toValue() => Value(booleanValue: this); 17 | } 18 | 19 | extension DateTimeToValue on DateTime { 20 | Value toValue() => Value(timestampValue: toUtc().toIso8601String()); 21 | } 22 | 23 | extension ListToValue on List { 24 | Value toValue() => Value(arrayValue: toArrayValue()); 25 | 26 | ArrayValue toArrayValue() => ArrayValue( 27 | values: [ 28 | for (final t in this) 29 | switch (t) { 30 | String() => t.toValue(), 31 | int() => t.toValue(), 32 | bool() => t.toValue(), 33 | DateTime() => t.toValue(), 34 | _ => throw UnimplementedError(), 35 | }, 36 | ], 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /dev/githubanalysis/lib/debug_http.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | 7 | import 'package:http/http.dart'; 8 | 9 | class DebugHttpClient extends BaseClient { 10 | DebugHttpClient({final Client? client}) : _client = client ?? Client(); 11 | 12 | final Client _client; 13 | 14 | @override 15 | Future send(final BaseRequest request) async { 16 | final response = await _client.send(request); 17 | final bytes = await response.stream.toBytes(); 18 | print(request.url); 19 | print(utf8.decode(bytes)); 20 | return StreamedResponse( 21 | Stream>.value(bytes), 22 | response.statusCode, 23 | contentLength: response.contentLength, 24 | request: response.request, 25 | headers: response.headers, 26 | isRedirect: response.isRedirect, 27 | persistentConnection: response.persistentConnection, 28 | reasonPhrase: response.reasonPhrase, 29 | ); 30 | } 31 | 32 | @override 33 | void close() { 34 | _client.close(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cipd_packages/ruby/third_party/ruby_ship/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Stephan Nordnes Eriksen 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /.github/workflows/dashboard_tests.yaml: -------------------------------------------------------------------------------- 1 | name: Test dashboard 2 | 3 | on: 4 | pull_request: 5 | branches: [main] 6 | paths: 7 | - "dashboard/**" 8 | - "packages/cocoon_common/**" 9 | - ".github/workflows/dashboard_tests.yaml" 10 | push: 11 | branches: [main] 12 | 13 | jobs: 14 | test-dashboard: 15 | runs-on: ubuntu-latest 16 | defaults: 17 | run: 18 | working-directory: dashboard 19 | 20 | steps: 21 | - name: Set up Flutter 22 | uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e 23 | with: 24 | channel: stable 25 | architecture: x64 # only needed for running locally (mac) 26 | 27 | - name: Checkout code 28 | uses: actions/checkout@v6 29 | 30 | - name: Get packages 31 | run: | 32 | flutter packages get 33 | 34 | - name: Flutter Analyze 35 | run: | 36 | flutter analyze --no-fatal-infos 37 | 38 | - name: Dart Format 39 | run: | 40 | dart format --set-exit-if-changed . 41 | 42 | - name: Flutter Test 43 | run: | 44 | flutter test --test-randomize-ordering-seed=random --reporter expanded 45 | -------------------------------------------------------------------------------- /app_dart/lib/src/model/proto/internal/github_webhook.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: internal/github_webhook.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use githubWebhookMessageDescriptor instead') 17 | const GithubWebhookMessage$json = { 18 | '1': 'GithubWebhookMessage', 19 | '2': [ 20 | {'1': 'event', '3': 1, '4': 1, '5': 9, '10': 'event'}, 21 | {'1': 'payload', '3': 2, '4': 1, '5': 9, '10': 'payload'}, 22 | ], 23 | }; 24 | 25 | /// Descriptor for `GithubWebhookMessage`. Decode as a `google.protobuf.DescriptorProto`. 26 | final $typed_data.Uint8List githubWebhookMessageDescriptor = $convert.base64Decode( 27 | 'ChRHaXRodWJXZWJob29rTWVzc2FnZRIUCgVldmVudBgBIAEoCVIFZXZlbnQSGAoHcGF5bG9hZB' 28 | 'gCIAEoCVIHcGF5bG9hZA=='); 29 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/bin/ios_debug_symbol_doctor.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This is not a part of the main Device Doctor because it depends on Xcode 6 | // being installed and set up in the environment, while the main iOS Device 7 | // Doctor workflow runs before Xcode is provisioned. 8 | 9 | import 'dart:io'; 10 | 11 | import 'package:args/command_runner.dart'; 12 | import 'package:device_doctor/device_doctor.dart'; 13 | import 'package:logging/logging.dart'; 14 | 15 | Future main(List args) async { 16 | // Write logs to stdout 17 | Logger.root.onRecord.listen((LogRecord record) { 18 | stdout.writeln(record.toString()); 19 | }); 20 | 21 | final runner = 22 | CommandRunner( 23 | 'ios-debug-symbol-doctor', 24 | 'Tool for diagnosing and recovering from iOS debug symbols not synched with the host by Xcode', 25 | ) 26 | ..addCommand(DiagnoseCommand()) 27 | ..addCommand(RecoverCommand()); 28 | 29 | final success = await runner.run(args); 30 | exit(success == true ? 0 : 1); 31 | } 32 | -------------------------------------------------------------------------------- /dashboard/lib/widgets/app_bar.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/material.dart'; 6 | 7 | import 'user_sign_in.dart'; 8 | 9 | /// Cocoon-specific variant of the [AppBar] widget. 10 | /// 11 | /// The [actions] will always have a [UserSignIn] added. 12 | class CocoonAppBar extends StatelessWidget implements PreferredSizeWidget { 13 | const CocoonAppBar({ 14 | super.key, 15 | this.title, 16 | this.actions, 17 | this.backgroundColor, 18 | }); 19 | 20 | final Widget? title; 21 | 22 | final List? actions; 23 | 24 | final Color? backgroundColor; 25 | 26 | @override 27 | Size get preferredSize => const Size.fromHeight(kToolbarHeight); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return AppBar( 32 | title: title, 33 | backgroundColor: backgroundColor, 34 | actions: [ 35 | ...?actions, 36 | const Padding( 37 | padding: EdgeInsets.only(right: 8.0), 38 | child: UserSignIn(), 39 | ), 40 | ], 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app_dart/test/src/delegate_matcher.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:meta/meta.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | abstract base class DelegateMatcher extends Matcher { 9 | const DelegateMatcher(this._delegate); 10 | final TypeMatcher _delegate; 11 | 12 | @protected 13 | TypeMatcher having( 14 | Object? Function(T) feature, 15 | String description, 16 | Object? matcher, 17 | ) { 18 | return _delegate.having(feature, description, matcher); 19 | } 20 | 21 | @override 22 | bool matches(Object? item, _) { 23 | if (item is! T) { 24 | return false; 25 | } 26 | 27 | return _delegate.matches(item, {}); 28 | } 29 | 30 | @override 31 | Description describe(Description description) { 32 | return _delegate.describe(description); 33 | } 34 | 35 | @override 36 | Description describeMismatch( 37 | Object? item, 38 | Description mismatchDescription, 39 | _, 40 | _, 41 | ) { 42 | return _delegate.describeMismatch(item, mismatchDescription, {}, false); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app_dart/bin/validate_scheduler_config.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | import 'package:cocoon_service/protos.dart' as pb; 8 | import 'package:cocoon_service/src/model/ci_yaml/ci_yaml.dart'; 9 | import 'package:cocoon_service/src/service/config.dart'; 10 | import 'package:yaml/yaml.dart'; 11 | 12 | void main(List args) async { 13 | if (args.length != 1) { 14 | print('validate_scheduler_config.dart configPath'); 15 | exit(1); 16 | } 17 | final configPath = args.first; 18 | final configFile = File(configPath); 19 | if (!configFile.existsSync()) { 20 | print('validate_scheduler_config.dart configPath'); 21 | exit(1); 22 | } 23 | 24 | final configYaml = loadYaml(configFile.readAsStringSync()) as YamlMap; 25 | final unCheckedSchedulerConfig = pb.SchedulerConfig() 26 | ..mergeFromProto3Json(configYaml); 27 | print( 28 | CiYaml( 29 | type: CiType.any, 30 | slug: Config.flutterSlug, 31 | branch: Config.defaultBranch(Config.flutterSlug), 32 | config: unCheckedSchedulerConfig, 33 | ).config, 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /auto_submit/lib/requests/github_pull_request_event.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:github/github.dart'; 6 | import 'package:json_annotation/json_annotation.dart'; 7 | 8 | part 'github_pull_request_event.g.dart'; 9 | 10 | /// PullRequestMessage is a wrapper that keeps the sender and action of the event 11 | /// sent to the webhook. 12 | @JsonSerializable() 13 | class GithubPullRequestEvent { 14 | const GithubPullRequestEvent({this.pullRequest, this.action, this.sender}); 15 | 16 | /// The [PullRequest] object information. 17 | @JsonKey(name: 'pull_request') 18 | final PullRequest? pullRequest; 19 | 20 | /// The action as used by github for a [PullRequest] event. 21 | final String? action; 22 | 23 | /// The author login of the person who initiated the event, currently only 24 | /// useful when processing revert requests. 25 | final User? sender; 26 | 27 | factory GithubPullRequestEvent.fromJson(Map json) => 28 | _$GithubPullRequestEventFromJson(json); 29 | 30 | Map toJson() => _$GithubPullRequestEventToJson(this); 31 | } 32 | -------------------------------------------------------------------------------- /auto_submit/test/validations/base_commit_date_allowed_test_data.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | String constructCommit({required DateTime date}) { 6 | return ''' 7 | { 8 | "sha": "abcd", 9 | "node_id": "C_id", 10 | "commit": { 11 | "author": { 12 | "name": "Test Author", 13 | "email": "test@gmail.com", 14 | "date": "${date.toIso8601String()}" 15 | } 16 | }, 17 | "url": "https://api.github.com/repos/flutter/flutter/commits/abcd", 18 | "html_url": "https://github.com/flutter/flutter/commit/abcd", 19 | "comments_url": "https://api.github.com/repos/flutter/flutter/commits/abcd/comments", 20 | "files": [] 21 | } 22 | '''; 23 | } 24 | 25 | String constructEmptyCommit() { 26 | return ''' 27 | { 28 | "sha": "abcd", 29 | "node_id": "C_id", 30 | "url": "https://api.github.com/repos/flutter/flutter/commits/abcd", 31 | "html_url": "https://github.com/flutter/flutter/commit/abcd", 32 | "comments_url": "https://api.github.com/repos/flutter/flutter/commits/abcd/comments", 33 | "files": [] 34 | } 35 | '''; 36 | } 37 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/build.bat: -------------------------------------------------------------------------------- 1 | :: Copyright 2020 The Flutter Authors. All rights reserved. 2 | :: Use of this source code is governed by a BSD-style license that can be 3 | :: found in the LICENSE file. 4 | 5 | REM Checks if cipd command is available. 6 | FOR /F "tokens=*" %%g IN ('where cipd') do (SET CIPD=%%g) 7 | IF %ERRORLEVEL% NEQ 0 ( 8 | ECHO "Please install CIPD (available from depot_tools) and add to path first."; 9 | EXIT 10 | ) 11 | 12 | REM `path` is \path\to\device_doctor\tool\ 13 | REM `DIR` is \path\to\device_doctor\tool 14 | SET path=%~dp0 15 | SET DIR=%path:~0,-1% 16 | %CIPD% ensure --ensure-file %path%\ensure_file_windows -root %DIR% 17 | 18 | REM `BUILD_DIR` is \path\to\device_doctor 19 | for %%a in (%DIR:~0,-1%) do set "BUILD_DIR=%%~dpa" 20 | PUSHD %BUILD_DIR% 21 | if exist %BUILD_DIR%\build ( 22 | ECHO "Please remove the build directory before proceeding" 23 | EXIT 1 24 | ) 25 | MKDIR %BUILD_DIR%\build 26 | 27 | call tool\bin\dart.exe pub get 28 | call tool\bin\dart.exe compile exe bin\main.dart -o build\device_doctor.exe 29 | IF "%ERRORLEVEL%" NEQ "0" ( 30 | EXIT 1 31 | ) 32 | 33 | REM Add PATH for xcopy 34 | SET "PATH=%PATH%;C:\Windows\system32" 35 | xcopy LICENSE %BUILD_DIR%\build\. 36 | -------------------------------------------------------------------------------- /app_dart/test/model/firestore/github_gold_status_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_server_test/test_logging.dart'; 6 | import 'package:cocoon_service/src/model/firestore/github_gold_status.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | import '../../src/service/fake_firestore_service.dart'; 10 | import '../../src/utilities/entity_generators.dart'; 11 | 12 | void main() { 13 | useTestLoggerPerTest(); 14 | 15 | late FakeFirestoreService firestoreService; 16 | 17 | setUp(() { 18 | firestoreService = FakeFirestoreService(); 19 | }); 20 | 21 | test('generates githubGoldStatus correctly', () async { 22 | final githubGoldStatus = generateFirestoreGithubGoldStatus(1); 23 | firestoreService.putDocument(githubGoldStatus); 24 | 25 | final resultedGithubGoldStatus = await GithubGoldStatus.fromFirestore( 26 | firestoreService: firestoreService, 27 | documentName: githubGoldStatus.name!, 28 | ); 29 | expect(resultedGithubGoldStatus.name, githubGoldStatus.name); 30 | expect(resultedGithubGoldStatus.fields, githubGoldStatus.fields); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Specify analysis options for all of flutter/cocoon 2 | # 3 | # For a list of lints, see: http://dart-lang.github.io/linter/lints/. 4 | # For guidelines on configuring static analysis, see: https://dart.dev/tools/analysis. 5 | # 6 | # https://github.com/dart-lang/ecosystem/blob/main/pkgs/dart_flutter_team_lints/lib/analysis_options.yaml 7 | include: package:dart_flutter_team_lints/analysis_options.yaml 8 | 9 | analyzer: 10 | errors: 11 | # TODO(matanlurey): Ignore for now, we have a lot of pre-existing violations. 12 | avoid_dynamic_calls: ignore 13 | comment_references: ignore 14 | deprecated_member_use_from_same_package: ignore 15 | lines_longer_than_80_chars: ignore 16 | only_throw_errors: ignore 17 | exclude: 18 | - ".dart_tool/**" 19 | - "**/*.pb.dart" 20 | - "**/*.pbjson.dart" 21 | - "**/*.pbgrpc.dart" 22 | - "**/*.pbserver.dart" 23 | - "**/*.pbenum.dart" 24 | - "lib/generated_plugin_registrant.dart" 25 | - "test/**/mocks.mocks.dart" 26 | 27 | # Additional rules that do not *conflict* (i.e. are additive) with dart_flutter_team_lints. 28 | linter: 29 | rules: 30 | # - avoid_private_typedef_functions 31 | # - avoid_unused_constructor_parameters 32 | prefer_final_locals: true 33 | -------------------------------------------------------------------------------- /app_dart/lib/src/service/flags/ci_yaml_flags.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:json_annotation/json_annotation.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | part 'ci_yaml_flags.g.dart'; 9 | 10 | /// Flags related to resolving `.ci.yaml`. 11 | @JsonSerializable() 12 | @immutable 13 | final class CiYamlFlags { 14 | /// Default configuration for [CiYamlFlags] flags. 15 | static const defaultInstance = CiYamlFlags._(); 16 | 17 | const CiYamlFlags._(); 18 | 19 | /// Creates [CiYamlFlags] flags from the provided fields. 20 | /// 21 | /// Any omitted fields default to the values in [defaultInstance]. 22 | factory CiYamlFlags() { 23 | return const CiYamlFlags._(); 24 | } 25 | 26 | /// Creates [ContentAwareHashing] flags from a [json] object. 27 | /// 28 | /// Any omitted fields default to the values in [defaultInstance]. 29 | factory CiYamlFlags.fromJson(Map? json) { 30 | return _$CiYamlFlagsFromJson(json ?? {}); 31 | } 32 | 33 | /// The inverse operation of [CiYamlFlags.fromJson]. 34 | Map toJson() => _$CiYamlFlagsToJson(this); 35 | } 36 | -------------------------------------------------------------------------------- /app_dart/test/src/service/fake_get_files_changed.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_service/src/service/get_files_changed.dart'; 6 | import 'package:github/src/common/model/repos.dart'; 7 | 8 | /// A fake implementation of [GetFilesChanged] that always returned [cannedFiles]. 9 | final class FakeGetFilesChanged implements GetFilesChanged { 10 | FakeGetFilesChanged({required this.cannedFiles}); 11 | FakeGetFilesChanged.inconclusive() : cannedFiles = null; 12 | 13 | /// Files to return on [get]. 14 | /// 15 | /// If this is `null`, returns [InconclusiveFilesChanged]. 16 | List? cannedFiles; 17 | 18 | @override 19 | Future get(RepositorySlug slug, int pullRequestNumber) async { 20 | if (cannedFiles case final cannedFiles?) { 21 | return SuccessfulFilesChanged( 22 | pullRequestNumber: pullRequestNumber, 23 | filesChanged: cannedFiles, 24 | ); 25 | } 26 | return InconclusiveFilesChanged( 27 | pullRequestNumber: pullRequestNumber, 28 | reason: 'No files were provided to FakeGetFilesChanged', 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app_dart/test/model/firestore/github_build_status_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_server_test/test_logging.dart'; 6 | import 'package:cocoon_service/src/model/firestore/github_build_status.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | import '../../src/service/fake_firestore_service.dart'; 10 | import '../../src/utilities/entity_generators.dart'; 11 | 12 | void main() { 13 | useTestLoggerPerTest(); 14 | 15 | late FakeFirestoreService firestoreService; 16 | 17 | setUp(() { 18 | firestoreService = FakeFirestoreService(); 19 | }); 20 | 21 | test('generates githubBuildStatus correctly', () async { 22 | final githubBuildStatus = generateFirestoreGithubBuildStatus(1); 23 | firestoreService.putDocument(githubBuildStatus); 24 | 25 | final resultedGithubBuildStatus = await GithubBuildStatus.fromFirestore( 26 | firestoreService: firestoreService, 27 | documentName: githubBuildStatus.name!, 28 | ); 29 | expect(resultedGithubBuildStatus.name, githubBuildStatus.name); 30 | expect(resultedGithubBuildStatus.fields, githubBuildStatus.fields); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /app_dart/test/src/model/_pr_check_run.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | part of 'firestore_matcher.dart'; 6 | 7 | final class PrCheckRunsMatcher extends ModelMatcher { 8 | const PrCheckRunsMatcher._(super._delegate) : super._(); 9 | 10 | @override 11 | AppDocumentMetadata get metadata => PrCheckRuns.metadata; 12 | 13 | PrCheckRunsMatcher hasPullRequest(Object? valueOrMatcher) { 14 | return PrCheckRunsMatcher._( 15 | _delegate.having((c) => c.pullRequest, 'pullRequest', valueOrMatcher), 16 | ); 17 | } 18 | 19 | PrCheckRunsMatcher hasSha(Object? valueOrMatcher) { 20 | return PrCheckRunsMatcher._( 21 | _delegate.having((c) => c.sha, 'sha', valueOrMatcher), 22 | ); 23 | } 24 | 25 | PrCheckRunsMatcher hasSlug(Object? valueOrMatcher) { 26 | return PrCheckRunsMatcher._( 27 | _delegate.having((c) => c.slug, 'slug', valueOrMatcher), 28 | ); 29 | } 30 | 31 | PrCheckRunsMatcher hasCheckRuns(Object? valueOrMatcher) { 32 | return PrCheckRunsMatcher._( 33 | _delegate.having((c) => c.checkRuns, 'checkRuns', valueOrMatcher), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /dashboard/test/utils/fake_url_launcher.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:url_launcher_platform_interface/link.dart'; 6 | import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; 7 | 8 | class FakeUrlLauncher extends UrlLauncherPlatform { 9 | final List launches = []; 10 | 11 | @override 12 | Future canLaunch(String url) { 13 | throw UnimplementedError('canLaunch() has not been implemented.'); 14 | } 15 | 16 | @override 17 | LinkDelegate? get linkDelegate => null; 18 | 19 | @override 20 | Future launch( 21 | String url, { 22 | required bool useSafariVC, 23 | required bool useWebView, 24 | required bool enableJavaScript, 25 | required bool enableDomStorage, 26 | required bool universalLinksOnly, 27 | required Map headers, 28 | String? webOnlyWindowName, 29 | }) { 30 | launches.add(url); 31 | return Future.value(true); 32 | } 33 | 34 | @override 35 | Future closeWebView() { 36 | throw UnimplementedError('closeWebView() has not been implemented.'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app_dart/test/src/model/_build_status_snapshot.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | part of 'firestore_matcher.dart'; 6 | 7 | final class BuildStatusSnapshotMatcher 8 | extends ModelMatcher { 9 | const BuildStatusSnapshotMatcher._(super._delegate) : super._(); 10 | 11 | @override 12 | AppDocumentMetadata get metadata { 13 | return BuildStatusSnapshot.metadata; 14 | } 15 | 16 | BuildStatusSnapshotMatcher hasStatus(Object? matcherOr) { 17 | return BuildStatusSnapshotMatcher._( 18 | _delegate.having((status) => status.status, 'status', matcherOr), 19 | ); 20 | } 21 | 22 | BuildStatusSnapshotMatcher hasCreatedOn(Object? matcherOr) { 23 | return BuildStatusSnapshotMatcher._( 24 | _delegate.having((status) => status.createdOn, 'createdOn', matcherOr), 25 | ); 26 | } 27 | 28 | BuildStatusSnapshotMatcher hasFailingTasks(Object? matcherOr) { 29 | return BuildStatusSnapshotMatcher._( 30 | _delegate.having( 31 | (status) => status.failingTasks, 32 | 'failingTasks', 33 | matcherOr, 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/cocoon_server/lib/big_query_pull_request_record.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | 7 | import 'package:json_annotation/json_annotation.dart'; 8 | import 'package:meta/meta.dart'; 9 | 10 | part 'big_query_pull_request_record.g.dart'; 11 | 12 | @immutable 13 | @JsonSerializable() 14 | class PullRequestRecord { 15 | const PullRequestRecord({ 16 | this.prCreatedTimestamp, 17 | this.prLandedTimestamp, 18 | this.organization, 19 | this.repository, 20 | this.author, 21 | this.prNumber, 22 | this.prCommit, 23 | this.prRequestType, 24 | }); 25 | 26 | final DateTime? prCreatedTimestamp; 27 | final DateTime? prLandedTimestamp; 28 | final String? organization; 29 | final String? repository; 30 | final String? author; 31 | final int? prNumber; 32 | final String? prCommit; 33 | final String? prRequestType; 34 | 35 | @override 36 | String toString() => jsonEncode(toJson()); 37 | 38 | factory PullRequestRecord.fromJson(Map json) => 39 | _$PullRequestRecordFromJson(json); 40 | 41 | Map toJson() => _$PullRequestRecordToJson(this); 42 | } 43 | -------------------------------------------------------------------------------- /app_dart/test/model/bbv2_extension_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:buildbucket/buildbucket_pb.dart' as bbv2; 6 | import 'package:cocoon_common/task_status.dart'; 7 | import 'package:cocoon_server_test/test_logging.dart'; 8 | import 'package:cocoon_service/src/model/bbv2_extension.dart'; 9 | import 'package:test/test.dart'; 10 | 11 | void main() { 12 | useTestLoggerPerTest(); 13 | 14 | const expectedMapping = { 15 | bbv2.Status.CANCELED: TaskStatus.cancelled, 16 | bbv2.Status.FAILURE: TaskStatus.failed, 17 | bbv2.Status.INFRA_FAILURE: TaskStatus.infraFailure, 18 | bbv2.Status.SCHEDULED: TaskStatus.inProgress, 19 | bbv2.Status.STARTED: TaskStatus.inProgress, 20 | bbv2.Status.SUCCESS: TaskStatus.succeeded, 21 | }; 22 | 23 | for (final MapEntry(key: bbv2, value: expected) in expectedMapping.entries) { 24 | test('$bbv2 -> $expected', () { 25 | expect(bbv2.toTaskStatus(), expected); 26 | }); 27 | } 28 | 29 | test('refuses to convert unknown status', () { 30 | expect( 31 | () => bbv2.Status.STATUS_UNSPECIFIED.toTaskStatus(), 32 | throwsStateError, 33 | ); 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /packages/cocoon_common/lib/src/rpc_model/tree_status_change.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:json_annotation/json_annotation.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | import 'base.dart'; 9 | 10 | part 'tree_status_change.g.dart'; 11 | 12 | @JsonSerializable(checked: true) 13 | @immutable 14 | final class TreeStatusChange extends Model { 15 | TreeStatusChange({ 16 | required this.createdOn, 17 | required this.status, 18 | required this.authoredBy, 19 | required this.reason, 20 | }); 21 | 22 | factory TreeStatusChange.fromJson(Map json) { 23 | return _$TreeStatusChangeFromJson(json); 24 | } 25 | 26 | @JsonKey(name: 'createdOn') 27 | final DateTime createdOn; 28 | 29 | @JsonKey(name: 'status') 30 | final TreeStatus status; 31 | 32 | @JsonKey(name: 'author') 33 | final String authoredBy; 34 | 35 | @JsonKey(name: 'reason') 36 | final String? reason; 37 | 38 | @override 39 | Map toJson() { 40 | return _$TreeStatusChangeToJson(this); 41 | } 42 | } 43 | 44 | /// Whether the [TreeStatusChange] was a success or failure. 45 | enum TreeStatus { success, failure } 46 | -------------------------------------------------------------------------------- /cipd_packages/device_doctor/tool/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Flutter Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Fetches corresponding dart sdk from CIPD for different platforms, builds 7 | # an executable binary of device_doctor to `build` folder. 8 | # 9 | # This currently supports linux and mac. 10 | 11 | set -e 12 | 13 | command -v cipd > /dev/null || { 14 | echo "Please install CIPD (available from depot_tools) and add to path first."; 15 | exit -1; 16 | } 17 | 18 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)" 19 | OS="`uname`" 20 | 21 | echo ########### Ensure file ########### 22 | cat $DIR/ensure_file 23 | echo ################################### 24 | 25 | 26 | cipd ensure -ensure-file $DIR/ensure_file -root $DIR 27 | 28 | pushd $DIR/.. 29 | 30 | if [[ -d "build" ]]; then 31 | echo "Please remove the build directory before proceeding" 32 | exit -1 33 | fi 34 | 35 | mkdir -p build 36 | pwd 37 | ls tool 38 | tool/bin/dart pub get 39 | tool/bin/dart compile exe bin/main.dart -o build/device_doctor 40 | 41 | cp -f LICENSE build/ 42 | 43 | if [[ $OS == "Darwin" ]]; then 44 | mkdir -p build/tool 45 | cp -rf tool/infra-dialog build/tool/ 46 | fi 47 | 48 | popd 49 | -------------------------------------------------------------------------------- /dashboard/test/widgets/commit_author_avatar_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_dashboard/widgets/commit_author_avatar.dart'; 7 | import 'package:flutter_test/flutter_test.dart'; 8 | 9 | import '../utils/generate_commit_for_tests.dart'; 10 | 11 | void main() { 12 | testWidgets('Authors with same initial have differently coloured avatars', ( 13 | WidgetTester tester, 14 | ) async { 15 | final commit1 = generateCommitForTest(author: 'Mike'); 16 | final commit2 = generateCommitForTest(author: 'Michael'); 17 | 18 | await tester.pumpWidget( 19 | MaterialApp( 20 | home: Column( 21 | children: [ 22 | CommitAuthorAvatar(commit: commit1), 23 | CommitAuthorAvatar(commit: commit2), 24 | ], 25 | ), 26 | ), 27 | ); 28 | 29 | expect(find.text('M'), findsNWidgets(2)); 30 | final avatars = tester 31 | .widgetList(find.byType(CircleAvatar)) 32 | .toList(); 33 | expect(avatars, hasLength(2)); 34 | expect(avatars.first.backgroundColor, isNot(avatars.last.backgroundColor)); 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /packages/cocoon_server/lib/generate_github_jws.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:jose_plus/jose.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | /// Generates a Json Web Signature token to prove to GitHub we are [githubAppId]. 9 | String generateGitHubJws({ 10 | required String privateKeyPem, 11 | required String githubAppId, 12 | @visibleForTesting DateTime? now, 13 | }) { 14 | // Load the signing key 15 | final signingKey = JsonWebKey.fromPem(privateKeyPem); 16 | 17 | // Calculate times used for claims. 18 | now ??= DateTime.now(); 19 | final iat = 20 | now.millisecondsSinceEpoch ~/ 21 | 1000; // Issued at time (seconds since epoch) 22 | final exp = 23 | now.add(const Duration(minutes: 10)).millisecondsSinceEpoch ~/ 24 | 1000; // Expiration time (seconds since epoch) 25 | 26 | // Get the builder and add claims 27 | final builder = JsonWebSignatureBuilder(); 28 | builder.jsonContent = JsonWebTokenClaims.fromJson({ 29 | 'iss': githubAppId, 30 | 'iat': iat, 31 | 'exp': exp, 32 | }); 33 | 34 | // Sign it 35 | builder.addRecipient(signingKey); 36 | return builder.build().toCompactSerialization(); 37 | } 38 | -------------------------------------------------------------------------------- /app_dart/app.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | runtime: custom 6 | env: flex 7 | service: default 8 | 9 | readiness_check: 10 | path: "/readiness_check" 11 | check_interval_sec: 20 12 | timeout_sec: 20 13 | failure_threshold: 10 14 | success_threshold: 2 15 | app_start_timeout_sec: 600 16 | 17 | resources: 18 | memory_gb: 4.0 19 | 20 | handlers: 21 | # The Dart server handles all requests. However, this is used to ensure the 22 | # assets the dart server needs are uploaded to AppEngine. 23 | - url: /v2/(.*\.(html|css|js|ico|svg|png|jpg|map))$ 24 | application_readable: true # So the dart server can read the files 25 | # If the Dart custom runtime changes and starts using this handler, 26 | # we want to know. This will have the app only serve HTML and we 27 | # will know we can remove the Dart handling code. Just swap 28 | # index.html to \1 29 | static_files: build/web/index.html 30 | # app_flutter's build files needed to be copied over to this project. This 31 | # is because the Google Cloud utility cannot go outside the scope of app_dart. 32 | # Navigating to ../app_flutter/build/web will silently error. 33 | upload: build/web/.*\.(html|css|js|ico|svg|png|jpg|map)$ 34 | -------------------------------------------------------------------------------- /auto_submit/lib/server/authenticated_request_handler.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:cocoon_server/logging.dart'; 6 | import 'package:meta/meta.dart'; 7 | import 'package:shelf/shelf.dart'; 8 | 9 | import '../request_handling/authentication.dart'; 10 | import '../requests/exceptions.dart'; 11 | import 'request_handler.dart'; 12 | 13 | /// A [RequestHandler] that handles API requests. 14 | /// 15 | /// * All requests must be authenticated per [CronAuthProvider]. 16 | @immutable 17 | abstract class AuthenticatedRequestHandler extends RequestHandler { 18 | /// Creates a new [ApiRequestHandler]. 19 | const AuthenticatedRequestHandler({ 20 | required super.config, 21 | required this.cronAuthProvider, 22 | }); 23 | 24 | /// Service responsible for authenticating this [Request]. 25 | final CronAuthProvider cronAuthProvider; 26 | 27 | @override 28 | Future run(Request request) async { 29 | try { 30 | await cronAuthProvider.authenticate(request); 31 | } on Unauthenticated catch (error) { 32 | log.info('Authenticate error: $error'); 33 | return Response.forbidden(error.toString()); 34 | } 35 | return super.run(request); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /auto_submit/pubspec.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Flutter Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | name: auto_submit 5 | description: GitHub application for managing pull request submission 6 | version: 0.0.1 7 | publish_to: none 8 | homepage: https://github.com/flutter/cocoon/blob/main/autosubmit 9 | 10 | environment: 11 | sdk: ^3.9.0 12 | 13 | dependencies: 14 | appengine: 0.13.11 15 | cocoon_common: 16 | path: ../packages/cocoon_common 17 | cocoon_server: 18 | path: ../packages/cocoon_server 19 | corsac_jwt: 2.0.2 20 | crypto: 3.0.7 21 | github: 9.25.0 22 | googleapis: 14.0.0 23 | googleapis_auth: 2.0.0 24 | gql: 1.0.1 25 | graphql: 5.2.0-beta.10 26 | http: 1.6.0 27 | json_annotation: 4.9.0 28 | logging: 1.2.0 29 | meta: 1.17.0 30 | mutex: 3.1.0 31 | neat_cache: 2.0.5 32 | retry: 3.1.2 33 | shelf: 1.4.2 34 | shelf_router: 1.1.4 35 | yaml: 3.1.2 36 | 37 | dev_dependencies: 38 | build_runner: ^2.4.15 39 | cocoon_common_test: 40 | path: ../packages/cocoon_common_test 41 | cocoon_server_test: 42 | path: ../packages/cocoon_server_test 43 | dart_flutter_team_lints: 3.5.2 44 | json_serializable: ^6.9.4 45 | mockito: ^5.4.6 46 | test: 1.26.3 47 | 48 | builders: 49 | json_serializable: 3.3.0 50 | -------------------------------------------------------------------------------- /auto_submit/lib/revert/revert_discord_message.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import '../model/discord_message.dart'; 6 | 7 | class RevertDiscordMessage extends Message { 8 | static const String _username = 'Revert bot'; 9 | static const int discordMessageLength = 2000; 10 | static const int elipsesOffset = 3; 11 | 12 | RevertDiscordMessage({super.content, super.username, super.avatarUrl}); 13 | 14 | static RevertDiscordMessage generateMessage( 15 | String originalPrUrl, 16 | String originalPrDisplayText, 17 | String revertPrUrl, 18 | String revertPrDisplayText, 19 | String initiatingAuthor, 20 | String reasonForRevert, 21 | ) { 22 | final content = 23 | ''' 24 | Pull Request [$originalPrDisplayText](<$originalPrUrl>) has been reverted by $initiatingAuthor. 25 | Please see the revert PR here: [$revertPrDisplayText](<$revertPrUrl>). 26 | Reason for reverting: $reasonForRevert'''; 27 | 28 | final truncatedContent = content.length <= discordMessageLength 29 | ? content 30 | : '${content.substring(0, discordMessageLength - elipsesOffset)}...'; 31 | 32 | return RevertDiscordMessage(content: truncatedContent, username: _username); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dashboard/lib/widgets/state_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/widgets.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | import '../service/firebase_auth.dart'; 9 | import '../state/build.dart'; 10 | 11 | class StateProvider extends StatelessWidget { 12 | const StateProvider({ 13 | super.key, 14 | this.signInService, 15 | this.buildState, 16 | this.child, 17 | }); 18 | 19 | final FirebaseAuthService? signInService; 20 | 21 | final BuildState? buildState; 22 | 23 | final Widget? child; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return MultiProvider( 28 | providers: >[ 29 | ValueProvider(value: signInService), 30 | ValueProvider(value: buildState), 31 | ], 32 | child: child, 33 | ); 34 | } 35 | } 36 | 37 | /// Similar to Provider.value but doesn't complain when 38 | /// the value is a Listenable. 39 | class ValueProvider extends InheritedProvider { 40 | ValueProvider({ 41 | super.key, 42 | required super.value, 43 | super.updateShouldNotify, 44 | super.child, 45 | }) : super.value(); 46 | } 47 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/rpc/status.pbjson.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/rpc/status.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:convert' as $convert; 13 | import 'dart:core' as $core; 14 | import 'dart:typed_data' as $typed_data; 15 | 16 | @$core.Deprecated('Use statusDescriptor instead') 17 | const Status$json = { 18 | '1': 'Status', 19 | '2': [ 20 | {'1': 'code', '3': 1, '4': 1, '5': 5, '10': 'code'}, 21 | {'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'}, 22 | { 23 | '1': 'details', 24 | '3': 3, 25 | '4': 3, 26 | '5': 11, 27 | '6': '.google.protobuf.Any', 28 | '10': 'details' 29 | }, 30 | ], 31 | }; 32 | 33 | /// Descriptor for `Status`. Decode as a `google.protobuf.DescriptorProto`. 34 | final $typed_data.Uint8List statusDescriptor = $convert.base64Decode( 35 | 'CgZTdGF0dXMSEgoEY29kZRgBIAEoBVIEY29kZRIYCgdtZXNzYWdlGAIgASgJUgdtZXNzYWdlEi' 36 | '4KB2RldGFpbHMYAyADKAsyFC5nb29nbGUucHJvdG9idWYuQW55UgdkZXRhaWxz'); 37 | -------------------------------------------------------------------------------- /app_dart/integration_test/generate_jspb_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | import 'dart:io'; 7 | 8 | import 'package:test/test.dart'; 9 | 10 | import 'common.dart'; 11 | 12 | /// Validates `bin/generate_jspb.dart` which is used in the ci.yaml roller script. 13 | Future main() async { 14 | test('validate cocoon ci.yaml generates jspb', () async { 15 | final generateResult = Process.runSync('dart', [ 16 | 'run', 17 | 'bin/generate_jspb.dart', 18 | 'integration_test/data/mock_ci.yaml', 19 | ]); 20 | if (generateResult.exitCode != 0) { 21 | fail( 22 | 'generate_jspb.dart failed with exit code ${generateResult.exitCode}\n' 23 | 'stderr: ${generateResult.stderr}\n' 24 | 'stdout: ${generateResult.stdout}', 25 | ); 26 | } 27 | 28 | // Update expectations file 29 | final jspbExpectationsFile = File( 30 | 'integration_test/data/cocoon_config.json', 31 | ); 32 | jspbExpectationsFile.writeAsStringSync( 33 | '${const JsonEncoder.withIndent(' ').convert(jsonDecode(generateResult.stdout as String))}\n', 34 | ); 35 | 36 | expectNoDiff(jspbExpectationsFile.path); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /auto_submit/cloudbuild_auto_submit.yaml: -------------------------------------------------------------------------------- 1 | # Provide instructions for google Cloud Build to auto-build flutter 2 | # auto-submit bot to flutter-dashboard project. Auto-build will be triggered 3 | # by daily schedule on `main` branch. This cloudbuild calls an additional 4 | # cloudbuild configuration responsible for deployment. 5 | # 6 | # This job is for generating the docker image with build provenance, 7 | # and the deployment job uses the generated docker image and deploys it to 8 | # App Engine. 9 | 10 | steps: 11 | # Build docker image 12 | - name: 'us-docker.pkg.dev/cloud-builders/ga/v1/docker' 13 | args: ['build', '-t', 'us-docker.pkg.dev/$PROJECT_ID/appengine/auto-submit.version-$SHORT_SHA', '-f', 'Dockerfile.auto_submit', '.'] 14 | 15 | # Trigger the cloud build that deploys the docker image 16 | - name: gcr.io/cloud-builders/gcloud 17 | entrypoint: '/bin/bash' 18 | args: 19 | - '-c' 20 | - |- 21 | gcloud builds submit \ 22 | --config auto_submit/cloudbuild_auto_submit_deploy.yaml \ 23 | --substitutions="SHORT_SHA=$SHORT_SHA" \ 24 | --async 25 | 26 | timeout: 1200s 27 | 28 | images: ['us-docker.pkg.dev/$PROJECT_ID/appengine/auto-submit.version-$SHORT_SHA'] 29 | 30 | # If build provenance is not generated, the docker deployment will fail. 31 | options: 32 | requestedVerifyOption: VERIFIED 33 | -------------------------------------------------------------------------------- /dashboard/test/utils/output.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter_test/flutter_test.dart'; 7 | 8 | typedef AsyncVoidCallback = Future Function(); 9 | 10 | /// Checks that any [debugPrint] output generated by `block` matches 11 | /// the output given by `output`. 12 | /// 13 | /// Calls to [debugPrint] inside `block` will not generate output to the 14 | /// console, but if it doesn't match `output` then it will be presented 15 | /// as part of the error message as the "actual" result. 16 | /// 17 | /// Output to [debugPrint] that contains newlines is split into separate 18 | /// entries when comparing to `output`. 19 | /// 20 | /// This method must be `await`ed. 21 | Future checkOutput({ 22 | required AsyncVoidCallback block, 23 | List output = const [], 24 | }) => TestAsyncUtils.guard(() async { 25 | final originalDebugPrint = debugPrint; 26 | final log = []; 27 | debugPrint = (String? message, {int? wrapWidth}) { 28 | log.addAll(message!.split('\n')); 29 | }; 30 | try { 31 | await block(); 32 | } finally { 33 | debugPrint = originalDebugPrint; 34 | } 35 | expect(log, output); 36 | }); 37 | -------------------------------------------------------------------------------- /auto_submit/test/request_handling/authentication_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:auto_submit/request_handling/authentication.dart'; 6 | import 'package:auto_submit/requests/exceptions.dart'; 7 | import 'package:cocoon_server_test/test_logging.dart'; 8 | import 'package:shelf/shelf.dart'; 9 | import 'package:test/test.dart'; 10 | 11 | void main() { 12 | useTestLoggerPerTest(); 13 | 14 | group('CronAuthProvider', () { 15 | late Request request; 16 | late CronAuthProvider auth; 17 | 18 | setUp(() { 19 | auth = const CronAuthProvider(); 20 | }); 21 | 22 | test('throws Unauthenticated with no auth headers', () async { 23 | request = Request('POST', Uri.parse('http://localhost/')); 24 | expect(auth.authenticate(request), throwsA(isA())); 25 | }); 26 | 27 | test('succeeds for App Engine cronjobs', () async { 28 | final header = {'X-Appengine-Cron': 'true'}; 29 | request = Request( 30 | 'POST', 31 | Uri.parse('http://localhost/'), 32 | headers: header, 33 | ); 34 | final result = await auth.authenticate(request); 35 | expect(result, true); 36 | }); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /app_dart/test/src/request_handling/request_handler_tester.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import 'package:cocoon_service/src/request_handling/request_handler.dart'; 8 | import 'package:cocoon_service/src/request_handling/response.dart'; 9 | import 'package:meta/meta.dart'; 10 | 11 | import 'fake_http.dart'; 12 | 13 | class RequestHandlerTester { 14 | RequestHandlerTester({FakeHttpRequest? request}) 15 | : request = request ?? FakeHttpRequest(); 16 | 17 | FakeHttpRequest request; 18 | 19 | /// Executes [RequestHandler.get] on the specified [handler]. 20 | Future get(RequestHandler handler) { 21 | return run(() { 22 | // ignore: invalid_use_of_protected_member 23 | return handler.get(Request.fromHttpRequest(request)); 24 | }); 25 | } 26 | 27 | /// Executes [RequestHandler.post] on the specified [handler]. 28 | Future post(RequestHandler handler) { 29 | return run(() { 30 | // ignore: invalid_use_of_protected_member 31 | return handler.post(Request.fromHttpRequest(request)); 32 | }); 33 | } 34 | 35 | @protected 36 | Future run(Future Function() callback) { 37 | return callback(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/buildbucket-dart/lib/src/generated/google/protobuf/struct.pbenum.dart: -------------------------------------------------------------------------------- 1 | // 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/struct.proto 4 | // 5 | // @dart = 2.12 6 | 7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references 8 | // ignore_for_file: constant_identifier_names, library_prefixes 9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields 10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import 11 | 12 | import 'dart:core' as $core; 13 | 14 | import 'package:protobuf/protobuf.dart' as $pb; 15 | 16 | /// `NullValue` is a singleton enumeration to represent the null value for the 17 | /// `Value` type union. 18 | /// 19 | /// The JSON representation for `NullValue` is JSON `null`. 20 | class NullValue extends $pb.ProtobufEnum { 21 | static const NullValue NULL_VALUE = 22 | NullValue._(0, _omitEnumNames ? '' : 'NULL_VALUE'); 23 | 24 | static const $core.List values = [ 25 | NULL_VALUE, 26 | ]; 27 | 28 | static final $core.Map<$core.int, NullValue> _byValue = 29 | $pb.ProtobufEnum.initByValue(values); 30 | static NullValue? valueOf($core.int value) => _byValue[value]; 31 | 32 | const NullValue._($core.int v, $core.String n) : super(v, n); 33 | } 34 | 35 | const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); 36 | --------------------------------------------------------------------------------