More concise formatting of github workflow summary comments (#288)
The health check comment that is posted currently is extremely long, and pushes user comments below the fold.
This proposed new formatting shortens it up quite a bit.
diff --git a/pkgs/firehose/CHANGELOG.md b/pkgs/firehose/CHANGELOG.md
index d409f86..1ded817 100644
--- a/pkgs/firehose/CHANGELOG.md
+++ b/pkgs/firehose/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.9.2
+
+- Improve formatting of the github workflow summary comments so they use less
+ vertical space.
+
## 0.9.1
- Support packages nested under a 'workspace' root package.
diff --git a/pkgs/firehose/lib/src/health/health.dart b/pkgs/firehose/lib/src/health/health.dart
index e0cc3b0..12e1d1f 100644
--- a/pkgs/firehose/lib/src/health/health.dart
+++ b/pkgs/firehose/lib/src/health/health.dart
@@ -20,13 +20,13 @@
import 'license.dart';
enum Check {
- version('### Package publish validation', 'version'),
- license('### License Headers', 'license'),
- changelog('### Changelog Entry', 'changelog'),
- coverage('### Coverage', 'coverage'),
- breaking('### Breaking changes', 'breaking'),
- leaking('### API leaks', 'leaking'),
- donotsubmit('### Do Not Submit', 'do-not-submit');
+ version('Package publish validation', 'version'),
+ license('License Headers', 'license'),
+ changelog('Changelog Entry', 'changelog'),
+ coverage('Coverage', 'coverage'),
+ breaking('Breaking changes', 'breaking'),
+ leaking('API leaks', 'leaking'),
+ donotsubmit('Do Not Submit', 'do-not-submit');
final String tag;
@@ -406,10 +406,11 @@
if (result.markdown != null) {
var markdown = result.markdown;
var isWorseThanInfo = result.severity.index >= Severity.warning.index;
- var s = '''
+
+ markdownSummary = '''
<details${isWorseThanInfo ? ' open' : ''}>
<summary>
-Details
+<strong>${check.tag}</strong> ${result.severity.emoji}
</summary>
$markdown
@@ -418,7 +419,6 @@
</details>
''';
- markdownSummary = '${check.tag} ${result.severity.emoji}\n\n$s';
} else {
markdownSummary = '';
}
diff --git a/pkgs/firehose/pubspec.yaml b/pkgs/firehose/pubspec.yaml
index d9a079a..7340307 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.9.1
+version: 0.9.2
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose
environment:
diff --git a/pkgs/firehose/test_data/golden/comment_breaking.md b/pkgs/firehose/test_data/golden/comment_breaking.md
index 4bfe13d..84aabe0 100644
--- a/pkgs/firehose/test_data/golden/comment_breaking.md
+++ b/pkgs/firehose/test_data/golden/comment_breaking.md
@@ -1,8 +1,6 @@
-### Breaking changes :warning:
-
<details open>
<summary>
-Details
+<strong>Breaking changes</strong> :warning:
</summary>
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
diff --git a/pkgs/firehose/test_data/golden/comment_breaking_ignore_package.md b/pkgs/firehose/test_data/golden/comment_breaking_ignore_package.md
index 121b540..59fda74 100644
--- a/pkgs/firehose/test_data/golden/comment_breaking_ignore_package.md
+++ b/pkgs/firehose/test_data/golden/comment_breaking_ignore_package.md
@@ -1,8 +1,6 @@
-### Breaking changes :warning:
-
<details open>
<summary>
-Details
+<strong>Breaking changes</strong> :warning:
</summary>
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
diff --git a/pkgs/firehose/test_data/golden/comment_changelog.md b/pkgs/firehose/test_data/golden/comment_changelog.md
index 2fae543..ae601ae 100644
--- a/pkgs/firehose/test_data/golden/comment_changelog.md
+++ b/pkgs/firehose/test_data/golden/comment_changelog.md
@@ -1,8 +1,6 @@
-### Changelog Entry :exclamation:
-
<details open>
<summary>
-Details
+<strong>Changelog Entry</strong> :exclamation:
</summary>
| Package | Changed Files |
diff --git a/pkgs/firehose/test_data/golden/comment_changelog_ignore_package.md b/pkgs/firehose/test_data/golden/comment_changelog_ignore_package.md
index 00fa903..8c154a4 100644
--- a/pkgs/firehose/test_data/golden/comment_changelog_ignore_package.md
+++ b/pkgs/firehose/test_data/golden/comment_changelog_ignore_package.md
@@ -1,8 +1,6 @@
-### Changelog Entry :exclamation:
-
<details open>
<summary>
-Details
+<strong>Changelog Entry</strong> :exclamation:
</summary>
| Package | Changed Files |
diff --git a/pkgs/firehose/test_data/golden/comment_coverage.md b/pkgs/firehose/test_data/golden/comment_coverage.md
index acd10c8..52d81ee 100644
--- a/pkgs/firehose/test_data/golden/comment_coverage.md
+++ b/pkgs/firehose/test_data/golden/comment_coverage.md
@@ -1,8 +1,6 @@
-### Coverage :warning:
-
<details open>
<summary>
-Details
+<strong>Coverage</strong> :warning:
</summary>
| File | Coverage |
diff --git a/pkgs/firehose/test_data/golden/comment_coverage_ignore_package.md b/pkgs/firehose/test_data/golden/comment_coverage_ignore_package.md
index c492d00..4613733 100644
--- a/pkgs/firehose/test_data/golden/comment_coverage_ignore_package.md
+++ b/pkgs/firehose/test_data/golden/comment_coverage_ignore_package.md
@@ -1,8 +1,6 @@
-### Coverage :warning:
-
<details open>
<summary>
-Details
+<strong>Coverage</strong> :warning:
</summary>
| File | Coverage |
diff --git a/pkgs/firehose/test_data/golden/comment_do-not-submit.md b/pkgs/firehose/test_data/golden/comment_do-not-submit.md
index 4df7261..530c94f 100644
--- a/pkgs/firehose/test_data/golden/comment_do-not-submit.md
+++ b/pkgs/firehose/test_data/golden/comment_do-not-submit.md
@@ -1,8 +1,6 @@
-### Do Not Submit :exclamation:
-
<details open>
<summary>
-Details
+<strong>Do Not Submit</strong> :exclamation:
</summary>
Body contains `DO_NOT_SUBMIT`: false
diff --git a/pkgs/firehose/test_data/golden/comment_leaking.md b/pkgs/firehose/test_data/golden/comment_leaking.md
index 64d3793..b0abc3d 100644
--- a/pkgs/firehose/test_data/golden/comment_leaking.md
+++ b/pkgs/firehose/test_data/golden/comment_leaking.md
@@ -1,8 +1,6 @@
-### API leaks :warning:
-
<details open>
<summary>
-Details
+<strong>API leaks</strong> :warning:
</summary>
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
diff --git a/pkgs/firehose/test_data/golden/comment_leaking_ignore_package.md b/pkgs/firehose/test_data/golden/comment_leaking_ignore_package.md
index 64d3793..b0abc3d 100644
--- a/pkgs/firehose/test_data/golden/comment_leaking_ignore_package.md
+++ b/pkgs/firehose/test_data/golden/comment_leaking_ignore_package.md
@@ -1,8 +1,6 @@
-### API leaks :warning:
-
<details open>
<summary>
-Details
+<strong>API leaks</strong> :warning:
</summary>
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
diff --git a/pkgs/firehose/test_data/golden/comment_license.md b/pkgs/firehose/test_data/golden/comment_license.md
index ad5231b..c671aa7 100644
--- a/pkgs/firehose/test_data/golden/comment_license.md
+++ b/pkgs/firehose/test_data/golden/comment_license.md
@@ -1,8 +1,6 @@
-### License Headers :exclamation:
-
<details open>
<summary>
-Details
+<strong>License Headers</strong> :exclamation:
</summary>
```
diff --git a/pkgs/firehose/test_data/golden/comment_license_ignore_license.md b/pkgs/firehose/test_data/golden/comment_license_ignore_license.md
index cfb1871..3903f9e 100644
--- a/pkgs/firehose/test_data/golden/comment_license_ignore_license.md
+++ b/pkgs/firehose/test_data/golden/comment_license_ignore_license.md
@@ -1,8 +1,6 @@
-### License Headers :exclamation:
-
<details open>
<summary>
-Details
+<strong>License Headers</strong> :exclamation:
</summary>
```
diff --git a/pkgs/firehose/test_data/golden/comment_license_ignore_package.md b/pkgs/firehose/test_data/golden/comment_license_ignore_package.md
index 47860a9..8a6f79a 100644
--- a/pkgs/firehose/test_data/golden/comment_license_ignore_package.md
+++ b/pkgs/firehose/test_data/golden/comment_license_ignore_package.md
@@ -1,8 +1,6 @@
-### License Headers :exclamation:
-
<details open>
<summary>
-Details
+<strong>License Headers</strong> :exclamation:
</summary>
```
diff --git a/pkgs/firehose/test_data/golden/comment_version.md b/pkgs/firehose/test_data/golden/comment_version.md
index e01840e..c8835af 100644
--- a/pkgs/firehose/test_data/golden/comment_version.md
+++ b/pkgs/firehose/test_data/golden/comment_version.md
@@ -1,8 +1,6 @@
-### Package publish validation :exclamation:
-
<details open>
<summary>
-Details
+<strong>Package publish validation</strong> :exclamation:
</summary>
| Package | Version | Status |
diff --git a/pkgs/firehose/test_data/golden/comment_version_ignore_package.md b/pkgs/firehose/test_data/golden/comment_version_ignore_package.md
index 697af42..376e1d9 100644
--- a/pkgs/firehose/test_data/golden/comment_version_ignore_package.md
+++ b/pkgs/firehose/test_data/golden/comment_version_ignore_package.md
@@ -1,8 +1,6 @@
-### Package publish validation :exclamation:
-
<details open>
<summary>
-Details
+<strong>Package publish validation</strong> :exclamation:
</summary>
| Package | Version | Status |