Skip to content

fix(release/auto-changelog): stop false left-out warnings, warn when the baseline restore drops entries, and stop quietly when a newer run supersedes this one - #309

Merged
HowardBraham merged 4 commits into
mainfrom
changelog-open-predecessor-pr
Nov 9, 2026

Conversation

@HowardBraham

@HowardBraham HowardBraham commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

Two problems showed up on real Mobile and Extension release changelog PRs (Extension #47669, Mobile #39043).

  • False "left out" warning. When an earlier release's changelog PR was still open, the release branch held an older section, so PRs the open PR already lists looked missing and the PR body said they were left out of the changelog.
  • Silent loss of entries. For a baseline that is not the target branch, the updater restores the whole CHANGELOG.md from the baseline. A stale baseline changelog (for example release/8.19.0 before its changelog PR merged) silently removed entries the release branch already listed under earlier versions (14 entries under [8.18.0] on Mobile).

What changes:

  • The earlier release's section is read from its open changelog PR branch, so the PRs it lists count as listed.
  • A warning names the versions and PR numbers of entries the baseline restore drops. An entry counts as kept when the restored version lists any of its PRs, so rewording is not reported.
  • When an existing PR's title and body are kept (a run with nothing new to proofread), the generated "left out" and "dropped entries" warnings are rebuilt from the current run, so a warning that is no longer true disappears. Only whole lines that match a generated warning are touched; text a reviewer added stays.
  • When the release branch moves while a run is generating, the run no longer fails if the push that moved it started its own run of the same workflow. That run publishes the changelog for the new tip, so this run logs a notice annotation and stops without publishing. If no such run is found, or the lookup fails, it fails as before. This is what happens when an OTA version bump lands during the creation push's run.
  • The proofreader model is updated from gpt-5.6-terra to gpt-6.1-terra.

Tested on the consensys-test/metamask-mobile-howard fork with stale and complete baselines, an open and a closed predecessor PR, OTA and native release branches, and a stale warning that cleared on rerun. The superseded-run stop was tested with two pushes to one release branch, the second made while the first run was generating: the first run ended green with the notice, and the second published the changelog. Unit tests: 171 pass.

References


Note

Medium Risk
Changes core release changelog generation and publication behavior, including when runs fail vs. stop quietly; mistakes could affect release PR content or miss real regressions.

Overview
Fixes several release changelog automation issues in update-release-changelog: false “left out” warnings, silent entry loss on baseline restore, stale PR warnings, and failures when the release branch moves mid-run.

Left-out PR detection now treats the earlier release’s section from its open changelog PR as listed, via getOpenBaselineChangelogSection and pendingSections on findPrsMissingFromChangelog.

Baseline restore compares the restored CHANGELOG.md to the release branch and surfaces dropped entries warnings (findEntriesDroppedByRestore, getDroppedEntriesWarning), treating reworded entries as kept when any PR number still appears.

Open changelog PR bodies get generated warnings refreshed or removed through refreshGeneratedWarnings, including when title/body are otherwise unchanged.

When the release branch moves during generation, the run exits with a notice instead of failing if hasWorkflowRunForSha finds another run of the same workflow for the new tip; otherwise behavior is unchanged.

Bumps the changelog proofreader model from gpt-5.6-terra to gpt-6.1-terra, with broad unit test coverage.

Reviewed by Cursor Bugbot for commit 0fae804. Bugbot is set up for automated code reviews on this repo. Configure here.

@HowardBraham HowardBraham self-assigned this Nov 9, 2026
@HowardBraham
HowardBraham force-pushed the changelog-open-predecessor-pr branch from 50de62c to df8628a Compare November 9, 2026 19:16
@HowardBraham
HowardBraham marked this pull request as ready for review November 9, 2026 19:16

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@HowardBraham
HowardBraham marked this pull request as draft November 9, 2026 19:29
…the baseline restore drops entries, and stop quietly when a newer run supersedes this one

Count the earlier release changelog PR before warning about left-out PRs, warn when restoring from the baseline drops entries the release branch lists, refresh stale generated warnings on a kept PR body, end a run that the release branch moved past without failing when the push that moved it started its own run, and use the gpt-6.1-terra proofreader model.
@HowardBraham HowardBraham changed the title fix(release/auto-changelog): stop false left-out warnings and warn when the baseline restore drops entries fix(release/auto-changelog): stop false left-out warnings, warn when the baseline restore drops entries, and stop quietly when a newer run supersedes this one Nov 9, 2026
@HowardBraham
HowardBraham force-pushed the changelog-open-predecessor-pr branch from 29a15b8 to e6fed94 Compare November 9, 2026 20:10
@HowardBraham
HowardBraham marked this pull request as ready for review November 9, 2026 20:10

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ac2f118. Configure here.

sleepytanya
sleepytanya previously approved these changes Nov 9, 2026
})
) {
// The kept body may carry warnings this run no longer raises.
const refreshedBody = refreshGeneratedWarnings({

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.

"already in sync" return at line 1969 exits before createOrUpdateChangelogPr runs, so this refresh is skipped whenever CHANGELOG.md does not change?

Left-out / dropped-entries warning that no longer holds stays on the pull request.
@HowardBraham

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ahah you found a bug, fixed now and pushed

@HowardBraham
HowardBraham merged commit 44686cc into main Nov 9, 2026
10 checks passed
@HowardBraham
HowardBraham deleted the changelog-open-predecessor-pr branch November 9, 2026 22:44
weitingsun pushed a commit to Poovarasan-Sandhanam/metamask-mobile that referenced this pull request Nov 10, 2026
…ow (MetaMask#39274)

## **Description**

Creating a `release/X.Y.Z-ota` branch starts two workflows in the same
second: `update-release-changelog.yml` (on push) and
`auto-create-release-pr.yml`, whose `create-release-pr.yml` also called
the changelog updater in its OTA path. Both updaters generate the same
changelog PR, so one of them loses the race. When the OTA step lost, its
job failed and "Create OTA release PR to stable" was skipped, so no
release PR to stable existed (observed on a fork with a delayed push
workflow).

This removes the updater call from the OTA path. The push workflow
already runs for the new branch, and again for the `OTA_VERSION` bump
push, so the changelog PR is still published.

Expect one thing to look different: the bump moves the branch while the
creation push's run may still be generating. With a released
github-tools that includes MetaMask/github-tools#309, that run ends
green with a `notice` annotation and the bump push's run publishes the
changelog. With older github-tools versions the creation push's run can
end red ("Target release branch ... changed during changelog
generation"). It is a different commit than the PR head, so the PR page
is not affected, and nothing is blocked.

Tested on a fork (`consensys-test/metamask-mobile-howard`) with this
workflow:
- A natural OTA creation: the auto run succeeded and created the OTA
release PR without calling the updater, and the bump push's run
published the changelog PR.
- A creation push run delayed by 40 s: both push runs succeeded.
- A manual dispatch when the OTA release PR already exists: the bump and
PR steps were skipped as before.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Refs: MetaMask/github-tools#309

## **Manual testing steps**

```gherkin
Feature: OTA release branch creation

  Scenario: a new OTA release branch is pushed
    Given a release/X.Y.Z-ota branch does not exist yet

    When the branch is created
    Then Auto Create Release PR creates the OTA release PR to stable
    And the Update Release Changelog PR workflow publishes the changelog PR
    And the "Update release changelog (OTA hotfix)" step no longer appears in the run
```

## **Screenshots/Recordings**

N/A, CI workflow change.

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> CI-only change that removes a redundant step; OTA release PR creation
and changelog generation remain covered by the existing push workflow.
> 
> **Overview**
> Fixes a race when **`release/X.Y.Z-ota`** is created:
**`update-release-changelog.yml`** (on push) and
**`create-release-pr.yml`** both invoked the changelog updater, so
duplicate changelog PRs competed and a failed updater run could skip
**Create OTA release PR to stable**.
> 
> The OTA path in **`create-release-pr.yml`** no longer runs **Update
release changelog (OTA hotfix)** or passes **`AI_ANALYZER_LITELLM_KEY`**
from **`auto-create-release-pr.yml`**. Changelog updates stay on the
push-triggered workflow (including after the **`OTA_VERSION`** bump
push).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ad2e4c7. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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