[results feed] Show 'skipped' results as successes, not failures

If a test is no longer run on a configuration, that is not a failure.

TBR: athom@google.com
Change-Id: Iac10fb8745deb73148c06e98725778e8bde5f7e0
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/135920
Reviewed-by: William Hesse <whesse@google.com>
diff --git a/results_feed/lib/src/components/results_selector_panel.dart b/results_feed/lib/src/components/results_selector_panel.dart
index b8c4355..f0e0965 100644
--- a/results_feed/lib/src/components/results_selector_panel.dart
+++ b/results_feed/lib/src/components/results_selector_panel.dart
@@ -61,8 +61,7 @@
   void recomputeChanges() {
     if (_changes == null) return;
     if (failuresOnly) {
-      _changes = Changes(
-          changes.flat.where((change) => change.result != change.expected));
+      _changes = Changes(changes.flat.where((change) => change.failed));
     }
     for (final configurationGroup in changes) {
       configurationCheckboxes[configurationGroup] = FixedMixedCheckbox();
diff --git a/results_feed/lib/src/components/try_results_component.dart b/results_feed/lib/src/components/try_results_component.dart
index 1fac8fd..85660ff 100644
--- a/results_feed/lib/src/components/try_results_component.dart
+++ b/results_feed/lib/src/components/try_results_component.dart
@@ -62,8 +62,8 @@
 
   TryResultsComponent(this._tryDataService, this._applicationRef);
 
-  bool get approveEnabled => changeGroup.changes.flat
-      .any((change) => change.result != change.expected);
+  bool get approveEnabled =>
+      changeGroup.changes.flat.any((change) => change.failed);
 
   bool get approving => _approving;
 
@@ -150,8 +150,6 @@
     window.open(newIssueURL(), '_blank');
   }
 
-  String newIssueURL() =>
-    githubNewIssueURL(changeGroup.changes, reviewInfo.title,
-    "https://dart-review.googlesource.com/c/sdk/+/$review");
-
+  String newIssueURL() => githubNewIssueURL(changeGroup.changes,
+      reviewInfo.title, "https://dart-review.googlesource.com/c/sdk/+/$review");
 }
diff --git a/results_feed/lib/src/model/commit.dart b/results_feed/lib/src/model/commit.dart
index 9916fc7..a34aa22 100644
--- a/results_feed/lib/src/model/commit.dart
+++ b/results_feed/lib/src/model/commit.dart
@@ -189,6 +189,7 @@
           // Field is only present when true.
           document.get('active') ?? false,
         );
+  static const skipped = 'skipped';
 
   final String id;
   final String name;
@@ -209,7 +210,8 @@
 
   int compareTo(Object other) => name.compareTo((other as Change).name);
 
-  String get resultStyle => result == expected ? 'success' : 'failure';
+  bool get failed => result != expected && result != skipped;
+  String get resultStyle => failed ? 'failure' : 'success';
 }
 
 class Changes with IterableMixin<List<List<Change>>> {
@@ -254,10 +256,8 @@
 
   static List<List<List<Change>>> failuresFirst(
       List<List<List<Change>>> unsorted) {
-    bool resultGroupIsFailure(List<Change> group) =>
-        group.first.resultStyle == 'failure';
-    bool resultGroupIsSuccess(List<Change> group) =>
-        group.first.resultStyle == 'success';
+    bool resultGroupIsFailure(List<Change> group) => group.first.failed;
+    bool resultGroupIsSuccess(List<Change> group) => !group.first.failed;
     bool configurationGroupHasFailure(List<List<Change>> group) =>
         group.any(resultGroupIsFailure);
     bool configurationGroupHasNoFailures(List<List<Change>> group) =>
@@ -311,7 +311,7 @@
 
   List<Change> resultFilter(List<Change> list, Filter filter) {
     if ((filter.showLatestFailures || filter.showUnapprovedOnly) &&
-        list.first.resultStyle != 'failure') {
+        list.first.failed) {
       return [];
     }
     return applyFilter<Change>((c, f) => c, list, filter,
@@ -321,7 +321,7 @@
 
 String githubNewIssueURL(Changes changes, String subject, String link) {
   List<Change> failures =
-      changes.flat.where((change) => change.result != change.expected).toList();
+      changes.flat.where((change) => change.failed).toList();
   failures.sort((a, b) => a.name.compareTo(b.name));
   final failuresLimit = 30;
   final title = "Failures on $subject";