Skip to content

fix(version-dispatch): clear preview comment on every gated early-return#83

Merged
sparten11740 merged 1 commit into
masterfrom
egor/version-dispatch-clear-preview-on-skip
May 13, 2026
Merged

fix(version-dispatch): clear preview comment on every gated early-return#83
sparten11740 merged 1 commit into
masterfrom
egor/version-dispatch-clear-preview-on-skip

Conversation

@exo-egor

@exo-egor exo-egor commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

After #82, the action posts a sticky `Version preview` comment on every open-PR run. if a PR's preview comment has been posted and someone later adds `skip-release` (or retargets the base), the action returns early without touching the comment, so reviewers are left with a stale "this PR will release X" message on a PR that no longer will.

This PR routes every preview-mode early-return through a new `clearVersionPreview` helper that deletes any prior preview comment by HTML marker before returning.

Paths covered

  • excluded label (`skip-release` / `publish-on-merge` / any in the workflow's `exclude-labels` input)
  • PR base retargeted off the default branch
  • no workspace packages discovered (e.g. monorepo restructured under the PR)

Tests

  • 160/160 (was 158, +2 new): one for the excluded-label transition, one for the base-branch retarget.

Required workflow change for consumers

For the new cleanup to actually fire when someone adds the label mid-flight, the consuming workflow needs:

  1. `pull_request: [labeled, unlabeled, ...]` in the trigger types (so the workflow runs on label changes).
  2. The workflow's `if:` should not filter on excluded labels (let the action's `exclude-labels` input handle it — that's the path that runs cleanup).

Hydra's consuming PR is being updated to match.

When an open PR transitions into a gated state mid-flight — someone
adds a \`skip-release\` label, retargets the base off the default
branch, or the workspace map suddenly returns empty — the action
used to return early without touching any prior preview comment, so
the stale "Version preview" comment lingered on the PR.

Route every preview-mode early-return through the new
\`clearVersionPreview\` helper which deletes any prior preview
comment by marker. Adds two integration tests covering the
\`skip-release\` and non-default-branch transitions.

160/160 tests passing.
@exo-egor exo-egor requested a review from exo-mv May 12, 2026 20:52

@sparten11740 sparten11740 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@sparten11740 sparten11740 merged commit e259b23 into master May 13, 2026
2 checks passed
@sparten11740 sparten11740 deleted the egor/version-dispatch-clear-preview-on-skip branch May 13, 2026 07:39
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.

3 participants