commit | 69bb2a99bcde12f85307fd8873f2e95e97076859 | [log] [tgz] |
---|---|---|
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | Wed Nov 01 01:07:58 2023 +0000 |
committer | GitHub <noreply@github.com> | Wed Nov 01 01:07:58 2023 +0000 |
tree | 8f224010a654e7b727ddda9d4f88adb729359242 | |
parent | 6fd279b01a5ebb9c46fbf0398e51163bba31bfea [diff] |
Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#176) â ï¸ **Dependabot is rebasing this PR** â ï¸ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.1 to 1.6.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/releases">dart-lang/setup-dart's releases</a>.</em></p> <blockquote> <h2>v1.6.0</h2> <ul> <li>Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. <code>3.2</code>).</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md">dart-lang/setup-dart's changelog</a>.</em></p> <blockquote> <h2>v1.6.0</h2> <ul> <li>Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. <code>3.2</code>).</li> </ul> <h2>v1.5.1</h2> <ul> <li>No longer test the <code>setup-dart</code> action on pre-2.12 SDKs.</li> <li>Upgrade JS interop code to use extension types (the new name for inline classes).</li> <li>The upcoming rename of the <code>be</code> channel to <code>main</code> is now supported with forward compatibility that switches when the rename happens.</li> </ul> <h2>v1.5.0</h2> <ul> <li>Re-wrote the implementation of the action into Dart.</li> <li>Auto-detect the platform architecture (<code>x64</code>, <code>ia32</code>, <code>arm</code>, <code>arm64</code>).</li> <li>Improved the caching and download resilience of the sdk.</li> <li>Added a new action output: <code>dart-version</code> - the installed version of the sdk.</li> </ul> <h2>v1.4.0</h2> <ul> <li>Automatically create OIDC token for pub.dev.</li> <li>Add a reusable workflow for publishing.</li> </ul> <h2>v1.3.0</h2> <ul> <li>The install location of the Dart SDK is now available in an environment variable, <code>DART_HOME</code> (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/43">#43</a>).</li> <li>Fixed an issue where cached downloads could lead to unzip issues on self-hosted runners (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/35">#35</a>).</li> </ul> <h2>v1.2.0</h2> <ul> <li>Fixed a path issue impacting git dependencies on Windows.</li> </ul> <h2>v1.1.0</h2> <ul> <li>Added a <code>flavor</code> option setup.sh to allow downloading unpublished builds.</li> </ul> <h2>v1.0.0</h2> <ul> <li>Promoted to 1.0 stable.</li> </ul> <h2>v0.5</h2> <ul> <li>Fixed a Windows <code>pub global activate</code> path issue.</li> </ul> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/dart-lang/setup-dart/commit/b64355ae6ca0b5d484f0106a033dd1388965d06d"><code>b64355a</code></a> debugging issues around specifying the latest patch release (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/108">#108</a>)</li> <li><a href="https://github.com/dart-lang/setup-dart/commit/cd21d0e7475915575e022d2cacd7c54e5026e159"><code>cd21d0e</code></a> Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/110">#110</a>)</li> <li><a href="https://github.com/dart-lang/setup-dart/commit/2118353f672662accb7785f6afd28ab61c7cfec9"><code>2118353</code></a> Bump actions/checkout from 3 to 4 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/109">#109</a>)</li> <li><a href="https://github.com/dart-lang/setup-dart/commit/8ef13bcca6c9bb2219391088bc9d968125f68406"><code>8ef13bc</code></a> support sdk version wildcard format (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/106">#106</a>)</li> <li>See full diff in <a href="https://github.com/dart-lang/setup-dart/compare/8a4b97ea2017cc079571daec46542f76189836b1...b64355ae6ca0b5d484f0106a033dd1388965d06d">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.1&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
The gcloud
package provides a high level idiomatic Dart interface to some of the most widely used Google Cloud Platform services.
Currently the following services are supported:
NOTE: This package is currently experimental and published under the labs.dart.dev pub publisher in order to solicit feedback.
For packages in the labs.dart.dev publisher we generally plan to either graduate the package into a supported publisher (dart.dev, tools.dart.dev) after a period of feedback and iteration, or discontinue the package. These packages have a much higher expected rate of API and breaking changes.
Your feedback is valuable and will help us evolve this package. For general feedback, suggestions, and comments, please file an issue in the bug tracker.
The APIs in this package are all based on the generic generated APIs in the googleapis and googleapis_beta packages.
This means that the authentication model for using the APIs in this package uses the googleapis_auth package.
Note that this package is only intended for being used with the standalone VM in a server or command line application. Don't expect this package to work on the browser or in Flutter.
The code snippets below demonstrating the use of this package all assume that the following imports are present:
import 'dart:io'; import 'package:googleapis_auth/auth_io.dart' as auth; import 'package:http/http.dart' as http; import 'package:gcloud/db.dart'; import 'package:gcloud/storage.dart'; import 'package:gcloud/pubsub.dart'; import 'package:gcloud/service_scope.dart' as ss; import 'package:gcloud/datastore.dart' as datastore;
The first step in using the APIs is to get an authenticated HTTP client and with that create API class instances for accessing the different APIs. The code below assumes that you have a Google Cloud Project called my-project
with credentials for a service account from that project stored in the file my-project.json
.
// Read the service account credentials from the file. var jsonCredentials = new File('my-project.json').readAsStringSync(); var credentials = new auth.ServiceAccountCredentials.fromJson(jsonCredentials); // Get an HTTP authenticated client using the service account credentials. var scopes = [] ..addAll(datastore.Datastore.Scopes) ..addAll(Storage.SCOPES) ..addAll(PubSub.SCOPES); var client = await auth.clientViaServiceAccount(credentials, scopes); // Instantiate objects to access Cloud Datastore, Cloud Storage // and Cloud Pub/Sub APIs. var db = new DatastoreDB( new datastore.Datastore(client, 's~my-project')); var storage = new Storage(client, 'my-project'); var pubsub = new PubSub(client, 'my-project');
All the APIs in this package supports the use of ‘service scopes’. Service scopes are described in details below.
ss.fork(() { // register the services in the new service scope. registerDbService(db); registerStorageService(storage); registerPubSubService(pubsub); // Run application using these services. });
The services registered with the service scope can now be reached from within all the code running in the same service scope using the below getters.
dbService. storageService. pubsubService.
This way it is not necessary to pass the service objects around in your code.
The gcloud
package is also integrated in the Dart appengine package. This means the gcloud
services are available both via the appengine context and service scopes. The authentication required to access the Google Cloud Platform services is handled automatically.
This means that getting to the App Engine Datastore can be through either the App Engine context
var db = context.services.db;
or just using the service scope registration.
var db = dbService;
Google Cloud Datastore provide a NoSQL, schemaless database for storing non-relational data. See the product page https://cloud.google.com/datastore/ for more information.
The Cloud Datastore API provides a mapping of Dart objects to entities stored in the Datastore. The following example shows how to annotate a class to make it possible to store instances of it in the Datastore.
@db.Kind() class Person extends db.Model { @db.StringProperty() String name; @db.IntProperty() int age; }
The Kind
annotation tell that instances of this class can be stored. The class must also inherit from Model
. Now to store an object into the Datastore create an instance and use the commit
function.
var person = new Person() ..name = '' ..age = 42; await db.commit(inserts: [person]);
The function query
is used to build a Query
object which can be run to perform the query.
var persons = (await db.query<Person>().run()).toList();
To fetch one or multiple existing entities, use lookup
.
var key = new Person() ..name = 'UniqueName' ..age = 42 ..parentKey = db.emptyKey; var person = (await db.lookup<Person>([key])).single; var people = await db.lookup<Person>([key1, key2]);
NOTE: This package include a lower level API provided through the class Datastore
on top of which the DatastoreDB
API is build. The main reason for this additional API level is to bridge the gap between the different APIs exposed inside App Engine and through the public REST API. We reserve the rights to modify and maybe even remove this additional layer at any time.
Google Cloud Storage provide a highly available object store (aka BLOB store). See the product page https://cloud.google.com/storage/ for more information.
In Cloud Storage the objects (BLOBs) are organized in buckets. Each bucket has a name in a global namespace. The following code creates a new bucket named my-bucket
and writes the content of the file my-file.txt
to the object named my-object
.
var bucket = await storage.createBucket('my-bucket'); new File('my-file.txt').openRead().pipe(bucket.write('my-object'));
The following code will read back the object.
bucket.read('my-object').pipe(new File('my-file-copy.txt').openWrite());
Google Cloud Pub/Sub provides many-to-many, asynchronous messaging. See the product page https://cloud.google.com/pubsub/ for more information.
Cloud Pub/Sub uses two concepts for messaging. Topics are used if you want to send messages and subscriptions are used to subscribe to topics and receive the messages. This decouples the producer of a message from the consumer of a message.
The following code creates a topic and sends a simple test message:
var topic = await pubsub.createTopic('my-topic'); await topic.publishString('Hello, world!')
With the following code a subscription is created on the topic and a message is pulled using the subscription. A received message must be acknowledged when the consumer has processed it.
var subscription = await pubsub.createSubscription('my-subscription', 'my-topic'); var pullEvent = await subscription.pull(); print(pullEvent.message.asString); await pullEvent.acknowledge();
It is also possible to receive messages using push events instead of pulling from the subscription. To do this the subscription should be configured as a push subscription with an HTTP endpoint.
await pubsub.createSubscription( 'my-subscription', 'my-topic', endpoint: Uri.parse('https://server.example.com/push'));
With this subscription all messages will be send to the URL provided in the endpoint
argument. The server needs to acknowledge the reception of the message with a 200 OK
reply.
If you want to run the end-to-end tests, a Google Cloud project is required. When running these tests the following environment variables need to be set:
GCLOUD_E2E_TEST_PROJECT
The value of the environment variable GCLOUD_E2E_TEST_PROJECT
is the name of the Google Cloud project to use. Authentication for testing uses Application Default Credentials locally you can provide GOOGLE_APPLICATION_CREDENTIALS
or use gcloud auth application-default login
.
You will also need to create indexes as follows:
gcloud --project "$GCLOUD_E2E_TEST_PROJECT" datastore indexes create test/index.yaml