You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add automatic RN version checking workflow (#36075)
Summary:
Adding automatic RN version checking github workflow, which will verify the version of RN listed on all new issues filed in the repository.
Additionally, this change refactors the existing labeler workflow to make it re-usable by the version check workflow. The change also creates a logical place to add future automatic detection checks, like auto-verification of repro, template, etc.
This is technically not new functionality, as the react-native-bot does this _sometimes_, but this should be a lot more reliable.
The logic for valid release checking follows what is listed in the documentation - valid versions are current and N-2 minors, with the highest available patches.
## Changelog
[INTERNAL] [FIXED] - Made the automated RN version checking workflow more reliable
Pull Request resolved: #36075
Test Plan:
I have verified a variety of different versions on issues here: https://github.com/SlyCaptainFlint/react-native/issues
I have also re-verified all the tags that were previously handled by the labeler workflow, since I have refactored it. Please take a look at both the open and closed issues in the linked repo for examples.
Reviewed By: cortinico
Differential Revision: D43089150
Pulled By: SlyCaptainFlint
fbshipit-source-id: 7da67f5cb2a4875f22e1f9e46d7ca07d43f3e135
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/bug_report.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ body:
16
16
- type: input
17
17
id: version
18
18
attributes:
19
-
label: Version
20
-
description: What react-native version does this appear on? Bear in mind that only issues on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) will be looked into.
21
-
placeholder: ex. 0.70.0
19
+
label: React Native Version
20
+
description: What is the latest version of react-native that this issue reproduces on? Please only list the highest version you tested. Bear in mind that only issues on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) will be looked into.
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/new_architecture_bug_report.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ body:
21
21
- type: input
22
22
id: version
23
23
attributes:
24
-
label: Version
25
-
description: What react-native version does this appear on? Please test against the latest stable version. Bug reports against older versions are more likely to stall.
26
-
placeholder: ex. 0.68.0
24
+
label: React Native Version
25
+
description: What is the latest version of react-native that this issue reproduces on? Please test against the latest stable version, and list only the highest version you tested. Bug reports against older versions are more likely to stall.
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
+
*
4
+
* This source code is licensed under the MIT license found in the
5
+
* LICENSE file in the root directory of this source tree.
6
+
*
7
+
* @format
8
+
*/
9
+
10
+
module.exports=async(github,context,label)=>{
11
+
constcloseIssue=async()=>{
12
+
awaitgithub.rest.issues.update({
13
+
issue_number: context.issue.number,
14
+
owner: context.repo.owner,
15
+
repo: context.repo.repo,
16
+
state: 'closed',
17
+
});
18
+
};
19
+
20
+
constaddComment=asynccomment=>{
21
+
awaitgithub.rest.issues.createComment({
22
+
issue_number: context.issue.number,
23
+
owner: context.repo.owner,
24
+
repo: context.repo.repo,
25
+
body: comment,
26
+
});
27
+
};
28
+
29
+
constrequestAuthorFeedback=async()=>{
30
+
// Remove the triage label if it exists (ignore the 404 if not; it's not expected to always be there)
31
+
try{
32
+
awaitgithub.rest.issues.removeLabel({
33
+
issue_number: context.issue.number,
34
+
owner: context.repo.owner,
35
+
repo: context.repo.repo,
36
+
name: 'Needs: Triage :mag:',
37
+
});
38
+
}catch{}
39
+
40
+
awaitgithub.rest.issues.addLabels({
41
+
issue_number: context.issue.number,
42
+
owner: context.repo.owner,
43
+
repo: context.repo.repo,
44
+
labels: ['Needs: Author Feedback'],
45
+
});
46
+
};
47
+
48
+
switch(label){
49
+
case'Type: Invalid':
50
+
awaitaddComment(
51
+
`| :warning: | Issue is Invalid |\n`+
52
+
`| --- | --- |\n`+
53
+
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
54
+
);
55
+
awaitcloseIssue();
56
+
return;
57
+
case'Type: Question':
58
+
awaitaddComment(
59
+
`| :warning: | Issue is a Question |\n`+
60
+
`| --- | --- |\n`+
61
+
`| :information_source: | We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/). |`,
62
+
);
63
+
awaitcloseIssue();
64
+
return;
65
+
case'Type: Docs':
66
+
awaitaddComment(
67
+
`| :warning: | Documentation Issue |\n`+
68
+
`| --- | --- |\n`+
69
+
`| :information_source: | Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository. |`,
70
+
);
71
+
awaitcloseIssue();
72
+
return;
73
+
case'Resolution: For Stack Overflow':
74
+
awaitaddComment(
75
+
`| :warning: | Issue is a Question |\n`+
76
+
`| --- | --- |\n`+
77
+
`| :information_source: | We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. |`,
78
+
);
79
+
awaitcloseIssue();
80
+
return;
81
+
case'Type: Expo':
82
+
awaitaddComment(
83
+
`| :warning: | Issue is Related to Expo |\n`+
84
+
`| --- | --- |\n`+
85
+
`| :information_source: | It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open. |`,
86
+
);
87
+
awaitcloseIssue();
88
+
return;
89
+
case'Needs: Issue Template':
90
+
awaitaddComment(
91
+
`| :warning: | Missing Required Fields |\n`+
92
+
`| --- | --- |\n`+
93
+
`| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
94
+
);
95
+
awaitrequestAuthorFeedback();
96
+
return;
97
+
case'Needs: Environment Info':
98
+
awaitaddComment(
99
+
`| :warning: | Missing Environment Information |\n`+
100
+
`| --- | --- |\n`+
101
+
`| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
102
+
);
103
+
awaitrequestAuthorFeedback();
104
+
return;
105
+
case'Needs: Verify on Latest Version':
106
+
awaitaddComment(
107
+
`| :warning: | Newer Version of React Native is Available! |\n`+
108
+
`| --- | --- |\n`+
109
+
`| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available. 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. |`,
110
+
);
111
+
return;
112
+
case'Needs: Version Info':
113
+
awaitaddComment(
114
+
`| :warning: | Add or Reformat Version Info |\n`+
115
+
`| --- | --- |\n`+
116
+
`| :information_source: | We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2 |`,
117
+
);
118
+
awaitrequestAuthorFeedback();
119
+
return;
120
+
case'Needs: Repro':
121
+
awaitaddComment(
122
+
`| :warning: | Missing Reproducible Example |\n`+
123
+
`| --- | --- |\n`+
124
+
`| :information_source: | It looks like your issue is missing a reproducible example. Please provide a [Snack](https://snack.expo.dev) or a repository that demonstrates the issue you are reporting in a [minimal, complete, and reproducible](https://stackoverflow.com/help/minimal-reproducible-example) manner. |`,
125
+
);
126
+
awaitrequestAuthorFeedback();
127
+
return;
128
+
case'Type: Unsupported Version':
129
+
awaitaddComment(
130
+
`| :warning: | Unsupported Version of React Native |\n`+
131
+
`| --- | --- |\n`+
132
+
`| :information_source: | It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy). Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
body: `We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
body: `Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository.`,
56
-
})
57
-
await github.rest.issues.update({
58
-
issue_number: context.issue.number,
59
-
owner: context.repo.owner,
60
-
repo: context.repo.repo,
61
-
state: "closed",
62
-
})
63
-
resolution-for-stack-overflow:
64
-
runs-on: ubuntu-latest
65
-
if: "${{ contains(github.event.label.name, 'Resolution: For Stack Overflow') }}"
66
-
steps:
67
-
- uses: actions/github-script@v6
68
-
with:
69
-
script: |
70
-
await github.rest.issues.createComment({
71
-
issue_number: context.issue.number,
72
-
owner: context.repo.owner,
73
-
repo: context.repo.repo,
74
-
body: `We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question.`,
| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
body: `| :warning: | Missing Environment Information |
115
-
| --- | --- |
116
-
| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
117
-
})
118
-
await github.rest.issues.addLabels({
119
-
issue_number: context.issue.number,
120
-
owner: context.repo.owner,
121
-
repo: context.repo.repo,
122
-
labels: ['Needs: Author Feedback']
123
-
})
124
-
needs-verify-on-latest-version:
125
-
runs-on: ubuntu-latest
126
-
if: "${{ contains(github.event.label.name, 'Needs: Verify on Latest Version') }}"
127
-
steps:
128
-
- uses: actions/github-script@v6
129
-
with:
130
-
script: |
131
-
await github.rest.issues.createComment({
132
-
issue_number: context.issue.number,
133
-
owner: context.repo.owner,
134
-
repo: context.repo.repo,
135
-
body: `| :warning: | Using Old Version |
136
-
| --- | --- |
137
-
| :information_source: | It looks like you are using an older version of React Native. Please [upgrade](https://reactnative.dev/docs/upgrading) to the latest version, and verify if the issue persists. If it does not, 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 current release. |`,
body: `| :warning: | Missing Reproducible Example |
157
-
| --- | --- |
158
-
| :information_source: | It looks like your issue is missing a reproducible example. Please provide a [Snack](https://snack.expo.dev) or a repository that demonstrates the issue you are reporting in a [minimal, complete, and reproducible](https://stackoverflow.com/help/minimal-reproducible-example) manner. |`,
body: `It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy). Due to the amount of issues we receive, we're currently accepting only new issues against one of the supported version. Please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
body: `It looks like your issue is related to Expo and not React Native core. Please open your issue on an [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.`,
0 commit comments