evaluate method

DVReleaseHealthDecision evaluate(
  1. DVReleaseHealth health, {
  2. required String release,
  3. String? patch,
})

Implementation

DVReleaseHealthDecision evaluate(
  DVReleaseHealth health, {
  required String release,
  String? patch,
}) {
  final DVReleaseHealthNumbers overall =
      health.numbers(release: release, patch: patch);
  final List<String> held = <String>[
    for (final String cohort in health.cohorts(release: release, patch: patch))
      if (_breached(
          health.numbers(release: release, patch: patch, cohort: cohort)))
        cohort,
  ];
  final bool hold = _breached(overall) || held.isNotEmpty;
  if (hold) {
    _diagnose(
      'DV-CRASH-010',
      'release $release${patch == null ? '' : ' patch $patch'} is below its '
      'crash-free threshold'
      '${held.isEmpty ? '' : ' in ${held.join(', ')}'}; the rollout was held',
    );
  }
  return DVReleaseHealthDecision(
    hold: hold,
    heldCohorts: held,
    flagsToTurnOff: hold ? List<String>.unmodifiable(stagedFlags) : const <String>[],
    overall: overall,
  );
}