Skip to content

test(ci): regression tests for the publish.yml release gates - #189

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-publish-workflow
Oct 8, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-publish-workflow

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds .github/tests/publish.test.cjs (12 tests) so the five inline shell gates in publish.yml are regression-tested on every PR, the same way auto-release.test.cjs and changelog-guard.test.cjs already cover their workflows:

  • tag ↔ package.json version — match passes (incl. prerelease); mismatch exits 1 with the exact ::error:: bump hint
  • tag commit on main — bare origin + clone fixture; main tip and older main commits pass, an unmerged side-branch commit fails with the SHA in the error. The local origin/main ref is deleted first so the script's own git fetch is what's under test
  • CHANGELOG section gate — nonempty section passes and the extracted notes are byte-exact; missing / whitespace-only / prefix-colliding (## 0.12.01) / empty-dated sections fail. Exact heading without date and prerelease versions extract correctly
  • release-notes extraction — same cases for the release job step, plus an assertion that both steps use the identical awk program so they can't drift apart
  • idempotent gh release create — stubbed gh records argv; existing release → no create and the "already exists" notice; missing release → create v0.12.0 --verify-tag --title v0.12.0 --notes-file release-notes.md
  • job wiring — verify-tag → test → publish → release needs: chain and npm ci --ignore-scripts in the OIDC job

Mutation-verified locally: flipping the --is-ancestor negation, dropping --verify-tag, or loosening the [^[:space:]] grep each makes the suite fail.

The changelog gate writes to a fixed /tmp/release-notes.md; the test substitutes a per-run temp path (and asserts the literal appears exactly twice) so parallel runs don't clobber each other. No workflow or CHANGELOG change: CI's existing node --test .github/tests/*.test.cjs step picks the file up, and .github/tests/ is exempt from the changelog guard.

Closes #188


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Extract the five run blocks from publish.yml and exercise each under bash
against throwaway fixtures, mirroring auto-release.test.cjs and
changelog-guard.test.cjs: tag/package.json version match, main ancestry
via a bare origin + clone, the CHANGELOG section gate and release-notes
extraction (including prefix-colliding headings), and the idempotent
gh release create with a stubbed gh. Also pins the verify-tag -> test ->
publish -> release needs chain and npm ci --ignore-scripts.

No workflow edit needed: CI already runs node --test .github/tests/*.test.cjs.

Signed-off-by: quality <quality@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 8, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 8, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 5595ea8 into main Oct 8, 2026
12 of 13 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-publish-workflow branch October 8, 2026 03:39
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] publish.yml release gates have no workflow regression tests

0 participants