From 4fda28ee4c427ebc09ba730fd13e180f59380a55 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 13 May 2025 10:38:05 -0700 Subject: [PATCH] Remove the "Newer Patch Available" logic from @react-native-bot (#51286) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51286 This bog action is not really useful. It's currently buggy and spams the user twice + we agreed it provide little value for the user. Therefore we're removing this message for the time being. Changelog: [Internal] [Changed] - Reviewed By: cipolleschi Differential Revision: D74645716 fbshipit-source-id: a6b8aa6aa3f3f101ad649d2590bbcb2dc80ee30a --- .github/workflow-scripts/actOnLabel.js | 6 ----- .github/workflow-scripts/verifyVersion.js | 28 ----------------------- 2 files changed, 34 deletions(-) diff --git a/.github/workflow-scripts/actOnLabel.js b/.github/workflow-scripts/actOnLabel.js index d992c421576..497bb1129fe 100644 --- a/.github/workflow-scripts/actOnLabel.js +++ b/.github/workflow-scripts/actOnLabel.js @@ -95,12 +95,6 @@ module.exports = async (github, context, labelWithContext) => { ); await requestAuthorFeedback(); return; - case 'Newer Patch Available': - await addComment( - `> [!TIP]\n` + - `> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`, - ); - return; case 'Needs: Version Info': await addComment( `> [!WARNING]\n` + diff --git a/.github/workflow-scripts/verifyVersion.js b/.github/workflow-scripts/verifyVersion.js index 5f51adff75e..936b55831d3 100644 --- a/.github/workflow-scripts/verifyVersion.js +++ b/.github/workflow-scripts/verifyVersion.js @@ -45,18 +45,6 @@ module.exports = async (github, context) => { if (!isVersionSupported(issueVersion, latestVersion)) { return {label: 'Type: Unsupported Version'}; } - - // We want to encourage users to repro the issue on the highest available patch for the given minor. - const latestPatchForVersion = getLatestPatchForVersion( - issueVersion, - recentReleases, - ); - if (latestPatchForVersion > issueVersion.patch) { - return { - label: 'Newer Patch Available', - newestPatch: `${issueVersion.major}.${issueVersion.minor}.${latestPatchForVersion}`, - }; - } }; /** @@ -87,22 +75,6 @@ function isVersionTooOld(actualVersion, latestVersion) { ); } -// Assumes that releases are sorted in the order of recency (i.e. most recent releases are earlier in the list) -// This enables us to stop looking as soon as we find the first release with a matching major/minor version, since -// we know it's the most recent release, therefore the highest patch available. -function getLatestPatchForVersion(version, releases) { - for (releaseName of releases) { - const release = parseVersionFromString(releaseName); - if ( - release && - release.major == version.major && - release.minor == version.minor - ) { - return release.patch; - } - } -} - function getReactNativeVersionFromIssueBodyIfExists(issue) { if (!issue || !issue.body) return; const rnVersionRegex = /React Native Version[\r\n]+(?.+)[\r\n]*/;