Skip to content

Demo: coverage report comment for the go-coverage-report README - #6

Merged
fgrosse merged 1 commit into
readme-screenshot-basefrom
readme-screenshot
Sep 24, 2026
Merged

fgrosse merged 1 commit into
readme-screenshot-basefrom
readme-screenshot

Conversation

@fgrosse

@fgrosse fgrosse commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Demo pull request to show the new coverage report comment of fgrosse/go-coverage-report#110 for the README screenshot. Not meant to be merged.

It changes the coverage in two packages: the new Clone methods are untested (decrease in prioqueue) and new tests cover topk.Largest (increase in topk).

Demo change to show the coverage report comment of
fgrosse/go-coverage-report#110 in action.
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/fgrosse/prioqueue 92.59% (-7.41%) 👎
github.com/fgrosse/prioqueue/topk 100.00% (+54.17%) 🌟
Coverage details

Compared to base commit 067c0f9 (run #36055790830)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/fgrosse/prioqueue/max_heap.go 92.59% (-7.41%) 54 (+4) 50 4 (+4) 👎
github.com/fgrosse/prioqueue/min_heap.go 92.59% (-7.41%) 54 (+4) 50 4 (+4) 👎
github.com/fgrosse/prioqueue/topk/topk.go 100.00% (+54.17%) 24 24 (+13) 0 (-13) 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files:

  • github.com/fgrosse/prioqueue/topk/topk_test.go

fgrosse added a commit to fgrosse/go-coverage-report that referenced this pull request Sep 24, 2026
The screenshot shows the new layout of the details section including the
baseline commit and run. It was taken from fgrosse/prioqueue#6.
@fgrosse
fgrosse merged commit f0e3f7f into readme-screenshot-base Sep 24, 2026
2 checks passed
@fgrosse
fgrosse deleted the readme-screenshot branch September 24, 2026 20:50
fgrosse added a commit to fgrosse/go-coverage-report that referenced this pull request Oct 1, 2026
The screenshot shows the new layout of the details section including the
baseline commit and run. It was taken from fgrosse/prioqueue#6.
fgrosse added a commit to fgrosse/go-coverage-report that referenced this pull request Oct 1, 2026
…he report (#110)

* action: select the baseline by the PR base commit and explain it in the report

Previously, the baseline coverage was always taken from the first result of
"gh run list --limit=1" on the target branch. On busy repositories this API
can return stale runs, so reports compared against old code or claimed the
baseline artifact was unavailable even though a recent one existed.

The baseline run is now selected as follows:

1. The run given via the new "baseline-run-id" input, if set.
2. The latest successful run for the new "baseline-sha" input, which
   defaults to the base commit of the pull request.
3. The latest successful run on the target branch, as before.

The selected run is logged with its ID, commit and age. Warnings now
distinguish between no baseline run being found and the artifact of the
selected run not being downloadable.

The pull request comment shows a single line caution callout at the top if
the report does not compare against the base commit of the pull request.
The new -baseline-commit, -baseline-run-id and -baseline-run-url flags name
the baseline at the top of the details section, which is renamed to
"Coverage details" and no longer uses headings.

Fixes #109

* README: update screenshot of the coverage report comment

The screenshot shows the new layout of the details section including the
baseline commit and run. It was taken from fgrosse/prioqueue#6.

* action: only pass -baseline-* flags to binaries that support them

The action script now checks the usage of the installed binary before
passing the new -baseline-* flags. This keeps it working with older binaries,
e.g. when the "version" input is pinned to an older release or the action is
used from main before the default version is bumped.

Also label the baseline in the details section as "commit" instead of "base
commit", since it is not the base commit of the pull request after a fallback
or when using baseline-run-id.

* report: update test from #111 for the new details layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant