Skip to content

Commit d8c4c29

Browse files
author
Brian Vaughn
committed
Added new GitHub issue form for React DevTools bug reports
1 parent bd070eb commit d8c4c29

File tree

8 files changed

+109
-39
lines changed

8 files changed

+109
-39
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "DevTools bug report"
2+
description: "Report a problem with React DevTools"
3+
title: "[DevTools Bug]: "
4+
labels: ["Component: Developer Tools", "Type: Bug", "Status: Unconfirmed"]
5+
body:
6+
- type: input
7+
attributes:
8+
label: Website or app
9+
description: |
10+
Which website or app were you using when the bug happened?
11+
placeholder: |
12+
e.g. website URL, public GitHub repo, or Code Sandbox app
13+
validations:
14+
required: true
15+
- type: textarea
16+
attributes:
17+
label: Repro steps
18+
description: |
19+
What were you doing on the website or app when the bug happened? Detailed information helps maintainers reproduce and fix bugs.
20+
21+
Issues filed without repro steps may be closed.
22+
placeholder: |
23+
Example bug report:
24+
1. Log in with username/password
25+
2. Click "Messages" on the left menu
26+
3. Open any message in the list
27+
validations:
28+
required: true
29+
- type: dropdown
30+
attributes:
31+
label: How often does this bug happen?
32+
description: |
33+
Following the repro steps above, how easily are you able to reproduce this bug?
34+
options:
35+
- Every time
36+
- Often
37+
- Sometimes
38+
- Only once
39+
validations:
40+
required: true
41+
- type: input
42+
id: automated_package
43+
attributes:
44+
label: DevTools package (automated)
45+
description: |
46+
Please do not edit this field.
47+
- type: input
48+
id: automated_version
49+
attributes:
50+
label: DevTools version (automated)
51+
description: |
52+
Please do not edit this field.
53+
- type: input
54+
id: automated_error_message
55+
attributes:
56+
label: Error message (automated)
57+
description: |
58+
Please do not edit this field.
59+
- type: textarea
60+
id: automated_call_stack
61+
attributes:
62+
label: Error call stack (automated)
63+
description: |
64+
Please do not edit this field.
65+
render: text
66+
- type: textarea
67+
id: automated_component_stack
68+
attributes:
69+
label: Error component stack (automated)
70+
description: |
71+
Please do not edit this field.
72+
render: text
73+
- type: input
74+
id: automated_github_query_string
75+
attributes:
76+
label: GitHub query string (automated)
77+
description: |
78+
Please do not edit this field.

packages/react-devtools-core/webpack.backend.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = {
5454
__EXTENSION__: false,
5555
__PROFILE__: false,
5656
__TEST__: NODE_ENV === 'test',
57+
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-core"`,
5758
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
5859
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
5960
}),

packages/react-devtools-core/webpack.standalone.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = {
5454
__EXTENSION__: false,
5555
__PROFILE__: false,
5656
__TEST__: NODE_ENV === 'test',
57+
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-core"`,
5758
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
5859
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
5960
'process.env.NODE_ENV': `"${NODE_ENV}"`,

packages/react-devtools-extensions/webpack.backend.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = {
5151
__DEV__: true,
5252
__PROFILE__: false,
5353
__EXPERIMENTAL__: true,
54+
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
5455
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
5556
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
5657
}),

packages/react-devtools-extensions/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module.exports = {
5858
__EXTENSION__: true,
5959
__PROFILE__: false,
6060
__TEST__: NODE_ENV === 'test',
61+
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-extensions"`,
6162
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
6263
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
6364
'process.env.NODE_ENV': `"${NODE_ENV}"`,

packages/react-devtools-inline/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = {
5252
__EXTENSION__: false,
5353
__PROFILE__: false,
5454
__TEST__: NODE_ENV === 'test',
55+
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-inline"`,
5556
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
5657
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
5758
'process.env.NODE_ENV': `"${NODE_ENV}"`,

packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ReportNewIssue.js

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ import {searchGitHubIssuesURL} from './githubAPI';
1313
import styles from './shared.css';
1414

1515
function encodeURIWrapper(string: string): string {
16-
return encodeURI(string).replace(/#/g, '%23');
16+
return encodeURI(string).replace(/\n/g, '%0A');
1717
}
1818

19+
const LABELS = [
20+
'Component: Developer Tools',
21+
'Type: Bug',
22+
'Status: Unconfirmed',
23+
];
24+
25+
// This must match the filename in ".github/ISSUE_TEMPLATE/"
26+
const TEMPLATE = 'devtools_bug_report.yml';
27+
1928
type Props = {|
2029
callStack: string | null,
2130
componentStack: string | null,
@@ -35,44 +44,21 @@ export default function ReportNewIssue({
3544
const gitHubAPISearch =
3645
errorMessage !== null ? searchGitHubIssuesURL(errorMessage) : '(none)';
3746

38-
const title = `Error: "${errorMessage || ''}"`;
39-
const labels = ['Component: Developer Tools', 'Status: Unconfirmed'];
40-
41-
const body = `
42-
<!-- Please answer both questions below before submitting this issue. -->
43-
44-
### Which website or app were you using when the bug happened?
45-
46-
Please provide a link to the URL of the website (if it is public), a CodeSandbox (https://codesandbox.io/s/new) example that reproduces the bug, or a project on GitHub that we can checkout and run locally.
47-
48-
### What were you doing on the website or app when the bug happened?
49-
50-
If possible, please describe how to reproduce this bug on the website or app mentioned above:
51-
1. <!-- FILL THIS IN -->
52-
2. <!-- FILL THIS IN -->
53-
3. <!-- FILL THIS IN -->
54-
55-
<!--------------------------------------------------->
56-
<!-- Please do not remove the text below this line -->
57-
<!--------------------------------------------------->
58-
59-
### Generated information
60-
61-
DevTools version: ${process.env.DEVTOOLS_VERSION || ''}
62-
63-
Call stack:
64-
${callStack || '(none)'}
65-
66-
Component stack:
67-
${componentStack || '(none)'}
68-
69-
GitHub URL search query:
70-
${gitHubAPISearch}
71-
`;
72-
73-
bugURL += `/issues/new?labels=${encodeURIWrapper(
74-
labels.join(','),
75-
)}&title=${encodeURIWrapper(title)}&body=${encodeURIWrapper(body.trim())}`;
47+
const title = `[DevTools Error] ${errorMessage || ''}`;
48+
49+
const parameters = [
50+
`template=${TEMPLATE}`,
51+
`labels=${encodeURIWrapper(LABELS.join(','))}`,
52+
`title=${encodeURIWrapper(title)}`,
53+
`automated_package=${process.env.DEVTOOLS_PACKAGE || ''}`,
54+
`automated_version=${process.env.DEVTOOLS_VERSION || ''}`,
55+
`automated_error_message=${encodeURIWrapper(errorMessage || '')}`,
56+
`automated_call_stack=${encodeURIWrapper(callStack || '')}`,
57+
`automated_component_stack=${encodeURIWrapper(componentStack || '')}`,
58+
`automated_github_query_string=${gitHubAPISearch}`,
59+
];
60+
61+
bugURL += `/issues/new?${parameters.join('&')}`;
7662

7763
return (
7864
<div className={styles.GitHubLinkRow}>

packages/react-devtools-shell/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const config = {
5252
__PROFILE__: false,
5353
__TEST__: NODE_ENV === 'test',
5454
'process.env.GITHUB_URL': `"${GITHUB_URL}"`,
55+
'process.env.DEVTOOLS_PACKAGE': `"react-devtools-shell"`,
5556
'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`,
5657
}),
5758
],

0 commit comments

Comments
 (0)