Skip to content
52 changes: 52 additions & 0 deletions .github/workflows/current_results_ui.yaml
Original file line number Diff line number Diff line change
@@ -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
57 changes: 57 additions & 0 deletions .github/workflows/github_label_notifier_ui.yaml
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions .github/workflows/results_feed.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions github-label-notifier/ui/lib/app_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ class SubscriptionsService {
Future<firebase.App> _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;
Expand All @@ -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');
}
}

Expand Down
2 changes: 1 addition & 1 deletion github-label-notifier/ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions results_feed/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tags:
requires_auth: {}

override_platforms:
chrome:
settings:
headless: true
1 change: 0 additions & 1 deletion results_feed/lib/src/components/app_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions results_feed/lib/src/components/filter_row_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class FilterRowComponent implements OnInit {

FilterRowComponent(this.service, this.buildService);

@override
void ngOnInit() async {
final configurations = await buildService.configurations;
selectionOptions = [testSuggestion]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 5 additions & 2 deletions results_feed/lib/src/model/comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading