Skip to content

ci: post coverage after merge and compare against main - #15

Merged
SamElhagDev merged 1 commit into
mainfrom
ci/coverage-after-merge
Nov 29, 2026
Merged

SamElhagDev merged 1 commit into
mainfrom
ci/coverage-after-merge

Conversation

@SamElhagDev

Copy link
Copy Markdown
Owner

The coverage comment now covers a pull request from open to merged, for every merge style.

While the PR is open: the existing Coverage comment, updated in place on every push, now has a vs main column, the change against the latest coverage of main.

After it merges: CI on the commit that lands on main adds a Coverage after merge comment to the merged PR, compared with main before the merge. The workflow finds the PR whose merge_commit_sha is that commit, which is:

Merge style Commit on main that CI runs on
Merge commit the merge commit
Squash the squashed commit
Rebase the last rebased commit

Before this, the push to main skipped the comment, so a PR never showed what actually landed (#12 is the example).

Changes

  • ci.yml: on pushes to main, keep Summary.json as a main-coverage artifact (90 days). That artifact is the baseline for the comparison.
  • coverage-comment.yml: handles both cases. The security model is unchanged: it runs from main, never checks out PR code, checks the PR number against the run's commit, and builds the comment from numbers only.
  • README: describes both comments.

Testing: both scripts were syntax-checked and dry-run against a real Summary.json with a mocked API, which confirmed that the open-PR comment updates in place and the merged comment is a separate one.

A workflow_run workflow always runs from main, so this PR still gets the old-style comment. Its own merge is the first real run of the new one: it will post "Coverage after merge" here, and because no main-coverage artifact exists yet, that comment will have no comparison column. From the next PR on, the comparison column appears.

No release needed: this changes CI only.

@github-actions

Copy link
Copy Markdown

Coverage

Covered
Lines 573 of 713 80.3%
Branches 129 of 180 71.6%
Least-covered classes
Class Lines Line coverage
samelhag.dev.Components.Pages.Error 0 of 6 0.0%
samelhag.dev.Services.ContactLog 4 of 88 4.5%
samelhag.dev.Services.SmtpMailSender 2 of 8 25.0%
samelhag.dev.Components.Pages.Contact 15 of 56 26.7%
samelhag.dev.Components.Shared.Icon 5 of 6 83.3%
samelhag.dev.Components.Pages.About 80 of 82 97.5%
Program 22 of 22 100.0%
samelhag.dev.Components.App 24 of 24 100.0%
samelhag.dev.Components.Layout.MainLayout 2 of 2 100.0%
samelhag.dev.Components.Layout.NavMenu 3 of 3 100.0%
samelhag.dev.Components.Layout.SiteFooter 7 of 7 100.0%
samelhag.dev.Components.Layout.SiteTheme 60 of 60 100.0%
samelhag.dev.Components.Pages.Home 20 of 20 100.0%
samelhag.dev.Components.Pages.Interests 20 of 20 100.0%
samelhag.dev.Components.Pages.Projects 2 of 2 100.0%

For 7cfa655. Full report in the CI run summary.

@SamElhagDev
SamElhagDev merged commit af8d9ce into main Nov 29, 2026
1 check passed
@SamElhagDev
SamElhagDev deleted the ci/coverage-after-merge branch November 29, 2026 23:18
@github-actions

Copy link
Copy Markdown

Coverage after merge

Covered
Lines 573 of 713 80.3%
Branches 129 of 180 71.6%
Least-covered classes
Class Lines Line coverage
samelhag.dev.Components.Pages.Error 0 of 6 0.0%
samelhag.dev.Services.ContactLog 4 of 88 4.5%
samelhag.dev.Services.SmtpMailSender 2 of 8 25.0%
samelhag.dev.Components.Pages.Contact 15 of 56 26.7%
samelhag.dev.Components.Shared.Icon 5 of 6 83.3%
samelhag.dev.Components.Pages.About 80 of 82 97.5%
Program 22 of 22 100.0%
samelhag.dev.Components.App 24 of 24 100.0%
samelhag.dev.Components.Layout.MainLayout 2 of 2 100.0%
samelhag.dev.Components.Layout.NavMenu 3 of 3 100.0%
samelhag.dev.Components.Layout.SiteFooter 7 of 7 100.0%
samelhag.dev.Components.Layout.SiteTheme 60 of 60 100.0%
samelhag.dev.Components.Pages.Home 20 of 20 100.0%
samelhag.dev.Components.Pages.Interests 20 of 20 100.0%
samelhag.dev.Components.Pages.Projects 2 of 2 100.0%

For af8d9ce on main. Full report in the CI run summary. No earlier coverage of main to compare with.

@SamElhagDev SamElhagDev mentioned this pull request Nov 30, 2026
SamElhagDev added a commit that referenced this pull request Nov 30, 2026
Release **1.0.2**: `<Version>1.0.2</Version>` and a `CHANGELOG.md`
entry.

This is also the first real run of `release-draft.yml`. When this
merges, a **draft** `v1.0.2` should appear on the merged commit with the
1.0.2 notes. Publishing that draft deploys it.

Changes since 1.0.1 (release tooling only, nothing visitors see):
- #16 drafts the GitHub Release automatically when a version merges.
- #15 adds a coverage comment after merge, and a comparison with `main`.
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