Skip to content

fix(ci): re-run PR size check on base retarget - #33868

Merged
NicolasMassart merged 3 commits into
mainfrom
fix/ci-change-size-workflow-size-error
Jul 28, 2026
Merged

fix(ci): re-run PR size check on base retarget#33868
NicolasMassart merged 3 commits into
mainfrom
fix/ci-change-size-workflow-size-error

Conversation

@NicolasMassart

@NicolasMassart NicolasMassart commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

check-pr-max-lines could report a stale/incorrect size label (e.g. size-XL) after a stacked PR was rebased onto main and its base branch retargeted. The workflow only re-ran on opened | reopened | synchronize, so a base change alone never triggered a fresh check against the new base.

This adds edited to the pull_request trigger types, gated so the job only re-runs for base-branch edits (github.event.changes.base != null), not unrelated title/body edits.

Related fix in the shared pr-line-check action (resolves the live PR base instead of trusting the webhook payload): MetaMask/github-tools#273

Changelog

CHANGELOG entry: null

Related issues

Refs: MCWP-747

Manual testing steps

Feature: PR size check re-runs on base retarget

  Scenario: a stacked PR is rebased onto main and its base is retargeted
    Given a PR is stacked on another branch and the size check has already passed
    When the PR head is rebased onto main and the PR base is retargeted to main
    Then the check-pr-max-lines check re-runs and reports the correct size label against main

Screenshots/Recordings

N/A - CI workflow change, no UI impact.

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

N/A - CI workflow-only change, no app runtime impact.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
CI trigger-only change with no app, auth, or data impact; edited may also run the job on title/body edits.

Overview
check-pr-max-lines now listens for pull_request edited in addition to opened, reopened, and synchronize.

That lets the shared pr-line-check action run again when a PR is updated without a new push—e.g. after retargeting the base branch following a rebase—so size labels reflect the diff against the current base instead of staying stale.

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

… job conditions. The workflow now responds to pull request edits while ensuring it only re-runs for relevant changes to the base branch.

Signed-off-by: Nicolas MASSART <nicolas.massart@consensys.net>
@NicolasMassart NicolasMassart self-assigned this Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 27, 2026
@metamask-ci metamask-ci Bot added team-mobile-platform Mobile Platform team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jul 27, 2026
@metamask-ci

metamask-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has only 5 of the required 8 items. Every checklist row must be present and consciously checked — do not delete rows.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@metamask-ci

metamask-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-project-automation github-project-automation Bot moved this to Needs dev review in PR review queue Jul 27, 2026
@metamask-ci metamask-ci Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jul 27, 2026
@NicolasMassart NicolasMassart added Code Impact - Low Minor code change that can safely applied to the codebase INVALID-PR-TEMPLATE PR's body doesn't match template skip-e2e skip E2E test jobs and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Jul 27, 2026
@metamask-ci metamask-ci Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jul 27, 2026
@NicolasMassart
NicolasMassart marked this pull request as ready for review July 27, 2026 17:19
@NicolasMassart
NicolasMassart requested a review from a team as a code owner July 27, 2026 17:19
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 27, 2026

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes 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 0891e2d. Configure here.

Comment thread .github/workflows/check-pr-max-lines.yml Outdated
NicolasMassart and others added 2 commits July 27, 2026 19:25
A job-level `if` skipping non-base edits still posts a `skipped` check
run for the same head SHA, which GitHub treats as authoritative and can
silently clear a prior oversized-PR failure. Always recomputing avoids
that risk since the diff calculation is cheap.

Co-authored-by: Cursor <cursoragent@cursor.com>
The comment explained a job-level if condition that was already
removed in a prior commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@NicolasMassart
NicolasMassart enabled auto-merge July 28, 2026 15:10
@NicolasMassart
NicolasMassart added this pull request to the merge queue Jul 28, 2026
@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Jul 28, 2026
Merged via the queue into main with commit f9fe924 Jul 28, 2026
121 checks passed
@NicolasMassart
NicolasMassart deleted the fix/ci-change-size-workflow-size-error branch July 28, 2026 16:36
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Jul 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 28, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Code Impact - Low Minor code change that can safely applied to the codebase release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:low AI analysis: low risk size-XS skip-e2e skip E2E test jobs team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants