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

More concise formatting of github workflow summary comments #288

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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.9.2-wip
jakemac53 marked this conversation as resolved.
Show resolved Hide resolved

- 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-wip
jakemac53 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading