Skip to content

Commit db1f577

Browse files
committed
Merge branch 'upstream-main' into gsoc-ocr-tess4j-initial-implementation
2 parents f80cec8 + 5d9b6ac commit db1f577

File tree

351 files changed

+10863
-4406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

351 files changed

+10863
-4406
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
// Install java.
3232
// See https://github.com/devcontainers/features/tree/main/src/java#options for details.
3333
"ghcr.io/devcontainers/features/java:1": {
34-
"version": "24.0.1-tem",
34+
"version": "24.0.1-amzn",
3535
"installGradle": false,
36-
"jdkDistro": "Temurin"
36+
"jdkDistro": "Corretto"
3737
}
3838
}
3939
}

.dockerignore

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
.git
12
.gitignore
23
.dockerignore
34

45
Dockerfile
56
Dockerfile.*
67
.github/
78

9+
.devcontainer/
10+
11+
*/bin
12+
*/build
13+
*/out
14+
15+
docs/
16+
17+
gg.cmd
18+
gradlew.bat
19+
820
# no generated files in version control
921
src/main/gen/
1022
src/main/generated/
1123
src-gen/
1224

13-
src/main/resources/csl-styles
14-
src/main/resources/csl-locales
15-
buildres/abbrv.jabref.org
16-
17-
jablib/src/main/resources/csl-styles
18-
jablib/src/main/resources/csl-locales
19-
2025
.lycheecache
2126

2227
.kotlin

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
Closes #_____
1+
Closes _____
2+
<!-- LINK THE ISSUE WITH THE "Closes" KEYWORD. Example: Closes https://github.com/JabRef/jabref/issues/13109 OR Closes #13109 -->
23

3-
In about one to three sentences, describe the changes you have made: what, where, why, ...
4+
<!-- In about one to three sentences, describe the changes you have made: what, where, why, ... (REPLACE THIS LINE) -->
45

56
<!-- NOTE: If your work is not yet complete, please open a draft pull request. In that case, outline your intended next steps. Do you need feedback? Will you continue in parallel? ... -->
67

78
### Steps to test
89

9-
Describe how reviewers can test this fix/feature. Ideally, think of how you would guide a beginner user of Jabef to try out your change.
10-
You can add screenshots or videos (using [Loom](https://www.loom.com/) or by just adding .mp4 files).
10+
<!-- Describe how reviewers can test this fix/feature. Ideally, think of how you would guide a beginner user of Jabef to try out your change. -->
11+
<!-- You can add screenshots or videos (using Loom - https://www.loom.com or by just adding .mp4 files). -->
12+
<!-- (REPLACE THIS PARAGRAPH) -->
1113

1214
<!-- YOU HAVE TO MODIFY THE ABOVE TEXT FIT YOUR PR. OTHERWISE, YOUR PR WILL BE CLOSED WITHOUT FURTHER COMMENT. -->
13-
<!-- LINK THE ISSUE WITH THE "Closes" KEYWORD. Example: Closes (link) OR Closes #12345 -->
1415

1516
### Mandatory checks
1617

.github/dependabot.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ version: 2
22
updates:
33
- package-ecosystem: gradle
44
directories:
5-
- "/build-logic" # Build-related logic for gradle
6-
- "/jabgui" # JabRef's GUI
7-
- "/jabkit" # JabRef's CLI ("JabKit")
8-
- "/jablib" # Core library
9-
- "/jabsrv" # Server-related module
10-
- "/jabsrv-cli" # CLI for the server
11-
- "/test-support" # Module for test utilities
5+
- "/build-logic" # versions of 3rd party gradle plugins
6+
- "/versions" # versions of 3rd party dependencies of all JabRef modules
7+
- "/" # plugins
128
schedule:
139
interval: weekly
1410
labels:

.github/ghprcomment.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Compilation, tests, and code style
22

33
- jobName: windows installer and portable version
4+
workflowName: 'Source Code Tests'
45
message: >
56
Your code does not compile.
67
Please ensure your changes compile successfully before pushing changes.
@@ -9,6 +10,7 @@
910
To verify compilation locally, run `./gradlew build` or try running JabRef.
1011
1112
- jobName: 'Unit tests – jablib'
13+
workflowName: 'Source Code Tests'
1214
message: >
1315
JUnit tests of `jablib` are failing.
1416
You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page.
@@ -18,6 +20,7 @@
1820
You can then run these tests in IntelliJ to reproduce the failing tests locally.
1921
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.
2022
- jobName: 'Unit tests – jabkit'
23+
workflowName: 'Source Code Tests'
2124
message: >
2225
JUnit tests of `jabkit` are failing.
2326
You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page.
@@ -27,6 +30,7 @@
2730
You can then run these tests in IntelliJ to reproduce the failing tests locally.
2831
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.
2932
- jobName: 'Unit tests – jabsrv'
33+
workflowName: 'Source Code Tests'
3034
message: >
3135
JUnit tests of `jabsrv` are failing.
3236
You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page.
@@ -36,6 +40,7 @@
3640
You can then run these tests in IntelliJ to reproduce the failing tests locally.
3741
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.
3842
- jobName: Checkstyle
43+
workflowName: 'Source Code Tests'
3944
message: >
4045
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).
4146
We use [Checkstyle](https://checkstyle.sourceforge.io/) to identify issues.
@@ -50,6 +55,7 @@
5055
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).
5156
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.
5257
- jobName: OpenRewrite
58+
workflowName: 'Source Code Tests'
5359
message: >
5460
Your code currently does not meet JabRef's code guidelines.
5561
We use [OpenRewrite](https://docs.openrewrite.org/) to ensure "modern" Java coding practices.
@@ -60,6 +66,7 @@
6066
The issues found can be **automatically fixed**.
6167
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.
6268
- jobName: Modernizer
69+
workflowName: 'Source Code Tests'
6370
message: >
6471
Your code currently does not meet JabRef's code guidelines.
6572
We use [Gradle Modernizer Plugin](https://github.com/andygoossens/gradle-modernizer-plugin#gradle-modernizer-plugin) to ensure "modern" Java coding practices.
@@ -72,20 +79,32 @@
7279
# CHANGELOG.md and *.md
7380

7481
- jobName: 'CHANGELOG.md needs to be modified'
82+
workflowName: 'PR Tests'
7583
message: >
7684
You ticked that you modified `CHANGELOG.md`, but no new entry was found there.
7785
7886
7987
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.
8088
If you did not, please replace the cross (`[x]`) by a slash (`[/]`) to indicate that no `CHANGELOG.md` entry is necessary.
8189
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
90+
- jobName: 'CHANGELOG.md - only unreleased touched'
91+
workflowName: 'Source Code Tests'
8392
message: >
8493
While the PR was in progress, a new version of JabRef has been released.
8594
8695
8796
You have to merge `upstream/main` and move your entry in `CHANGELOG.md` up to the section `## [Unreleased]`.
97+
- jobName: CHANGELOG.md
98+
workflowName: 'Source Code Tests'
99+
message: >
100+
You modified `CHANGELOG.md` and did not meet JabRef's rules for consistently formatted Markdown files.
101+
To ensure consistent styling, we have [markdown-lint](https://github.com/DavidAnson/markdownlint) in place.
102+
[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.
103+
104+
105+
You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "CHANGELOG.md".
88106
- jobName: Markdown
107+
workflowName: 'Source Code Tests'
89108
message: >
90109
You modified Markdown (`*.md`) files and did not meet JabRef's rules for consistently formatted Markdown files.
91110
To ensure consistent styling, we have [markdown-lint](https://github.com/DavidAnson/markdownlint) in place.
@@ -98,12 +117,14 @@
98117
# Submodules and branches
99118

100119
- jobName: 'Submodules not modified'
120+
workflowName: 'PR Tests'
101121
message: >
102122
Your pull request modified git submodules.
103123
104124
105125
Please follow our [FAQ on submodules](https://devdocs.jabref.org/code-howtos/faq.html#submodules) to fix.
106126
- jobName: no-force-push
127+
workflowName: 'PR Tests'
107128
always: true
108129
message: >
109130
Hey, we noticed that you **force-pushed** your changes.
@@ -114,13 +135,15 @@
114135
115136
In future, **please avoid that**. For now, you can continue working.
116137
- jobName: 'Conflicts with target branch'
138+
workflowName: 'On PR opened/updated'
117139
message: >
118140
Your pull request conflicts with the target branch.
119141
120142
121143
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.
122144
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>.
123145
- jobName: 'Source branch is other than "main"'
146+
workflowName: 'PR Tests'
124147
message: >
125148
You committed your code on the `main` brach of your fork. This is a bad practice.
126149
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,17 +154,36 @@
131154
See [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md#pull-request-process) for more details.
132155
133156
134-
# PR text
157+
# PR hygiene
135158

159+
- jobName: 'Ensure that contributor is assigned (fails if not commented on issue)'
160+
workflowName: 'On PR opened/updated'
161+
message: >
162+
You did not assign yourself to the issue.
163+
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.
164+
165+
166+
Give it a read, and you’ll discover the ancient wisdom of assigning issues to yourself. Trust me, it’s worth it. 🚀
167+
168+
- jobName: 'PR title must not start with "Fix for issue <number>"'
169+
workflowName: 'PR Tests'
170+
always: true
171+
message: >
172+
The title of the pull request must not start with "Fix for issue xyz".
173+
Please use a concise one-line summary that explains what the fix or change actually does.
174+
Example of a good title: "Prevent crash when importing malformed BibTeX entries".
136175
- jobName: 'Mandatory Checks present'
176+
workflowName: 'PR Tests'
137177
always: true
138178
message: >
139179
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).
140180
- jobName: 'PR checklist OK'
181+
workflowName: 'PR Tests'
141182
always: true
142183
message: >
143184
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).
144185
- jobName: 'Determine issue number'
186+
workflowName: 'PR Tests'
145187
always: true
146188
message: |
147189
Your pull request needs to link an issue correctly.

.github/workflows/automerge.yml

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,57 @@ permissions:
88
jobs:
99
automerge:
1010
runs-on: ubuntu-latest
11-
# Run only if PR is inside JabRef's main repository and created by dependabot or by an update workflow
12-
if: >
13-
(github.repository == 'JabRef/jabref') &&
14-
(
15-
(github.actor == 'renovate-bot' && startsWith(github.event.pull_request.title, 'chore(deps):')) ||
16-
(
17-
(github.event.pull_request.head.repo.full_name == 'JabRef/jabref') &&
18-
(
19-
(github.actor == 'dependabot[bot]') ||
20-
(
21-
startsWith(github.event.pull_request.title, '[Bot] ') ||
22-
startsWith(github.event.pull_request.title, 'Bump ') ||
23-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
24-
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
25-
)
26-
)
27-
)
28-
)
11+
if: github.repository == 'JabRef/jabref'
2912
steps:
13+
- name: Determine if job should run
14+
id: shouldrun
15+
shell: bash
16+
run: |
17+
actor='${{ github.actor }}'
18+
title='${{ github.event.pull_request.title }}'
19+
20+
if [[ "$actor" == "renovate-bot" ]]; then
21+
echo "✅ from renote-bot"
22+
echo "shouldrun=true" >> "$GITHUB_OUTPUT"
23+
exit 0
24+
fi
25+
26+
head_repo="${{ github.event.pull_request.head.repo.full_name }}"
27+
if [[ "$head_repo" != "JabRef/jabref" ]]; then
28+
echo "🚫 not from JabRef/jabref"
29+
echo "shouldrun=false" >> "$GITHUB_OUTPUT"
30+
exit 0
31+
fi
32+
33+
if [[ "$actor" == "dependabot[bot]" ]] || \
34+
[[ "$title" == "[Bot] "* ]] || \
35+
[[ "$title" == "Bump "* ]] || \
36+
[[ "$title" == "New Crowdin updates"* ]] || \
37+
[[ "$title" == "Update Gradle Wrapper from"* ]]; then
38+
echo "✅ title OK"
39+
echo "shouldrun=true" >> "$GITHUB_OUTPUT"
40+
exit 0
41+
fi
42+
43+
LABELS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels --jq '.[].name')
44+
if echo "$LABELS" | grep -q "^automerge"; then
45+
echo "✅ label automerge"
46+
echo "shouldrun=true" >> "$GITHUB_OUTPUT"
47+
exit 0
48+
fi
49+
50+
echo "🚫 no automerge"
51+
echo "shouldrun=false" >> "$GITHUB_OUTPUT"
52+
env:
53+
GH_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
3054
- name: Approve PR
55+
if: steps.shouldrun.outputs.shouldrun == 'true'
3156
run: gh pr review --approve "$PR_URL"
3257
env:
3358
PR_URL: ${{github.event.pull_request.html_url}}
3459
GH_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
3560
- name: Merge PR
61+
if: steps.shouldrun.outputs.shouldrun == 'true'
3662
run: gh pr merge --auto --squash "$PR_URL"
3763
env:
3864
PR_URL: ${{github.event.pull_request.html_url}}

0 commit comments

Comments
 (0)