Skip to content

feat(go-ci): add coverage-title input for sticky-comment heading#3

Merged
monsieurleberre merged 1 commit into
devfrom
feat/coverage-title-tf-go
May 27, 2026
Merged

feat(go-ci): add coverage-title input for sticky-comment heading#3
monsieurleberre merged 1 commit into
devfrom
feat/coverage-title-tf-go

Conversation

@monsieurleberre

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new coverage-title input (string, default Go coverage) to go-ci.yaml and a "Prepend coverage title" step that injects a visible H2 heading onto code-coverage-results.md before the existing marocchino/sticky-pull-request-comment step picks it up — so a reader can tell the language at a glance when multiple coverage sticky comments coexist on the same PR. Step is gated by steps.discover.outputs.found == 'true' (same gate the surrounding coverage steps use) and loud-fails (echo "::error::…"; exit 1) if code-coverage-results.md is missing.
  • terraform-ci.yaml intentionally NOT changed — it has no coverage chain (no irongut/CodeCoverageSummary step, no code-coverage-results.md); only a separate test-summary.md sticky comment. Per scope, this PR does not fabricate a coverage chain there. terraform-ci can get its own test-summary-title later if desired, but that's a different shape and a different PR.

Test plan

  • actionlint v1.7.7 runs clean on .github/workflows/go-ci.yaml (verified locally).
  • On a downstream consumer PR that calls go-ci.yaml, confirm the sticky coverage comment is prefixed by ## Go coverage (or a caller-overridden title) and that the existing go-coverage dedup header still de-duplicates correctly.
  • Confirm overriding coverage-title: from the caller produces the override at the top of the comment.
  • Confirm the step fails loudly (not silently) if a future change breaks irongut's output path.

Related

Both are still open as of this PR's creation; README documentation for coverage-title will follow once those land, to avoid three-way conflicts on README.md.

Brings go-ci.yaml onto the same shape as csharp-ci (PR #1) and
scala-ci (PR #2): a visible H2 heading is prepended to the rendered
coverage markdown before the sticky-comment step picks it up, so a
reader can tell the language at a glance when multiple coverage
sticky comments coexist on the same PR.

Default `coverage-title` is "Go coverage". The new "Prepend coverage
title" step runs after the existing "Augment coverage report with
cyclomatic complexity" step (which mutates `code-coverage-results.md`
in place) so the H2 ends up at the top of the final file, and loud-
fails if `code-coverage-results.md` is missing — mirroring the
pattern landed in csharp-ci / scala-ci.

terraform-ci.yaml is intentionally NOT changed: it has no coverage
chain (no `irongut/CodeCoverageSummary` step, no
`code-coverage-results.md`), only a separate `test-summary.md`
sticky comment. Adding `coverage-title` there would mean fabricating
a coverage chain, which is out of scope for this PR.

PR #1 (csharp-ci) and PR #2 (scala-ci) are still open. README
updates documenting `coverage-title` will follow once those land,
to avoid three-way conflicts on README.md.
@monsieurleberre monsieurleberre enabled auto-merge (squash) May 27, 2026 07:59
@monsieurleberre monsieurleberre merged commit 9eed48c into dev May 27, 2026
1 check passed
@monsieurleberre monsieurleberre deleted the feat/coverage-title-tf-go branch May 27, 2026 07:59
monsieurleberre added a commit that referenced this pull request May 27, 2026
Brings terraform-ci.yaml onto the same shape as csharp-ci (PR #1),
scala-ci (PR #2), and go-ci (PR #3): a visible H2 heading is prepended
to the rendered test-summary markdown before the sticky-comment step
picks it up, so a reader can tell which workspace each sticky comment
covers at a glance when multiple sticky comments coexist on the same
PR.

The input name, env-var name, step name, and description wording mirror
csharp-ci / scala-ci / go-ci verbatim — coverage-title / COVERAGE_TITLE
/ "Prepend coverage title" — for cross-workflow consistency. The
default is 'Terraform coverage'.

The new "Prepend coverage title" step runs immediately after "Build
test summary", gates on the same condition the surrounding test-summary
chain uses (always() && steps.tests.outputs.ran == 'true'), and
loud-fails (::error:: + exit 1) if test-summary.md is missing —
mirroring the pattern landed in csharp-ci / scala-ci / go-ci.

coverage-title flows into the shell via env: indirection, not direct
${{ }} interpolation in run:.
monsieurleberre added a commit that referenced this pull request May 27, 2026
…ng (#4)

Brings terraform-ci.yaml onto the same shape as csharp-ci (PR #1),
scala-ci (PR #2), and go-ci (PR #3): a visible H2 heading is prepended
to the rendered test-summary markdown before the sticky-comment step
picks it up, so a reader can tell which workspace each sticky comment
covers at a glance when multiple sticky comments coexist on the same
PR.

The input name, env-var name, step name, and description wording mirror
csharp-ci / scala-ci / go-ci verbatim — coverage-title / COVERAGE_TITLE
/ "Prepend coverage title" — for cross-workflow consistency. The
default is 'Terraform coverage'.

The new "Prepend coverage title" step runs immediately after "Build
test summary", gates on the same condition the surrounding test-summary
chain uses (always() && steps.tests.outputs.ran == 'true'), and
loud-fails (::error:: + exit 1) if test-summary.md is missing —
mirroring the pattern landed in csharp-ci / scala-ci / go-ci.

coverage-title flows into the shell via env: indirection, not direct
${{ }} interpolation in run:.
@monsieurleberre monsieurleberre mentioned this pull request May 27, 2026
6 tasks
monsieurleberre added a commit that referenced this pull request May 27, 2026
Promote four merged feature PRs into a tagged 1.1.0 section:

- #2 scala-ci.yaml — new reusable sbt/Scala workflow
- #1 csharp-ci.yaml — migrated to xUnit v3 + Microsoft.Testing.Platform
- #3 go-ci.yaml — new coverage-title input
- #4 terraform-ci.yaml — new coverage-title input

Tagging (v1.1.0 + floating v1) follows on the merge commit per
CONTRIBUTING.md.
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.

2 participants