Skip to content

Commit b7eed53

Browse files
authored
Add issue template for regression (#713)
1 parent 04f008a commit b7eed53

File tree

6 files changed

+108
-9
lines changed

6 files changed

+108
-9
lines changed

.github/ISSUE_TEMPLATE/1-bug.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Bug report
3-
about: Create a report to help us improve
3+
about: Report for something that doesn't work as expected
44
title: ''
55
labels: bug
66
assignees: ''
@@ -16,19 +16,24 @@ assignees: ''
1616

1717
<!--
1818
Please include a code snippet that reproduces the bug and the output that
19-
running it gives. The following snippet templates might help:
19+
running it gives. The following snippet templates might help. Replace "..." with
20+
actual implementation details.
2021
21-
1. Using the CLI function
22+
1. Using the auto_cli function
2223
2324
```python
24-
from jsonargparse import CLI
25+
from jsonargparse import auto_cli
2526
2627
# Here define one or more functions or classes
2728
def func1(param1: int, ...):
2829
...
2930
30-
# Run the CLI providing the components
31-
CLI([func1, ...], exit_on_error=False)
31+
# Run the CLI providing the components and arguments
32+
auto_cli(
33+
[func1, ...],
34+
args=["--param1=value1", ...],
35+
exit_on_error=False,
36+
)
3237
```
3338
3439
2. Manually constructing a parser
@@ -39,11 +44,11 @@ from jsonargparse import ArgumentParser
3944
parser = ArgumentParser(exit_on_error=False)
4045
# Here add to the parser only argument(s) relevant to the problem
4146
42-
# If a yaml config is required, it can be included in the same snippet as follows:
43-
import yaml
47+
# If a config is required, it can be included in the same snippet as follows:
48+
import json
4449
4550
parser.add_argument("--config", action="config")
46-
config = yaml.safe_dump(
51+
config = json.dumps(
4752
{
4853
"key1": "val1",
4954
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
name: Regression report
3+
about: Report for something that used to work but doesn't anymore
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
<!-- If you like this project, please ⭐ star it https://github.com/omni-us/jsonargparse/ -->
10+
11+
## 🕰️ Regression report
12+
13+
<!-- A clear and concise description of the regression. -->
14+
15+
### To reproduce
16+
17+
<!--
18+
Please include a code snippet that reproduces the regression. Make sure that it
19+
is a script that can be used to run git bisect. This means that when code works
20+
correctly, the script terminates with zero exit code. When it fails an exception
21+
is raised. The following snippet templates might help. Replace "..." with actual
22+
implementation details.
23+
24+
1. a) Using the auto_cli function
25+
26+
```python
27+
#!/usr/bin/env python3
28+
29+
from jsonargparse import auto_cli
30+
31+
# Here define one or more functions or classes
32+
def func1(param1: int, ...):
33+
...
34+
35+
# Run the CLI providing the components and arguments
36+
auto_cli(
37+
[func1, ...],
38+
args=["--param1=value1", ...],
39+
exit_on_error=False,
40+
)
41+
```
42+
43+
1. b) Manually constructing a parser
44+
45+
```python
46+
#!/usr/bin/env python3
47+
48+
from jsonargparse import ArgumentParser
49+
50+
parser = ArgumentParser(exit_on_error=False)
51+
# Here add to the parser only argument(s) relevant to the problem
52+
53+
# If a config is required, it can be included in the same snippet as follows:
54+
import json
55+
56+
parser.add_argument("--config", action="config")
57+
config = json.dumps(
58+
{
59+
"key1": "val1",
60+
}
61+
)
62+
63+
# If the problem is when parsing arguments
64+
result = parser.parse_args([f"--config={config}", "--key2=val2", ...])
65+
66+
# If the problem is in class instantiation
67+
parser.instantiate_classes(result)
68+
```
69+
70+
2. Preferably, run git bisect and include in the report the git commit hash that
71+
caused the regression. This would be like:
72+
73+
```
74+
chmod +x regression.py # make script executable
75+
pip3 install -e . # install as editable
76+
git bisect start
77+
git bisect bad <version-tag-latest>
78+
git bisect good <version-tag-known-good>
79+
git bisect run ./regression.py
80+
```
81+
-->
82+
83+
### Prior behavior
84+
85+
<!-- Please describe the prior behavior in detail, and contrast it with the behavior you are currently observing. -->
86+
87+
### Environment
88+
89+
<!-- Fill in the list below. -->
90+
91+
- jsonargparse version:
92+
- Python version:
93+
- How jsonargparse was installed:
94+
- OS:
File renamed without changes.

0 commit comments

Comments
 (0)