forked from flutter/cocoon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'flutter:main' into main
- Loading branch information
Showing
33 changed files
with
916 additions
and
717 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ dependencies: | |
|
||
dev_dependencies: | ||
mockito: 5.4.4 | ||
test_api: 0.6.1 | ||
test_api: 0.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2019 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:appengine/appengine.dart'; | ||
import 'package:cocoon_service/cocoon_service.dart'; | ||
import 'package:cocoon_service/server.dart'; | ||
import 'package:cocoon_service/src/service/commit_service.dart'; | ||
import 'package:gcloud/db.dart'; | ||
|
||
Future<void> main() async { | ||
await withAppEngineServices(() async { | ||
useLoggingPackageAdaptor(); | ||
|
||
final CacheService cache = CacheService(inMemory: false); | ||
final Config config = Config(dbService, cache); | ||
final AuthenticationProvider authProvider = AuthenticationProvider(config: config); | ||
final AuthenticationProvider swarmingAuthProvider = SwarmingAuthenticationProvider(config: config); | ||
final BuildBucketClient buildBucketClient = BuildBucketClient( | ||
accessTokenService: AccessTokenService.defaultProvider(config), | ||
); | ||
|
||
/// LUCI service class to communicate with buildBucket service. | ||
final LuciBuildService luciBuildService = LuciBuildService( | ||
config: config, | ||
cache: cache, | ||
buildBucketClient: buildBucketClient, | ||
pubsub: const PubSub(), | ||
); | ||
|
||
/// Github checks api service used to provide luci test execution status on the Github UI. | ||
final GithubChecksService githubChecksService = GithubChecksService( | ||
config, | ||
); | ||
|
||
// Gerrit service class to communicate with GoB. | ||
final GerritService gerritService = GerritService(config: config); | ||
|
||
/// Cocoon scheduler service to manage validating commits in presubmit and postsubmit. | ||
final Scheduler scheduler = Scheduler( | ||
cache: cache, | ||
config: config, | ||
githubChecksService: githubChecksService, | ||
luciBuildService: luciBuildService, | ||
); | ||
|
||
final BranchService branchService = BranchService( | ||
config: config, | ||
gerritService: gerritService, | ||
); | ||
|
||
final CommitService commitService = CommitService(config: config); | ||
|
||
final Server server = createServer( | ||
config: config, | ||
cache: cache, | ||
authProvider: authProvider, | ||
branchService: branchService, | ||
buildBucketClient: buildBucketClient, | ||
gerritService: gerritService, | ||
scheduler: scheduler, | ||
luciBuildService: luciBuildService, | ||
githubChecksService: githubChecksService, | ||
commitService: commitService, | ||
swarmingAuthProvider: swarmingAuthProvider, | ||
); | ||
|
||
return runAppEngine( | ||
server, | ||
onAcceptingConnections: (InternetAddress address, int port) { | ||
final String host = address.isLoopback ? 'localhost' : address.host; | ||
print('Serving requests at http://$host:$port/'); | ||
}, | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright 2019 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:appengine/appengine.dart'; | ||
import 'package:cocoon_service/cocoon_service.dart'; | ||
import 'package:cocoon_service/server.dart'; | ||
import 'package:cocoon_service/src/model/appengine/cocoon_config.dart'; | ||
import 'package:cocoon_service/src/service/commit_service.dart'; | ||
import 'package:cocoon_service/src/service/datastore.dart'; | ||
import 'package:gcloud/db.dart'; | ||
|
||
import '../test/src/datastore/fake_datastore.dart'; | ||
|
||
Future<void> main() async { | ||
final CacheService cache = CacheService(inMemory: false); | ||
final DatastoreDB dbService = FakeDatastoreDB(); | ||
final DatastoreService datastoreService = DatastoreService(dbService, defaultMaxEntityGroups); | ||
await datastoreService.insert(<CocoonConfig>[ | ||
CocoonConfig.fake(dbService.emptyKey.append(CocoonConfig, id: 'WebhookKey'), 'fake-secret'), | ||
CocoonConfig.fake(dbService.emptyKey.append(CocoonConfig, id: 'FrobWebhookKey'), 'fake-secret'), | ||
]); | ||
final Config config = Config(dbService, cache); | ||
final AuthenticationProvider authProvider = AuthenticationProvider(config: config); | ||
final AuthenticationProvider swarmingAuthProvider = SwarmingAuthenticationProvider(config: config); | ||
final BuildBucketClient buildBucketClient = BuildBucketClient( | ||
accessTokenService: AccessTokenService.defaultProvider(config), | ||
); | ||
|
||
/// LUCI service class to communicate with buildBucket service. | ||
final LuciBuildService luciBuildService = LuciBuildService( | ||
config: config, | ||
cache: cache, | ||
buildBucketClient: buildBucketClient, | ||
pubsub: const PubSub(), | ||
); | ||
|
||
/// Github checks api service used to provide luci test execution status on the Github UI. | ||
final GithubChecksService githubChecksService = GithubChecksService( | ||
config, | ||
); | ||
|
||
// Gerrit service class to communicate with GoB. | ||
final GerritService gerritService = GerritService(config: config); | ||
|
||
/// Cocoon scheduler service to manage validating commits in presubmit and postsubmit. | ||
final Scheduler scheduler = Scheduler( | ||
cache: cache, | ||
config: config, | ||
githubChecksService: githubChecksService, | ||
luciBuildService: luciBuildService, | ||
); | ||
|
||
final BranchService branchService = BranchService( | ||
config: config, | ||
gerritService: gerritService, | ||
); | ||
|
||
final CommitService commitService = CommitService(config: config); | ||
|
||
final Server server = createServer( | ||
config: config, | ||
cache: cache, | ||
authProvider: authProvider, | ||
branchService: branchService, | ||
buildBucketClient: buildBucketClient, | ||
gerritService: gerritService, | ||
scheduler: scheduler, | ||
luciBuildService: luciBuildService, | ||
githubChecksService: githubChecksService, | ||
commitService: commitService, | ||
swarmingAuthProvider: swarmingAuthProvider, | ||
); | ||
|
||
return runAppEngine( | ||
server, | ||
onAcceptingConnections: (InternetAddress address, int port) { | ||
final String host = address.isLoopback ? 'localhost' : address.host; | ||
print('Serving requests at http://$host:$port/'); | ||
}, | ||
); | ||
} |
Oops, something went wrong.