Skip to content

Commit d7aaecb

Browse files
authored
Run health.yaml for bots (#222)
* Run `health.yaml` for bots * Remove unused tag * Fix coverage * Add entry to changelog
1 parent 971c733 commit d7aaecb

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

pkgs/firehose/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.5.2
2+
3+
- Also run health workflows on bot PRs.
4+
- Fix coverage handling on monorepos.
5+
16
## 0.5.1
27

38
- Fix comment ID serialization to disk.

pkgs/firehose/lib/src/health/coverage.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ class Coverage {
5858
.where((element) => element.name == package.name)
5959
.firstOrNull;
6060
final oldCoverages = getCoverage(basePackage);
61-
for (var file in filesOfInterest.map((file) => file.relativePath)) {
62-
var oldCoverage = oldCoverages[file];
63-
var newCoverage = newCoverages[file];
64-
print('Compage coverage for $file: $oldCoverage vs $newCoverage');
65-
coverageResult[file] = Change(
61+
var filePaths = filesOfInterest
62+
.where((file) => file.isInPackage(package))
63+
.map((file) => file.relativePath);
64+
for (var filePath in filePaths) {
65+
var oldCoverage = oldCoverages[filePath];
66+
var newCoverage = newCoverages[filePath];
67+
print('Compage coverage for $filePath: $oldCoverage vs $newCoverage');
68+
coverageResult[filePath] = Change(
6669
oldCoverage: oldCoverage,
6770
newCoverage: newCoverage,
6871
);

pkgs/firehose/lib/src/health/health.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import 'changelog.dart';
2020
import 'coverage.dart';
2121
import 'license.dart';
2222

23-
const String _botSuffix = '[bot]';
24-
2523
const String _publishBotTag2 = '### Package publish validation';
2624

2725
const String _licenseBotTag = '### License Headers';
@@ -66,11 +64,6 @@ class Health {
6664
if (!expectEnv(github.issueNumber?.toString(), 'ISSUE_NUMBER')) return;
6765
if (!expectEnv(github.sha, 'GITHUB_SHA')) return;
6866

69-
if ((github.actor ?? '').endsWith(_botSuffix)) {
70-
print('Skipping package validation for ${github.actor} PRs.');
71-
return;
72-
}
73-
7467
print('Start health check for the check $check');
7568
print('Checking for $check');
7669
if (!github.prLabels.contains('skip-$check-check')) {

pkgs/firehose/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: firehose
22
description: A tool to automate publishing of Pub packages from GitHub actions.
3-
version: 0.5.1
3+
version: 0.5.2
44
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose
55

66
environment:

0 commit comments

Comments
 (0)