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

remove the 'version' section from the health checks #305

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
29 changes: 8 additions & 21 deletions .github/workflows/health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ name: Health
# uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# with:
# sdk: beta
# checks: "version,changelog,license,coverage,breaking,do-not-submit,leaking"
# fail_on: "version,changelog,do-not-submit"
# checks: "changelog,license,coverage,breaking,do-not-submit,leaking"
# fail_on: "changelog,do-not-submit"
# warn_on: "license,coverage,breaking,leaking"
# coverage_web: false
# upload_coverage: false
Expand Down Expand Up @@ -52,17 +52,17 @@ on:
# Restrict the checks to any subset of version, changelog, and license if
# needed.
checks:
description: What to check for in the PR health check - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
default: "version,changelog,license,coverage,breaking,do-not-submit,leaking"
description: What to check for in the PR health check - any subset of "changelog,license,coverage,breaking,do-not-submit,leaking"
default: "changelog,license,coverage,breaking,do-not-submit,leaking"
type: string
required: false
fail_on:
description: Which checks should lead to failure - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
default: "version,changelog,do-not-submit"
description: Which checks should lead to failure - any subset of "changelog,license,coverage,breaking,do-not-submit,leaking"
default: "changelog,do-not-submit"
type: string
required: false
warn_on:
description: Which checks should not fail, but only warn - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
description: Which checks should not fail, but only warn - any subset of "changelog,license,coverage,breaking,do-not-submit,leaking"
default: "license,coverage,breaking,leaking"
type: string
required: false
Expand Down Expand Up @@ -113,19 +113,6 @@ on:
required: false

jobs:
version:
if: ${{ contains(inputs.checks, 'version') }}
uses: ./.github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
check: version
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
ignore_packages: ${{ inputs.ignore_packages }}
checkout_submodules: ${{ inputs.checkout_submodules }}

changelog:
if: ${{ contains(inputs.checks, 'changelog') }}
uses: ./.github/workflows/health_base.yaml
Expand Down Expand Up @@ -210,7 +197,7 @@ jobs:
checkout_submodules: ${{ inputs.checkout_submodules }}

comment:
needs: [version, changelog, license, coverage, breaking, do-not-submit, leaking]
needs: [changelog, license, coverage, breaking, do-not-submit, leaking]
if: always()
# These permissions are required for us to create comments on PRs.
permissions:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/health_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ on:
required: false
type: string
check:
description: What to check for in the PR health check - any of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
description: What to check for in the PR health check - any of "changelog,license,coverage,breaking,do-not-submit,leaking"
type: string
required: true
fail_on:
description: Which checks should lead to failure - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
default: "version,changelog,do-not-submit"
description: Which checks should lead to failure - any subset of "changelog,license,coverage,breaking,do-not-submit,leaking"
default: "changelog,do-not-submit"
type: string
required: false
warn_on:
description: Which checks should not fail, but only warn - any subset of "version,changelog,license,coverage,breaking,do-not-submit,leaking"
description: Which checks should not fail, but only warn - any subset of "changelog,license,coverage,breaking,do-not-submit,leaking"
default: "license,coverage,breaking,leaking"
type: string
required: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/health_internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
local_debug: true
coverage_web: false
upload_coverage: false
checks: version,changelog,license,coverage,breaking,do-not-submit,leaking
fail_on: version,changelog,do-not-submit
checks: changelog,license,coverage,breaking,do-not-submit,leaking
fail_on: changelog,do-not-submit
warn_on: license,coverage,breaking,leaking
ignore_license: 'pkgs/firehose/test_data'
ignore_coverage: 'pkgs/firehose/bin,pkgs/firehose/test_data'
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.10.0

- Remove the `version` pubspec checks (these largely duplicate the feedback
provided by publishing automation).

## 0.9.3

- Do not check Dart SDK in PR Health breaking check.
Expand Down
9 changes: 4 additions & 5 deletions pkgs/firehose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ This is a Github workflow to check PR health.

When run from a PR, this tool will check a configurable subset of the following

* The package versioning is correct and consistent, see `firehose` description above.
* A changelog entry has been added.
* All `.dart` files have a license header.
* How the test coverage is affected by the PR.
Expand All @@ -187,8 +186,8 @@ jobs:
uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# with:
# sdk: beta
# checks: "version,changelog,license,coverage,breaking,do-not-submit,leaking"
# fail_on: "version,changelog,do-not-submit"
# checks: "changelog,license,coverage,breaking,do-not-submit,leaking"
# fail_on: "changelog,do-not-submit"
# warn_on: "license,coverage,breaking,leaking"
# coverage_web: false
# upload_coverage: false
Expand Down Expand Up @@ -229,8 +228,8 @@ jobs:

| Name | Type | Description | Example |
| ------------- | ------------- | ------------- | ------------- |
| checks | List of strings | What to check for in the PR health check | `"version,changelog,license,coverage,breaking,do-not-submit,leaking"` |
| fail_on | List of strings | Which checks should lead to failure | `"version,changelog,do-not-submit"` |
| checks | List of strings | What to check for in the PR health check | `"changelog,license,coverage,breaking,do-not-submit,leaking"` |
| fail_on | List of strings | Which checks should lead to failure | `"changelog,do-not-submit"` |
| warn_on | List of strings | Which checks should not fail, but only warn | `"license,coverage,breaking,leaking"` |
| upload_coverage | boolean | Whether to upload the coverage to [coveralls](https://coveralls.io/) | `true` |
| coverage_web | boolean | Whether to run `dart test -p chrome` for coverage | `false` |
Expand Down
24 changes: 0 additions & 24 deletions pkgs/firehose/lib/src/health/health.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: always_declare_return_types

import 'dart:convert';
import 'dart:io';
import 'dart:math';
Expand All @@ -20,7 +18,6 @@ import 'coverage.dart';
import 'license.dart';

enum Check {
version('Package publish validation', 'version'),
license('License Headers', 'license'),
changelog('Changelog Entry', 'changelog'),
coverage('Coverage', 'coverage'),
Expand Down Expand Up @@ -119,7 +116,6 @@ class Health {
}

Future<HealthCheckResult> Function() checkFor(Check check) => switch (check) {
Check.version => validateCheck,
Check.license => licenseCheck,
Check.changelog => changelogCheck,
Check.coverage => coverageCheck,
Expand All @@ -128,26 +124,6 @@ class Health {
Check.leaking => leakingCheck,
};

Future<HealthCheckResult> validateCheck() async {
//TODO: Add Flutter support for PR health checks
var results =
await Firehose(directory, false, ignoredPackages).verify(github);

var markdownTable = '''
| Package | Version | Status |
| :--- | ---: | :--- |
${results.describeAsMarkdown(withTag: false)}

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
''';

return HealthCheckResult(
Check.version,
results.severity,
markdownTable,
);
}

Future<HealthCheckResult> breakingCheck() async {
final filesInPR = await github.listFilesForPR(directory, ignoredPackages);
final changeForPackage = <Package, BreakingChange>{};
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.9.3
version: 0.10.0
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose

environment:
Expand Down
18 changes: 0 additions & 18 deletions pkgs/firehose/test_data/golden/comment_version.md

This file was deleted.

This file was deleted.

Loading