|
1 | 1 | # Compilation, tests, and code style |
2 | 2 |
|
3 | 3 | - jobName: windows installer and portable version |
| 4 | + workflowName: 'Source Code Tests' |
4 | 5 | message: > |
5 | 6 | Your code does not compile. |
6 | 7 | Please ensure your changes compile successfully before pushing changes. |
|
9 | 10 | To verify compilation locally, run `./gradlew build` or try running JabRef. |
10 | 11 |
|
11 | 12 | - jobName: 'Unit tests – jablib' |
| 13 | + workflowName: 'Source Code Tests' |
12 | 14 | message: > |
13 | 15 | JUnit tests of `jablib` are failing. |
14 | 16 | You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. |
15 | | - To see the test output, locate "Tests / Unit tests (pull_request)" and click on it. |
| 17 | + To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it. |
16 | 18 |
|
17 | 19 |
|
18 | 20 | You can then run these tests in IntelliJ to reproduce the failing tests locally. |
19 | 21 | We offer a quick test running howto in the section [Final build system checks](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.html#final-build-system-checks) in our setup guide. |
20 | 22 | - jobName: 'Unit tests – jabkit' |
| 23 | + workflowName: 'Source Code Tests' |
21 | 24 | message: > |
22 | 25 | JUnit tests of `jabkit` are failing. |
23 | 26 | You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. |
24 | | - To see the test output, locate "Tests / Unit tests (pull_request)" and click on it. |
| 27 | + To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it. |
25 | 28 |
|
26 | 29 |
|
27 | 30 | You can then run these tests in IntelliJ to reproduce the failing tests locally. |
28 | 31 | We offer a quick test running howto in the section [Final build system checks](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.html#final-build-system-checks) in our setup guide. |
29 | 32 | - jobName: 'Unit tests – jabsrv' |
| 33 | + workflowName: 'Source Code Tests' |
30 | 34 | message: > |
31 | 35 | JUnit tests of `jabsrv` are failing. |
32 | 36 | You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. |
33 | | - To see the test output, locate "Tests / Unit tests (pull_request)" and click on it. |
| 37 | + To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it. |
34 | 38 |
|
35 | 39 |
|
36 | 40 | You can then run these tests in IntelliJ to reproduce the failing tests locally. |
37 | 41 | We offer a quick test running howto in the section [Final build system checks](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.html#final-build-system-checks) in our setup guide. |
| 42 | +- jobName: format |
| 43 | + workflowName: 'Source Code Tests' |
| 44 | + message: > |
| 45 | + Your code currently does not meet JabRef's code guidelines. |
| 46 | + IntelliJ auto format covers some cases. |
| 47 | + There seem to be issues with your code style and autoformat configuration. |
| 48 | + Please reformat your code (<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd>) and commit, then push. |
| 49 | +
|
| 50 | +
|
| 51 | + In special cases, consider using `// formatter:off` and `// formatter:on` annotations to allow deviation from the code style. |
38 | 52 | - jobName: Checkstyle |
| 53 | + workflowName: 'Source Code Tests' |
39 | 54 | message: > |
40 | 55 | Your code currently does not meet [JabRef's code guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html). |
41 | 56 | We use [Checkstyle](https://checkstyle.sourceforge.io/) to identify issues. |
42 | 57 | You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. |
43 | | - To see the test output, locate "Tests / Checkstyle (pull_request)" and click on it. |
| 58 | + To see the test output, locate "Source Code Tests / Checkstyle (pull_request)" and click on it. |
44 | 59 |
|
45 | 60 |
|
46 | 61 | In case of issues with the import order, double check that you [activated Auto Import](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html#enable-proper-import-cleanup). |
|
50 | 65 | Please carefully follow [the setup guide for the codestyle](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html). |
51 | 66 | Afterwards, please [run checkstyle locally](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html#run-checkstyle) and fix the issues, commit, and push. |
52 | 67 | - jobName: OpenRewrite |
| 68 | + workflowName: 'Source Code Tests' |
53 | 69 | message: > |
54 | 70 | Your code currently does not meet JabRef's code guidelines. |
55 | 71 | We use [OpenRewrite](https://docs.openrewrite.org/) to ensure "modern" Java coding practices. |
56 | 72 | You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. |
57 | | - To see the test output, locate "Tests / OpenRewrite (pull_request)" and click on it. |
| 73 | + To see the test output, locate "Source Code Tests / OpenRewrite (pull_request)" and click on it. |
58 | 74 |
|
59 | 75 |
|
60 | 76 | The issues found can be **automatically fixed**. |
61 | 77 | Please execute the gradle task *`rewriteRun`* from the [`rewrite` group of the Gradle Tool window](https://devdocs.jabref.org/code-howtos/faq.html#failing-openrewrite-tests) in IntelliJ, then check the results, commit, and push. |
62 | 78 | - jobName: Modernizer |
| 79 | + workflowName: 'Source Code Tests' |
63 | 80 | message: > |
64 | 81 | Your code currently does not meet JabRef's code guidelines. |
65 | 82 | We use [Gradle Modernizer Plugin](https://github.com/andygoossens/gradle-modernizer-plugin#gradle-modernizer-plugin) to ensure "modern" Java coding practices. |
66 | 83 | You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. |
67 | | - To see the test output, locate "Tests / Modernizer (pull_request)" and click on it. |
| 84 | + To see the test output, locate "Source Code Tests / Modernizer (pull_request)" and click on it. |
68 | 85 |
|
69 | 86 |
|
70 | 87 | Please fix the detected errors, commit, and push. |
71 | 88 |
|
72 | 89 | # CHANGELOG.md and *.md |
73 | 90 |
|
74 | | -- jobName: 'CHANGELOG.md needs to be modified' |
| 91 | +- jobName: 'CHANGELOG.md needs to be modified if indicated' |
| 92 | + workflowName: 'Check PR CHANGELOG.md' |
75 | 93 | message: > |
76 | 94 | You ticked that you modified `CHANGELOG.md`, but no new entry was found there. |
77 | 95 |
|
78 | 96 |
|
79 | 97 | If you made changes that are visible to the user, please add a brief description along with the issue number to the `CHANGELOG.md` file. |
80 | 98 | If you did not, please replace the cross (`[x]`) by a slash (`[/]`) to indicate that no `CHANGELOG.md` entry is necessary. |
81 | 99 | More details can be found in our [Developer Documentation about the changelog](https://devdocs.jabref.org/decisions/0007-human-readable-changelog.html). |
82 | | -- jobName: CHANGELOG.md |
| 100 | +- jobName: 'CHANGELOG.md - only unreleased touched' |
| 101 | + workflowName: 'Source Code Tests' |
83 | 102 | message: > |
84 | 103 | While the PR was in progress, a new version of JabRef has been released. |
85 | 104 |
|
86 | 105 |
|
87 | 106 | You have to merge `upstream/main` and move your entry in `CHANGELOG.md` up to the section `## [Unreleased]`. |
| 107 | +- jobName: CHANGELOG.md |
| 108 | + workflowName: 'Source Code Tests' |
| 109 | + message: > |
| 110 | + You modified `CHANGELOG.md` and did not meet JabRef's rules for consistently formatted Markdown files. |
| 111 | + To ensure consistent styling, we have [markdown-lint](https://github.com/DavidAnson/markdownlint) in place. |
| 112 | + [Markdown lint's rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#rules) help to keep our Markdown files consistent within this repository and consistent with the Markdown files outside here. |
| 113 | +
|
| 114 | +
|
| 115 | + You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Source Code Tests" (on the left), subsection "CHANGELOG.md". |
88 | 116 | - jobName: Markdown |
| 117 | + workflowName: 'Source Code Tests' |
89 | 118 | message: > |
90 | 119 | You modified Markdown (`*.md`) files and did not meet JabRef's rules for consistently formatted Markdown files. |
91 | 120 | To ensure consistent styling, we have [markdown-lint](https://github.com/DavidAnson/markdownlint) in place. |
92 | 121 | [Markdown lint's rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#rules) help to keep our Markdown files consistent within this repository and consistent with the Markdown files outside here. |
93 | 122 |
|
94 | 123 |
|
95 | | - You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "Markdown". |
| 124 | + You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Source Code Tests" (on the left), subsection "Markdown". |
96 | 125 |
|
97 | 126 |
|
98 | 127 | # Submodules and branches |
99 | 128 |
|
100 | 129 | - jobName: 'Submodules not modified' |
| 130 | + workflowName: 'Check PR Modifications' |
101 | 131 | message: > |
102 | 132 | Your pull request modified git submodules. |
103 | 133 |
|
104 | 134 |
|
105 | 135 | Please follow our [FAQ on submodules](https://devdocs.jabref.org/code-howtos/faq.html#submodules) to fix. |
106 | 136 | - jobName: no-force-push |
| 137 | + workflowName: 'Check PR Modifications' |
107 | 138 | always: true |
108 | 139 | message: > |
109 | 140 | Hey, we noticed that you **force-pushed** your changes. |
110 | 141 | Force pushing is a bad practice when working together on a project (mainly because it is [not supported well by GitHub itself](https://github.com/orgs/community/discussions/3478)). |
111 | 142 | Commits are lost and comments on commits lose their context, thus making it harder to review changes. |
112 | | - At the end, all commits will be [squashed](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) anyway before being merged into the `main` branch. |
| 143 | +
|
| 144 | +
|
| 145 | + When the pull request is getting integrated into `main`, all commits will be [squashed](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) anyway. |
| 146 | + Thus, your individual commit history will not be visible in `main`. |
113 | 147 |
|
114 | 148 |
|
115 | 149 | In future, **please avoid that**. For now, you can continue working. |
116 | 150 | - jobName: 'Conflicts with target branch' |
| 151 | + workflowName: 'On PR opened/updated' |
117 | 152 | message: > |
118 | 153 | Your pull request conflicts with the target branch. |
119 | 154 |
|
120 | 155 |
|
121 | 156 | Please [merge `upstream/main`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork#syncing-a-fork-branch-from-the-command-line) with your code. |
122 | 157 | For a step-by-step guide to resolve merge conflicts, see <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line>. |
123 | 158 | - jobName: 'Source branch is other than "main"' |
| 159 | + workflowName: 'Check PR Modifications' |
124 | 160 | message: > |
125 | 161 | You committed your code on the `main` brach of your fork. This is a bad practice. |
126 | 162 | The right way is to branch out from `main`, work on your patch/feature in that new branch, and then get that branch merged via the pull request (see [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow)). |
|
131 | 167 | See [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md#pull-request-process) for more details. |
132 | 168 |
|
133 | 169 |
|
134 | | -# PR text |
| 170 | +# PR hygiene |
| 171 | + |
| 172 | +- jobName: 'Ensure that contributor is assigned (fails if not commented on issue)' |
| 173 | + workflowName: 'On PR opened/updated' |
| 174 | + message: > |
| 175 | + You did not assign yourself to the issue. |
| 176 | + Thus, it looks like you skipped reading our [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md), which explains exactly how to participate. No worries, it happens to the best of us. |
| 177 | +
|
| 178 | +
|
| 179 | + Give it a read, and you’ll discover the ancient wisdom of assigning issues to yourself. Trust me, it’s worth it. 🚀 |
135 | 180 |
|
| 181 | +- jobName: 'PR title must not contain "issue <number>"' |
| 182 | + workflowName: 'PR Format' |
| 183 | + always: true |
| 184 | + message: > |
| 185 | + The title of the pull request must not start with "Fix for issue xyz". |
| 186 | + Please use a concise one-line summary that explains what the fix or change actually does. |
| 187 | + Example of a good title: "Prevent crash when importing malformed BibTeX entries". |
136 | 188 | - jobName: 'Mandatory Checks present' |
| 189 | + workflowName: 'PR Format' |
137 | 190 | always: true |
138 | 191 | message: > |
139 | 192 | You have removed the "Mandatory Checks" section from your pull request description. Please adhere to our [pull request template](https://github.com/JabRef/jabref/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L10). |
140 | 193 | - jobName: 'PR checklist OK' |
| 194 | + workflowName: 'PR Format' |
141 | 195 | always: true |
142 | 196 | message: > |
143 | 197 | Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of `[x]` (done), `[ ]` (not done yet) or `[/]` (not applicable). |
144 | 198 | - jobName: 'Determine issue number' |
| 199 | + workflowName: 'On PR opened/updated' |
145 | 200 | always: true |
146 | 201 | message: | |
147 | 202 | Your pull request needs to link an issue correctly. |
148 | 203 |
|
149 | | - To ease organizational workflows, please link this pull-request to the issue with syntax as described in <https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue>: |
150 | | -
|
151 | | - > <h2 id="linking-a-pull-request-to-an-issue-using-a-keyword">Linking a pull request to an issue using a keyword</h2> |
152 | | - > <p>You can link a pull request to an issue by using a supported keyword |
153 | | - > in the pull request's description or in a commit message. |
| 204 | + To ease organizational workflows, please link this pull request to the issue by including a supported keyword in the pull request's description as per syntax described in [GitHub's documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). |
154 | 205 |
|
155 | 206 | ### Examples |
156 | 207 |
|
|
0 commit comments