From d7aaecb5c5c939a2f14411bcd1e756b39fc53833 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 10 Jan 2024 11:41:30 +0100 Subject: [PATCH] Run `health.yaml` for bots (#222) * Run `health.yaml` for bots * Remove unused tag * Fix coverage * Add entry to changelog --- pkgs/firehose/CHANGELOG.md | 5 +++++ pkgs/firehose/lib/src/health/coverage.dart | 13 ++++++++----- pkgs/firehose/lib/src/health/health.dart | 7 ------- pkgs/firehose/pubspec.yaml | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/firehose/CHANGELOG.md b/pkgs/firehose/CHANGELOG.md index 1eb0dbe7..d54df277 100644 --- a/pkgs/firehose/CHANGELOG.md +++ b/pkgs/firehose/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.2 + +- Also run health workflows on bot PRs. +- Fix coverage handling on monorepos. + ## 0.5.1 - Fix comment ID serialization to disk. diff --git a/pkgs/firehose/lib/src/health/coverage.dart b/pkgs/firehose/lib/src/health/coverage.dart index 1050a677..b1e8aa12 100644 --- a/pkgs/firehose/lib/src/health/coverage.dart +++ b/pkgs/firehose/lib/src/health/coverage.dart @@ -58,11 +58,14 @@ class Coverage { .where((element) => element.name == package.name) .firstOrNull; final oldCoverages = getCoverage(basePackage); - for (var file in filesOfInterest.map((file) => file.relativePath)) { - var oldCoverage = oldCoverages[file]; - var newCoverage = newCoverages[file]; - print('Compage coverage for $file: $oldCoverage vs $newCoverage'); - coverageResult[file] = Change( + var filePaths = filesOfInterest + .where((file) => file.isInPackage(package)) + .map((file) => file.relativePath); + for (var filePath in filePaths) { + var oldCoverage = oldCoverages[filePath]; + var newCoverage = newCoverages[filePath]; + print('Compage coverage for $filePath: $oldCoverage vs $newCoverage'); + coverageResult[filePath] = Change( oldCoverage: oldCoverage, newCoverage: newCoverage, ); diff --git a/pkgs/firehose/lib/src/health/health.dart b/pkgs/firehose/lib/src/health/health.dart index 5dab5e4d..7f1ce1e7 100644 --- a/pkgs/firehose/lib/src/health/health.dart +++ b/pkgs/firehose/lib/src/health/health.dart @@ -20,8 +20,6 @@ import 'changelog.dart'; import 'coverage.dart'; import 'license.dart'; -const String _botSuffix = '[bot]'; - const String _publishBotTag2 = '### Package publish validation'; const String _licenseBotTag = '### License Headers'; @@ -66,11 +64,6 @@ class Health { if (!expectEnv(github.issueNumber?.toString(), 'ISSUE_NUMBER')) return; if (!expectEnv(github.sha, 'GITHUB_SHA')) return; - if ((github.actor ?? '').endsWith(_botSuffix)) { - print('Skipping package validation for ${github.actor} PRs.'); - return; - } - print('Start health check for the check $check'); print('Checking for $check'); if (!github.prLabels.contains('skip-$check-check')) { diff --git a/pkgs/firehose/pubspec.yaml b/pkgs/firehose/pubspec.yaml index 6d657bb8..4519fdec 100644 --- a/pkgs/firehose/pubspec.yaml +++ b/pkgs/firehose/pubspec.yaml @@ -1,6 +1,6 @@ name: firehose description: A tool to automate publishing of Pub packages from GitHub actions. -version: 0.5.1 +version: 0.5.2 repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose environment: