Skip to content

Commit

Permalink
More concise formatting of github workflow summary comments (#288)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jakemac53 authored Aug 16, 2024
1 parent de7883c commit 8626bff
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 53 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.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.
Expand Down
20 changes: 10 additions & 10 deletions pkgs/firehose/lib/src/health/health.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import 'coverage.dart';
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;

Expand Down Expand Up @@ -406,10 +406,11 @@ This check for [test coverage](https://github.com/dart-lang/ecosystem/wiki/Test-
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
Expand All @@ -418,7 +419,6 @@ ${isWorseThanInfo ? 'This check can be disabled by tagging the PR with `skip-${r
</details>
''';
markdownSummary = '${check.tag} ${result.severity.emoji}\n\n$s';
} else {
markdownSummary = '';
}
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.1
version: 0.9.2
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose

environment:
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_breaking.md
Original file line number Diff line number Diff line change
@@ -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? |
Expand Down
Original file line number Diff line number Diff line change
@@ -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? |
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### Changelog Entry :exclamation:

<details open>
<summary>
Details
<strong>Changelog Entry</strong> :exclamation:
</summary>

| Package | Changed Files |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### Changelog Entry :exclamation:

<details open>
<summary>
Details
<strong>Changelog Entry</strong> :exclamation:
</summary>

| Package | Changed Files |
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_coverage.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### Coverage :warning:

<details open>
<summary>
Details
<strong>Coverage</strong> :warning:
</summary>

| File | Coverage |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### Coverage :warning:

<details open>
<summary>
Details
<strong>Coverage</strong> :warning:
</summary>

| File | Coverage |
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_do-not-submit.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_leaking.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_license.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### License Headers :exclamation:

<details open>
<summary>
Details
<strong>License Headers</strong> :exclamation:
</summary>

```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### License Headers :exclamation:

<details open>
<summary>
Details
<strong>License Headers</strong> :exclamation:
</summary>

```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### License Headers :exclamation:

<details open>
<summary>
Details
<strong>License Headers</strong> :exclamation:
</summary>

```
Expand Down
4 changes: 1 addition & 3 deletions pkgs/firehose/test_data/golden/comment_version.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### Package publish validation :exclamation:

<details open>
<summary>
Details
<strong>Package publish validation</strong> :exclamation:
</summary>

| Package | Version | Status |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
### Package publish validation :exclamation:

<details open>
<summary>
Details
<strong>Package publish validation</strong> :exclamation:
</summary>

| Package | Version | Status |
Expand Down

0 comments on commit 8626bff

Please sign in to comment.