commit | ede8d6ce46739838e7487f4c00ba059074b0baea | [log] [tgz] |
---|---|---|
author | Casey Hillers <caseyhillers@gmail.com> | Mon Nov 25 14:33:43 2019 -0800 |
committer | GitHub <noreply@github.com> | Mon Nov 25 14:33:43 2019 -0800 |
tree | 57ea0a1a6f20b7d502f137bb7bcc5f1032837554 | |
parent | e232394a6f79ad36dd3a0edbec7a611e99227e60 [diff] |
Angular Dart state fixes (#546)
Cocoon is a Dart App Engine custom runtime (backend) with a frontend of Flutter apps (build and repository dashboard) and Angular 2 Dart (performance dashboard) apps. Cocoon coordinates and aggregates the results of flutter/flutter builds. It is not designed to help developers build Flutter apps. More importantly, Cocoon is not a Google product.
TODO: Port the Go dev server to work with the Dart AppEngine system. https://github.com/flutter/flutter/issues/45410
Run dart bin/dev_server.dart
with the option go/flutter-dev-server-auth. This will cause the dev server to call the production servers for all API calls. This only works for testing Angular changes. Changes in Go code require building and deploying the whole thing (see next section).
The following command will run tests and build the app, and provide instructions for deploying to Google App Engine.
cd app_dart dart dev/deploy.dart --project {PROJECT} --version {VERSION}
You can test the new version by accessing {VERSION}-dot-flutter-dashboard.appspot.com
in your browser. If the result is satisfactory, the new version can be activated by using the Cloud Console UI: https://pantheon.corp.google.com/appengine/versions?project=flutter-dashboard&serviceId=default
Cocoon creates a checklist for each Flutter commit. A checklist is made of multiple tasks. Tasks are performed by agents. An agent is a computer capable of running a subset of tasks in the checklist. To perform a task an agent reserves it in Cocoon. Cocoon issues tasks according to agents' capabilities. Each task has a list of required capabilities. For example, a task might require that a physical Android device is attached to an agent. It then lists “has-physical-android-phone” capability as required. Multiple agents may share the same capability. Cocoon will distribute tasks amongst agents. That's how Cocoon scales.
Accessible on on the Angular Dart build dashboard
Cocoon browser interface includes a small CLI. To access it open Chrome Dev Tools > Console. Commands are entered directly into the console like this:
cocoon.COMMAND([COMMAND_ARGS...])
The list of available commands is printed to the console when the page is loaded.
The following command creates an agent with ID “bot-with-devices”, and which has two capabilities: “has-android-phone” and “has-iphone”.
cocoon.createAgent(['-a', 'bot-with-devices', '-c', 'has-android-phone', '-c', 'has-iphone'])
Agent ID is passed as option -a
, and agent's capabilities are passed as one or more -c
.
IMPORTANT: This command returns an authentication token. Cocoon does not store the token, so copy it immediately and add it to the agent's configuration file. If the token is lost or compromised, use the “auth-agent” command below to generate a new token.
The following commands generates an authentication token for an agent.
cocoon.authAgent(['-a', 'bot-with-devices'])
IMPORTANT: See the IMPORTANT note in “Creating an agent”. Also note that this command invalidates any previously issued authentication tokens for the given agent. Only one authentication token is valid at any given moment in time. Therefore, if the agent is currently using a previously issued token its API requests will be rejected until it switches to using the newly created token.
Cocoon is driven by commits made to https://github.com/flutter/flutter repo. It periodically syncs new commits. If you need to manually force a refresh, issue the following CLI command:
cocoon.refreshGithubCommits([])