Skip to content

Commit 4fda28e

Browse files
cortinicofacebook-github-bot
authored andcommitted
Remove the "Newer Patch Available" logic from @react-native-bot (facebook#51286)
Summary: Pull Request resolved: facebook#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
1 parent 80eed4a commit 4fda28e

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

.github/workflow-scripts/actOnLabel.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ module.exports = async (github, context, labelWithContext) => {
9595
);
9696
await requestAuthorFeedback();
9797
return;
98-
case 'Newer Patch Available':
99-
await addComment(
100-
`> [!TIP]\n` +
101-
`> **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.`,
102-
);
103-
return;
10498
case 'Needs: Version Info':
10599
await addComment(
106100
`> [!WARNING]\n` +

.github/workflow-scripts/verifyVersion.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ module.exports = async (github, context) => {
4545
if (!isVersionSupported(issueVersion, latestVersion)) {
4646
return {label: 'Type: Unsupported Version'};
4747
}
48-
49-
// We want to encourage users to repro the issue on the highest available patch for the given minor.
50-
const latestPatchForVersion = getLatestPatchForVersion(
51-
issueVersion,
52-
recentReleases,
53-
);
54-
if (latestPatchForVersion > issueVersion.patch) {
55-
return {
56-
label: 'Newer Patch Available',
57-
newestPatch: `${issueVersion.major}.${issueVersion.minor}.${latestPatchForVersion}`,
58-
};
59-
}
6048
};
6149

6250
/**
@@ -87,22 +75,6 @@ function isVersionTooOld(actualVersion, latestVersion) {
8775
);
8876
}
8977

90-
// Assumes that releases are sorted in the order of recency (i.e. most recent releases are earlier in the list)
91-
// This enables us to stop looking as soon as we find the first release with a matching major/minor version, since
92-
// we know it's the most recent release, therefore the highest patch available.
93-
function getLatestPatchForVersion(version, releases) {
94-
for (releaseName of releases) {
95-
const release = parseVersionFromString(releaseName);
96-
if (
97-
release &&
98-
release.major == version.major &&
99-
release.minor == version.minor
100-
) {
101-
return release.patch;
102-
}
103-
}
104-
}
105-
10678
function getReactNativeVersionFromIssueBodyIfExists(issue) {
10779
if (!issue || !issue.body) return;
10880
const rnVersionRegex = /React Native Version[\r\n]+(?<version>.+)[\r\n]*/;

0 commit comments

Comments
 (0)