Skip to content

chore(automation): merge changelogs PR when draft release is created - #2540

Merged
r0b1n merged 1 commit into
mainfrom
r0b1n/release-process
Nov 18, 2026
Merged

r0b1n merged 1 commit into
mainfrom
r0b1n/release-process

Conversation

@r0b1n

@r0b1n r0b1n commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Pull request type

No code changes (changes to documentation, CI, metadata, etc.)


Why

We never adjust a release once its draft is ready, yet the version bump / changelog PR stays open until Marketplace publish, which is days later because of OSS clearance. Meanwhile main has the old version and other PRs can conflict with the bump.

What changed

  • Create draft release now merges the changelogs PR right after the draft is created, before OSS clearance.
  • rui-merge-changelogs-pr finds the PR by head branch (tmp/<tag>, then <tag>-update-changelog). A draft release has no git tag yet, so the old tag lookup returns 404 at that point. The tag lookup stays as a fallback.
  • The merge doesn't wait for PR checks. The allowed-files check (CHANGELOG.md, package.json, package.xml) stays. The script retries HTTP 405 (mergeability not computed yet for a just-opened PR) up to 6 times, 10s apart.
  • The release-widget skill checks the PR is merged before OSS clearance.

Scope

automation/utils, CreateGitHubRelease.yml, PublishMarketplace.yml, release-widget skill. No widget or shared package changes, so no changelog.

Tradeoffs

  • Not waiting for checks: main has no required status check, the checks are meaningless for a metadata-only PR, and flaky tests would leave a release stuck. GitHub auto-merge was rejected for the same reason.
  • Abandoned draft: main already carries the version and its changelog section, so the same version can't be re-cut. The skill says to release the next patch instead. Re-cutting would need extra logic in rui-bump-version and the changelog update, which isn't worth it for a rare case.
  • Changelog date: it is now the draft date rather than the publish date.

Blast radius

None outside the release automation. The change is safe because of these facts:

  • The new step can't break draft creation. It runs after the draft release is created. If it fails, the workflow turns red and the draft is still there.
  • The lookup finds the PR for a draft. Ran against the current draft tooltip-web-v1.6.0:
    BASE   tag lookup -> throws: Fetching Failed (Code 404). Not Found
    CHANGE branch lookup -> #2539 open tmp/tooltip-web-v1.6.0
    
  • Both trigger paths are covered. The release-widget skill runs the workflow on tmp/<tag>. rui-prepare-release triggers it on its own branch, which rui-create-gh-release turns into <tag>-update-changelog. The lookup tries both names.
  • The publish-time fallback does nothing once merged. A non-open PR exits 0 with "already closed. Skipping." (walked, not run). The branch lookup returns merged PRs too (checked: tmp/data-widgets-v3.11.9 → Data Widgets v3.11.9: Update changelog #2510, closed).
  • No other callers. getPRByReleaseTag and mergePR are only used by rui-merge-changelogs-pr. MergePRError extends Error, so existing handling is unchanged.

Verification

  • automation/utils: tsc --noEmit, lint (no new warnings) and pnpm run test (16/16) pass.
  • Tag build in the workflow step gives data-widgets-v3.11.9 for the current data-widgets.
  • Unproven until the next real release: the actual merge call. After Create draft release finishes, the tmp/<tag> PR should be merged and main should carry the new version before OSS clearance is requested.

@github-actions

This comment has been minimized.

@r0b1n
r0b1n force-pushed the r0b1n/release-process branch from d4ff84c to e45ac4d Compare November 18, 2026 14:32
@github-actions

Copy link
Copy Markdown
Contributor

AI Code Review

✅ Approved — no issues found


What was reviewed

File Change
.github/workflows/CreateGitHubRelease.yml New Merge changelogs PR step after the draft release is created. The tag is built from the package name and package.json version.
.github/workflows/PublishMarketplace.yml Comment marking the merge step as a fallback. Whitespace-only YAML formatting change.
automation/utils/bin/rui-merge-changelogs-pr.ts Finds the PR by head branch (tmp/<tag>, then <tag>-update-changelog) with the tag lookup as fallback. Retries merge on HTTP 405.
automation/utils/src/github.ts Adds getPRByHeadBranch and a MergePRError that carries the HTTP status.
.agents/skills/release-widget/SKILL.md Phase 3 now checks that the PR is merged. Adds guidance for an abandoned draft. The Phase 5 check is simplified.

Skipped (out of scope): none.

CI: pending: sigridci, code/snyk · unrelated failures: security/snyk (this PR changes no dependencies or app code)


Positives

  • The lookup change fits how draft releases work: no git tag exists yet, and the branch names mirror resolveChangelogBranch in rui-create-gh-release.
  • The allowed-files check stays in front of the unattended merge. Retries cover only the 405 "mergeability not computed yet" case, which is narrow.
  • The PR description's tradeoffs section is clear about not waiting for checks and about the abandoned-draft case. The PublishMarketplace fallback stays a no-op once the PR is merged.

@yordan-st yordan-st left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice one!

Merge the version bump/changelog PR right after the draft release is
created instead of after Marketplace publish, so main gets the new
version before OSS clearance starts. The PR is looked up by its head
branch (draft releases have no git tag yet) and merged without waiting
for checks. The publish-time merge step stays as a no-op fallback.
@r0b1n
r0b1n merged commit 8f68565 into main Nov 18, 2026
20 of 21 checks passed
@r0b1n
r0b1n deleted the r0b1n/release-process branch November 18, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants