Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run health.yaml for bots #222

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

mosuem marked this conversation as resolved.
Show resolved Hide resolved
## 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