diff --git a/.github/workflows/current_results_ui.yaml b/.github/workflows/current_results_ui.yaml new file mode 100644 index 0000000..7dd0b0e --- /dev/null +++ b/.github/workflows/current_results_ui.yaml @@ -0,0 +1,52 @@ +name: package:flutter_current_results +permissions: read-all + +on: + # Run CI on all PRs (against any branch) and on pushes to the main branch. + pull_request: + paths: + - '.github/workflows/current_results_ui.yaml' + - 'current_results_ui/**' + push: + branches: [ main ] + paths: + - '.github/workflows/current_results_ui.yaml' + - 'current_results_ui/**' + schedule: + - cron: '0 0 * * 0' # weekly + +defaults: + run: + working-directory: current_results_ui + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + flutterSdk: + - stable + os: + - ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Cache Pub hosted dependencies + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 + with: + path: "~/.pub-cache/hosted" + key: "${{ matrix.os }}-${{ matrix.sdk }}" + - uses: subosito/flutter-action@v2 + with: + channel: ${{ matrix.flutterSdk }} + cache: true + cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" + + - run: flutter pub get + + - run: flutter analyze --fatal-infos + + - run: dart format --output=none --set-exit-if-changed . + + # TODO: Write tests + # - run: flutter test diff --git a/.github/workflows/github_label_notifier_ui.yaml b/.github/workflows/github_label_notifier_ui.yaml new file mode 100644 index 0000000..7cabd99 --- /dev/null +++ b/.github/workflows/github_label_notifier_ui.yaml @@ -0,0 +1,57 @@ +name: package:github_label_notifier_ui +permissions: read-all + +on: + # Run CI on all PRs (against any branch) and on pushes to the main branch. + pull_request: + paths: + - '.github/workflows/github_label_notifier_ui.yaml' + - 'github-label-notifier/ui/**' + push: + branches: [ main ] + paths: + - '.github/workflows/github_label_notifier_ui.yaml' + - 'github-label-notifier/ui/**' + schedule: + - cron: '0 0 * * 0' # weekly + +defaults: + run: + working-directory: github-label-notifier/ui + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + sdk: + - 2.10.0 # Does not work on newer SDKs. + os: + - ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 + name: Cache build_runner results + with: + path: github-label-notifier/ui/.dart_tool/build + key: ${{ matrix.os }}-${{ matrix.sdk }} + - name: Cache Pub hosted dependencies + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 + with: + path: "~/.pub-cache/hosted" + key: "${{ matrix.os }}-${{ matrix.sdk }}" + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c + with: + sdk: ${{ matrix.sdk }} + + - run: dart pub get + + - run: dart format --output=none --set-exit-if-changed . + + - run: dart pub run build_runner build + + - run: dart analyze --fatal-infos + + # TODO: Write tests + # - run: dart pub run build_runner test -- -p chrome diff --git a/.github/workflows/results_feed.yaml b/.github/workflows/results_feed.yaml new file mode 100644 index 0000000..8c4cdb1 --- /dev/null +++ b/.github/workflows/results_feed.yaml @@ -0,0 +1,56 @@ +name: package:dart_results_feed +permissions: read-all + +on: + # Run CI on all PRs (against any branch) and on pushes to the main branch. + pull_request: + paths: + - '.github/workflows/results_feed.yaml' + - 'results_feed/**' + push: + branches: [ main ] + paths: + - '.github/workflows/results_feed.yaml' + - 'results_feed/**' + schedule: + - cron: '0 0 * * 0' # weekly + +defaults: + run: + working-directory: results_feed + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + sdk: + - 2.10.0 # Does not work on newer SDKs. + os: + - ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Cache build_runner results + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 + with: + path: results_feed/.dart_tool/build + key: ${{ matrix.os }}-${{ matrix.sdk }} + - name: Cache Pub hosted dependencies + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 + with: + path: "~/.pub-cache/hosted" + key: "${{ matrix.os }}-${{ matrix.sdk }}" + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c + with: + sdk: ${{ matrix.sdk }} + + - run: dart pub get + + - run: dart format --output=none --set-exit-if-changed . + + - run: dart pub run build_runner build + + - run: dart analyze --fatal-infos + + - run: dart pub run build_runner test -- -p chrome -x requires_auth diff --git a/github-label-notifier/ui/lib/app_component.dart b/github-label-notifier/ui/lib/app_component.dart index d75736d..e6c0e28 100644 --- a/github-label-notifier/ui/lib/app_component.dart +++ b/github-label-notifier/ui/lib/app_component.dart @@ -6,9 +6,6 @@ import 'dart:async'; import 'package:angular/angular.dart'; import 'package:angular_components/angular_components.dart'; -import 'package:angular_components/material_button/material_button.dart'; -import 'package:angular_components/material_icon/material_icon.dart'; -import 'package:angular_components/material_select/material_dropdown_select.dart'; import 'src/services/github_service.dart'; import 'src/services/subscription_service.dart'; diff --git a/github-label-notifier/ui/lib/src/services/subscription_service.dart b/github-label-notifier/ui/lib/src/services/subscription_service.dart index d809a8b..d761721 100644 --- a/github-label-notifier/ui/lib/src/services/subscription_service.dart +++ b/github-label-notifier/ui/lib/src/services/subscription_service.dart @@ -137,11 +137,11 @@ class SubscriptionsService { Future _ensureApp() async { if (_app == null) { _app = firebase.initializeApp( - apiKey: "AIzaSyBFKKpPdV3xPQU4jPYiMvUnUfhB5pDDMRI", - authDomain: "dart-ci.firebaseapp.com", - databaseURL: "https://dart-ci.firebaseio.com", - projectId: "dart-ci", - storageBucket: "dart-ci.appspot.com"); + apiKey: 'AIzaSyBFKKpPdV3xPQU4jPYiMvUnUfhB5pDDMRI', + authDomain: 'dart-ci.firebaseapp.com', + databaseURL: 'https://dart-ci.firebaseio.com', + projectId: 'dart-ci', + storageBucket: 'dart-ci.appspot.com'); await _app.auth().setPersistence(firebase.Persistence.LOCAL); } return _app; @@ -159,7 +159,7 @@ class SubscriptionsService { final currentUser = app.auth().currentUser; final userId = currentUser.uid; - return app.firestore().doc('github-label-subscriptions/${userId}'); + return app.firestore().doc('github-label-subscriptions/$userId'); } } diff --git a/github-label-notifier/ui/pubspec.yaml b/github-label-notifier/ui/pubspec.yaml index b540705..892f979 100644 --- a/github-label-notifier/ui/pubspec.yaml +++ b/github-label-notifier/ui/pubspec.yaml @@ -2,7 +2,7 @@ name: src description: UI for managing label subscriptions for GitHub Label Notifier. environment: - sdk: '>=2.2.0 <3.0.0' + sdk: '>=2.2.0 <2.12.0' # Pre-null safety only dependencies: angular: any diff --git a/results_feed/dart_test.yaml b/results_feed/dart_test.yaml new file mode 100644 index 0000000..8416326 --- /dev/null +++ b/results_feed/dart_test.yaml @@ -0,0 +1,7 @@ +tags: + requires_auth: {} + +override_platforms: + chrome: + settings: + headless: true diff --git a/results_feed/lib/src/components/app_component.dart b/results_feed/lib/src/components/app_component.dart index cf987fb..3d380c4 100644 --- a/results_feed/lib/src/components/app_component.dart +++ b/results_feed/lib/src/components/app_component.dart @@ -9,7 +9,6 @@ import 'package:angular/angular.dart'; import 'package:angular_components/angular_components.dart'; import 'package:angular_components/material_button/material_button.dart'; import 'package:angular_router/angular_router.dart'; -import 'package:dart_results_feed/src/components/results_filter_component.dart'; import 'commit_component.dart'; import 'filter_row_component.dart'; diff --git a/results_feed/lib/src/components/filter_row_component.dart b/results_feed/lib/src/components/filter_row_component.dart index a584d80..8296c32 100644 --- a/results_feed/lib/src/components/filter_row_component.dart +++ b/results_feed/lib/src/components/filter_row_component.dart @@ -49,6 +49,7 @@ class FilterRowComponent implements OnInit { FilterRowComponent(this.service, this.buildService); + @override void ngOnInit() async { final configurations = await buildService.configurations; selectionOptions = [testSuggestion] diff --git a/results_feed/lib/src/components/results_filter_component.dart b/results_feed/lib/src/components/results_filter_component.dart index 40f1d59..b1f6fa4 100644 --- a/results_feed/lib/src/components/results_filter_component.dart +++ b/results_feed/lib/src/components/results_filter_component.dart @@ -68,7 +68,9 @@ class ResultsFilterComponent { ResultsFilterComponent(this.service); String get selectedType => filter.showLatestFailures - ? filter.showUnapprovedOnly ? unapprovedFailures : activeFailures + ? filter.showUnapprovedOnly + ? unapprovedFailures + : activeFailures : allResults; void select(String type) { diff --git a/results_feed/lib/src/model/comment.dart b/results_feed/lib/src/model/comment.dart index 7cadfd1..f61df80 100644 --- a/results_feed/lib/src/model/comment.dart +++ b/results_feed/lib/src/model/comment.dart @@ -57,8 +57,11 @@ class Comment implements Comparable { commentHtml = formatComment(comment); } - String approvedText() => - (approved == null) ? '' : approved ? 'approved' : 'disapproved'; + String approvedText() => (approved == null) + ? '' + : approved + ? 'approved' + : 'disapproved'; @override int compareTo(Object other) => created.compareTo((other as Comment).created); diff --git a/results_feed/pubspec.lock b/results_feed/pubspec.lock index 5ded88f..457d606 100644 --- a/results_feed/pubspec.lock +++ b/results_feed/pubspec.lock @@ -112,7 +112,7 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.7" build_modules: dependency: transitive description: @@ -182,7 +182,7 @@ packages: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" cli_repl: dependency: transitive description: @@ -196,7 +196,7 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.4.0" + version: "3.7.0" collection: dependency: transitive description: @@ -217,7 +217,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "0.14.0" + version: "0.14.2" crypto: dependency: transitive description: @@ -246,13 +246,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.10" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.1" firebase: dependency: "direct main" description: name: firebase url: "https://pub.dartlang.org" source: hosted - version: "7.3.0" + version: "7.3.3" fixnum: dependency: transitive description: @@ -273,7 +280,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" graphs: dependency: transitive description: @@ -287,7 +294,7 @@ packages: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+3" + version: "0.14.0+4" http: dependency: "direct main" description: @@ -322,7 +329,7 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.3.5" js: dependency: transitive description: @@ -336,7 +343,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.1" kernel: dependency: transitive description: @@ -364,14 +371,14 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "1.2.4" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.6+3" + version: "0.9.7" multi_server_socket: dependency: transitive description: @@ -385,21 +392,21 @@ packages: name: node_interop url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.1" node_io: dependency: transitive description: name: node_io url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.0" node_preamble: dependency: transitive description: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.12" + version: "1.4.13" observable: dependency: transitive description: @@ -427,7 +434,7 @@ packages: name: pageloader url: "https://pub.dartlang.org" source: hosted - version: "3.3.0" + version: "3.3.1" path: dependency: transitive description: @@ -469,21 +476,21 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.8" quiver: dependency: "direct main" description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.5" sass: dependency: transitive description: name: sass url: "https://pub.dartlang.org" source: hosted - version: "1.26.10" + version: "1.32.8" sass_builder: dependency: "direct dev" description: @@ -497,7 +504,7 @@ packages: name: scratch_space url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+2" + version: "0.0.4+3" service_worker: dependency: "direct main" description: @@ -511,28 +518,28 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.7" + version: "0.7.9" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "0.2.8" + version: "0.2.9+2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.2.4+1" source_gen: dependency: transitive description: @@ -567,7 +574,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.9.6" stream_channel: dependency: transitive description: @@ -630,7 +637,7 @@ packages: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+2" + version: "0.1.1+3" tuple: dependency: transitive description: @@ -651,7 +658,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.2.0" watcher: dependency: transitive description: @@ -665,7 +672,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" webdriver: dependency: transitive description: @@ -679,7 +686,7 @@ packages: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "0.7.3" + version: "0.7.5" yaml: dependency: transitive description: @@ -688,4 +695,4 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.8.0-dev.10.0 <3.0.0" + dart: ">=2.10.0 <2.12.0" diff --git a/results_feed/pubspec.yaml b/results_feed/pubspec.yaml index a878de7..7f49b9f 100644 --- a/results_feed/pubspec.yaml +++ b/results_feed/pubspec.yaml @@ -3,7 +3,7 @@ description: The Dart results feed in Angular using Firebase version: 0.0.1 environment: - sdk: '>=2.5.0 <3.0.0' + sdk: '>=2.5.0 <2.12.0' dependency_overrides: # There is no sdk 2.10 version of dart_internal diff --git a/results_feed/test/comments_test.dart b/results_feed/test/comments_test.dart index a93abde..ca61577 100644 --- a/results_feed/test/comments_test.dart +++ b/results_feed/test/comments_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. @TestOn('browser') +@Tags(['requires_auth']) import 'package:angular/di.dart'; import 'package:angular_test/angular_test.dart'; import 'package:dart_results_feed/src/components/app_component.dart'; diff --git a/results_feed/test/try_results_test.dart b/results_feed/test/try_results_test.dart index 93a0458..9e7ddd7 100644 --- a/results_feed/test/try_results_test.dart +++ b/results_feed/test/try_results_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. @TestOn('browser') +@Tags(['requires_auth']) import 'package:angular/di.dart'; import 'package:angular_test/angular_test.dart'; import 'package:dart_results_feed/src/components/try_results_component.dart';