Skip to content

Commit

Permalink
Run health.yaml for bots (#222)
Browse files Browse the repository at this point in the history
* Run `health.yaml` for bots

* Remove unused tag

* Fix coverage

* Add entry to changelog
  • Loading branch information
mosuem authored Jan 10, 2024
1 parent 971c733 commit d7aaecb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
5 changes: 5 additions & 0 deletions pkgs/firehose/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
13 changes: 8 additions & 5 deletions pkgs/firehose/lib/src/health/coverage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
7 changes: 0 additions & 7 deletions pkgs/firehose/lib/src/health/health.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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')) {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/firehose/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit d7aaecb

Please sign in to comment.