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
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/bug_report.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Please do a quick search on Github issues first, there might be already a duplic
11
11
If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
12
12
13
13
**Bug description**
14
-
A clear and concise description of what the bug is.
14
+
A clear and concise description of what the bug is about.
15
15
16
16
**Environment**
17
17
Please provide as many details as possible: Spring Batch version, Java version, which database you use if any, etc
@@ -23,5 +23,5 @@ Steps to reproduce the issue.
23
23
A clear and concise description of what you expected to happen.
24
24
25
25
**Minimal Complete Reproducible example**
26
-
Please provide a failing unit test or a [minimal complete example](https://stackoverflow.com/help/minimal-reproducible-example) that reproduces the issue.
26
+
Please provide a failing test or a [minimal complete verifiable example](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md) that reproduces the issue.
27
27
Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+34-29Lines changed: 34 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
Contributor Guidelines
2
2
======================
3
3
4
-
Have something you'd like to contribute to **Spring Batch**? We welcome pull requests, but ask that you carefully read this document first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring team when evaluating your submission.
4
+
Have something you'd like to contribute to Spring Batch? We welcome pull requests, but ask that you carefully read this document
5
+
first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring Batch
6
+
team when evaluating your submission.
5
7
6
8
Please refer back to this document as a checklist before issuing any pull request; this will save time for everyone!
7
9
@@ -13,26 +15,29 @@ Please see our [code of conduct](https://github.com/spring-projects/.github/blob
13
15
14
16
Please see our [Security policy](https://github.com/spring-projects/spring-batch/security/policy).
15
17
16
-
## Understand the basics
18
+
## Reporting issues
17
19
18
-
Not sure what a *pull request* is, or how to submit one? Take a look at the excellent [GitHub help documentation][] first.
20
+
Is there already an issue that addresses your concern? Please do a quick search in [Github issues][] to see if you can find something similar.
21
+
If not, please read the [Issue Reporting](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md) section for more details
22
+
about how to report issues.
19
23
20
-
## Search Github issues first; create an issue if necessary
24
+
## Contributing through Pull Requests on GitHub
21
25
22
-
Is there already an issue that addresses your concern? Do a bit of searching in [Github issues][] to see if you can find something similar. If not, please create a new issue before submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc.
26
+
Not sure what a *pull request* is, or how to submit one? Take a look at the excellent [GitHub help documentation][] first.
27
+
Please create a new issue *before* submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc.
23
28
24
-
## Sign the contributor license agreement
29
+
###Sign the contributor license agreement
25
30
26
31
If you have not previously done so, please fill out and
27
32
submit the [Contributor License Agreement](https://cla.pivotal.io/sign/spring).
28
33
29
-
## Fork the Repository
34
+
###Fork the Repository
30
35
31
36
1. Go to [https://github.com/spring-projects/spring-batch](https://github.com/spring-projects/spring-batch)
32
37
2. Hit the "fork" button and choose your own github account as the target
33
-
3. For more details see [https://help.github.com/fork-a-repo/](https://help.github.com/fork-a-repo/)
38
+
3. For more details see [https://docs.github.com/en/get-started/quickstart/fork-a-repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
@@ -45,14 +50,14 @@ _you should now see 'upstream' in addition to 'origin' where 'upstream' is the *
45
50
7.`git branch -a`
46
51
_you should see branches on origin as well as upstream, including 'main'_
47
52
48
-
## A Day in the Life of a Contributor
53
+
###A Day in the Life of a Contributor
49
54
50
55
*_Always_ work on topic branches (Typically use the Github issue ID as the branch name).
51
-
- For example, to create and switch to a new branch for issue BATCH-123: `git checkout -b BATCH-123`
56
+
- For example, to create and switch to a new branch for issue GH-123: `git checkout -b GH-123`
52
57
* You might be working on several different topic branches at any given time, but when at a stopping point for one of those branches, commit (a local operation).
53
58
* Please follow the "Commit Guidelines" described in this chapter of Pro Git: [https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines)
54
-
* Then to begin working on another issue (say BATCH-101): `git checkout BATCH-101`. The _-b_ flag is not needed if that branch already exists in your local repository.
55
-
* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin BATCH-123`
59
+
* Then to begin working on another issue (say GH-101): `git checkout GH-101`. The _-b_ flag is not needed if that branch already exists in your local repository.
60
+
* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin GH-123`
56
61
* If you want to collaborate with another contributor, have them fork your repository (add it as a remote) and `git fetch <your-username>` to grab your branch. Alternatively, they can use `git fetch --all` to sync their local state with all of their remotes.
57
62
* If you grant that collaborator push access to your repository, they can even apply their changes to your branch.
58
63
* When ready for your contribution to be reviewed for potential inclusion in the main branch of the canonical *spring-batch* repository (what you know as 'upstream'), issue a pull request to the *spring-projects* repository (for more detail, see [GitHub help documentation][]).
@@ -63,21 +68,21 @@ _you should see branches on origin as well as upstream, including 'main'_
63
68
* As mentioned above, you should always work on topic branches (since 'main' is a moving target). However, you do want to always keep your own 'origin' main branch in synch with the 'upstream' main.
64
69
* Within your local working directory, you can sync up all remotes' branches with: `git fetch --all`
65
70
* While on your own local main branch: `git pull upstream main` (which is the equivalent of fetching upstream/main and merging that into the branch you are in currently)
66
-
* Now that you're in synch, switch to the topic branch where you plan to work, e.g.: `git checkout -b BATCH-123`
71
+
* Now that you're in sync, switch to the topic branch where you plan to work, e.g.: `git checkout -b GH-123`
67
72
* When you get to a stopping point: `git commit`
68
73
* If changes have occurred on the upstream/main while you were working you can synch again:
69
74
- Switch back to main: `git checkout main`
70
75
- Then: `git pull upstream main`
71
-
- Switch back to the topic branch: `git checkout BATCH-123` (no -b needed since the branch already exists)
76
+
- Switch back to the topic branch: `git checkout GH-123` (no -b needed since the branch already exists)
72
77
- Rebase the topic branch to minimize the distance between it and your recently synched main branch: `git rebase main`
73
78
(Again, for more detail see the Pro Git section on rebasing: [https://git-scm.com/book/en/v2/Git-Branching-Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing))
74
79
***Note** You cannot rebase if you have already pushed your branch to your remote because you'd be rewriting history (see **'The Perils of Rebasing'** in the article). If you rebase by mistake, you can undo it as discussed [in this stackoverflow discussion](https://stackoverflow.com/questions/134882/undoing-a-git-rebase). Once you have published your branch, you need to merge in the main rather than rebasing.
75
80
* Now, if you issue a pull request, it is much more likely to be merged without conflicts. Most likely, any pull request that would produce conflicts will be deferred until the issuer of that pull request makes these adjustments.
76
81
* Assuming your pull request is merged into the 'upstream' main, you will actually end up pulling that change into your own main eventually, and at that time, you may decide to delete the topic branch from your local repository and your fork (origin) if you pushed it there.
77
-
- to delete the local branch: `git branch -d BATCH-123`
78
-
- to delete the branch from your origin: `git push origin :BATCH-123`
82
+
- to delete the local branch: `git branch -d GH-123`
83
+
- to delete the branch from your origin: `git push origin :GH-123`
79
84
80
-
## Maintain a linear commit history
85
+
###Maintain a linear commit history
81
86
82
87
When issuing pull requests, please ensure that your commit history is linear. From the command line you can check this using:
This command, will provide the following output, which in this case shows a nice linear history:
95
100
96
101
````
97
-
* e1f6de38e04a5227fea2d4df193a5b50beaf2d00 BATCH-2002: Initial support for complex conditional replacements
102
+
* e1f6de38e04a5227fea2d4df193a5b50beaf2d00 GH-2002: Initial support for complex conditional replacements
98
103
* 65d2df652abaae2ca309d96e3026c2d67312655f Add ability to set a custom TaskExecutor impl, remove unused namespaces from JSR bootst
99
104
* 85807568575c24d8878ad605a344f2bc35bb2b13 Update to allow restart parameters to override previous parameters in JsrJobOperator an
100
-
* a21df75ce9dfc92e9768353b827da4248aefe425 BATCH-2049: Support multiple fragmentRootElementNames in StaxEventItemReader
105
+
* a21df75ce9dfc92e9768353b827da4248aefe425 GH-2049: Support multiple fragmentRootElementNames in StaxEventItemReader
101
106
* 7f1130c9a265a3ce18a46cbbc122e6573167a036 Fix TCK test JobOperatorTests.testJobOperatorRestartJobAlreadyAbandoned
102
107
* c4231c4cc861bbcc43437c80a03ddd9b7b2897a3 Fixed no executions returned check and added a unit test
103
108
````
104
109
If you see intersecting lines, that usually means that you forgot to rebase you branch. As mentioned earlier, **please rebase against main** before issuing a pull request.
105
110
106
-
## Code style
111
+
###Code style
107
112
108
113
Please carefully follow the same [code style as Spring Framework](https://github.com/spring-projects/spring-framework/wiki/Code-Style).
109
114
110
-
## Add Apache license header to all new classes
115
+
###Add Apache license header to all new classes
111
116
112
117
```java
113
118
/*
@@ -129,7 +134,7 @@ Please carefully follow the same [code style as Spring Framework](https://github
129
134
package...;
130
135
```
131
136
132
-
## Update license header to modified files as necessary
137
+
###Update license header to modified files as necessary
133
138
134
139
Always check the date range in the Apache license header. For example, if you've modified a file in 2013 whose header still reads
135
140
@@ -143,7 +148,7 @@ then be sure to update it to 2013 appropriately
143
148
*Copyright2002-2013 the original author or authors.
144
149
```
145
150
146
-
## Use @since tags
151
+
###Use @since tags
147
152
148
153
Use @since tags for newly-added public API types and methods e.g.
149
154
@@ -157,15 +162,15 @@ Use @since tags for newly-added public API types and methods e.g.
157
162
*/
158
163
```
159
164
160
-
## Submit JUnit test cases for all behavior changes
165
+
###Submit JUnit test cases for all behavior changes
161
166
162
167
Search the codebase to find related unit tests and add additional @Test methods within. It is also acceptable to submit test cases on a per Github issue basis.
163
168
164
-
## Squash commits
169
+
###Squash commits
165
170
166
171
Use `git rebase --interactive`, `git add --patch` and other tools to "squash" multiple commits into atomic changes. In addition to the man pages for git, there are many resources online to help you understand how these tools work. Here is one: https://book.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_squashing .
167
172
168
-
## Use your real name in git commits
173
+
###Use your real name in git commits
169
174
170
175
Please configure git to use your real first and last name for any commits you intend to submit as pull requests. For example, this is not acceptable:
171
176
@@ -188,11 +193,11 @@ or locally for the *spring-batch repository only by omitting the '--global' flag
Thank you very much for taking the time to report a bug to us, we greatly appreciate it! This document is designed to allow Spring Batch users and team members to contribute self-contained projects containing [minimal complete verifiable examples](https://en.wikipedia.org/wiki/Minimal_reproducible_example) for issues logged against the [issue tracker](https://github.com/spring-projects/spring-batch/issues) on GitHub.
4
+
5
+
Our goal is to have a streamlined process for evaluating issues so bugs get fixed more quickly!
6
+
7
+
# Downloading the minimal complete verifiable example
8
+
9
+
We provide a minimal complete verifiable example that you can download here: [spring-batch-mcve.zip](https://raw.githubusercontent.com/wiki/spring-projects/spring-batch/mcve/spring-batch-mcve.zip). This example provides a starting point that you need to edit, zip and attach to your issue on GitHub. You need to use Java 17+ and Maven 3+.
10
+
11
+
Please run the following commands to make sure you have the sample working as expected:
You should see something like the following output:
19
+
20
+
```
21
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchRegistrar - Finished Spring Batch infrastructure beans configuration in 5 ms.
22
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory - Starting embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
23
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.repository.support.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2
24
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchObservabilityBeanPostProcessor - No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP
25
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchObservabilityBeanPostProcessor - No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP
26
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - No TaskExecutor has been set, defaulting to synchronous executor.
27
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=job]] launched with the following parameters: [{}]
28
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.job.SimpleStepHandler - Executing step: [step]
29
+
hello world
30
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.step.AbstractStep - Step: [step] executed in 11ms
31
+
[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=job]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 34ms
32
+
COMPLETED
33
+
```
34
+
35
+
# Reporting a bug
36
+
37
+
Once you have the minimal complete verifiable example running as expected, you can import it as a Maven project in your favourite IDE. Please make sure to:
38
+
39
+
* Update the sample as needed to reproduce your issue. We have placed a few TODOs where we expect you to modify the code.
40
+
* Add any dependency that is required to reproduce your issue.
41
+
* Keep the bare minimum code that is required to reproduce your issue. This is very important! Please reduce as much noise as possible to let us focus on the code related to the issue.
42
+
43
+
Once you manage to reproduce the issue, please clean up the `target` directory *before* creating the zip archive to upload. Here are the commands you can run to create the archive:
44
+
45
+
```shell
46
+
$>mvn clean
47
+
$>zip -r spring-batch-mcve.zip spring-batch-mcve
48
+
```
49
+
50
+
:exclamation: Important note: The `mvn clean` command is very important here. Please **DO NOT** include the `target` directory with all dependencies in the archive! We appreciate your collaboration on this.
51
+
52
+
Heads-up: If you think you can reproduce the issue with a JUnit test, that is awesome! The minimal example that we provide
53
+
has a JUnit test that you can edit as needed to reproduce the issue. Moreover, the minimal example we provide uses an in-memory H2 database, but if your issue is related to a specific database, please do not hesitate to add a Docker based test using
54
+
the [Testcontainers](https://www.testcontainers.org) library and the JDBC driver of your database. You can find several examples in the test suite of Spring Batch [here](https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJobRepositoryIntegrationTests.java).
55
+
56
+
# Final thoughts
57
+
58
+
More importantly, put yourself in the shoes of the project maintainer who is in charge of analysing and trying to reproduce your issue. Before uploading your minimal example, ask yourself: "How fast the Spring Batch team can understand and reproduce my issue?"
59
+
60
+
Once we download your zip archive from the corresponding issue on GitHub, we expect to be two commands away from seeing a stack trace or the described abnormal behaviour:
Finally, please remember that those instructions are guidelines and not hard requirements. Be pragmatic! For example, if you already have a GitHub repository with the minimal example, there is no need to zip it and attach it to the issue, you would just need to add a link to it in your issue. If you think the issue is really obvious and does not require a minimal example, there is no need to create such an example, just go ahead and create the issue on GitHub by following the [Issue Template](https://github.com/spring-projects/spring-batch/blob/main/.github/ISSUE_TEMPLATE/bug_report.md).
68
+
69
+
We appreciate your collaboration and we would like to thank you upfront for your time and effort!
0 commit comments