diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 16199f2abf7..c52221619ed 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,5 @@ - +Describe the changes you have made here: what, why, ... +Link the issue that will be closed, e.g., "Closes #333". If your PR closes a koppor issue, link it using its URL, e.g., "Closes https://github.com/koppor/jabref/issues/47". ### Mandatory checks @@ -13,6 +8,7 @@ Don't reference an issue in the PR title because GitHub does not support auto-li - [x] done; [ ] not done / not applicable --> +- [x] I own the copyright of the code submitted and I licence it under the [MIT license](https://github.com/JabRef/jabref/blob/main/LICENSE) - [ ] Change in `CHANGELOG.md` described in a way that is understandable for the average user (if applicable) - [ ] Tests created for changes (if applicable) - [ ] Manually tested changed features in running JabRef (always required) diff --git a/.github/ghprcomment.yml b/.github/ghprcomment.yml index 9f740d626f8..f42ddc26b33 100644 --- a/.github/ghprcomment.yml +++ b/.github/ghprcomment.yml @@ -34,3 +34,8 @@ message: | While the PR was in progress, a new version of JabRef has been released. You have to merge `upstream/main` and move your entry in `CHANGELOG.md` up to the section `## [Unreleased]`. +- jobName: 'Unit tests' + message: | + JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output. + + You can then run these tests in IntelliJ to reproduce the failing tests locally. 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. diff --git a/.github/workflows/add-greeting-to-issue.yml b/.github/workflows/add-greeting-to-issue.yml deleted file mode 100644 index e03ca9f8ba6..00000000000 --- a/.github/workflows/add-greeting-to-issue.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Add greeting to issues for first time contributors - -on: - issues: - types: - - labeled - pull_request_target: - types: - - labeled - -jobs: - GreetingFirstTimeCodeContribution: - if: ${{ github.event.label.name == 'FirstTimeCodeContribution' }} - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - name: GreetingFirstTimeCodeContribution - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} - body: | - Welcome to the vibrant world of open-source development with JabRef! - - Newcomers, we're excited to have you on board. Start by exploring our [Contributing](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md) guidelines, and don't forget to check out our [workspace setup guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace) to get started smoothly. - - In case you encounter failing tests during development, please check our [developer FAQs](https://devdocs.jabref.org/code-howtos/faq.html)! - - Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on [JabRef's Gitter chat](https://gitter.im/JabRef/jabref). And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. - - Happy coding! 🚀 diff --git a/.github/workflows/add-to-projects.yml b/.github/workflows/add-to-projects.yml deleted file mode 100644 index a55824e683e..00000000000 --- a/.github/workflows/add-to-projects.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Add to Project on Label - -on: - issues: - types: [labeled] - -permissions: - issues: write - -jobs: - add-to-project: - runs-on: ubuntu-latest - - steps: - - name: "good first issue" - if: "${{ github.event.label.name == 'good first issue' }}" - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} - run: | - ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") - gh project item-add 5 --owner JabRef --url $ISSUE_URL - - name: needs-refinement - if: github.event.label.name == 'needs-refinement' - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} - run: | - ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") - gh project item-add 15 --owner JabRef --url $ISSUE_URL - - name: "status: freeze" - if: "${{ github.event.label.name == 'status: freeze' }}" - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} - run: | - ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") - gh project item-add 9 --owner JabRef --url $ISSUE_URL - - name: ui - if: "${{ github.event.label.name == 'ui' }}" - env: - GH_DEBUG: api - GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} - run: | - ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") - echo $ISSUE_URL - gh project item-add 8 --owner JabRef --url $ISSUE_URL diff --git a/.github/workflows/assign-issue.yml b/.github/workflows/assign-issue.yml new file mode 100644 index 00000000000..e88f6b762d2 --- /dev/null +++ b/.github/workflows/assign-issue.yml @@ -0,0 +1,56 @@ +name: Assign Issue + +on: + schedule: + - cron: 0 0 * * * + issue_comment: + types: [created] + workflow_dispatch: + +jobs: + assign: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Assign the user or unassign stale assignments + id: assign + uses: takanome-dev/assign-issue-action@beta + with: + github_token: '${{ secrets.GITHUB_TOKEN }}' + days_until_unassign: 30 + maintainers: koppor, Siedlerchr, ThiloteE, calixtus, HoussemNasri + assigned_comment: | + 👋 Hey @{{ handle }}, thank you for your interest in this issue! 🎉 + + We're excited to have you on board. Start by exploring our [Contributing](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md) guidelines, and don't forget to check out our [workspace setup guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace) to get started smoothly. + + In case you encounter failing tests during development, please check our [developer FAQs](https://devdocs.jabref.org/code-howtos/faq.html)! + + Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on [JabRef's Gitter chat](https://gitter.im/JabRef/jabref). And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. + + Happy coding! 🚀 + + ⏳ Please note, you will be automatically unassigned if the issue isn't closed within **{{ total_days }} days** (by **{{ unassigned_date }}**). A maintainer can also add the "**{{ pin_label }}**"" label to prevent automatic unassignment. + - name: Move Issue to "Assigned" Column in "Candidates for University Projects" + if: steps.assign.outputs.assigned == 'yes' + uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/3" + target-labels: "📍 Assigned" + target-column: "Assigned" + ignored-columns: "" + default-column: "Free to take" + skip-if-not-in-project: true + - name: Move Issue to "Assigned" Column in "Good First Issues" + if: steps.assign.outputs.assigned == 'yes' + uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/5" + target-labels: "📍 Assigned" + target-column: "Assigned" + ignored-columns: "" + default-column: "Free to take" + skip-if-not-in-project: true diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 1e5c7011f23..856b3f66b57 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,13 +10,13 @@ jobs: runs-on: ubuntu-latest # Run only if PR is inside JabRef's main repository and created by dependabot or by an update workflow if: > - (github.repository == 'JabRef/jabref') && + (github.repository == 'JabRef/jabref') && (github.event.pull_request.head.repo.full_name == 'JabRef/jabref') && ( (github.actor == 'dependabot[bot]') || ( - startsWith(github.event.pull_request.title, '[Bot] ') || - startsWith(github.event.pull_request.title, 'Bump ') || + startsWith(github.event.pull_request.title, '[Bot] ') || + startsWith(github.event.pull_request.title, 'Bump ') || startsWith(github.event.pull_request.title, 'New Crowdin updates') || startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from') ) @@ -26,9 +26,9 @@ jobs: run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}} + GH_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}} - name: Merge PR run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}} + GH_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}} diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index ccb056e9bec..67881841c46 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -31,7 +31,7 @@ jobs: restore-keys: cache-lychee- - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@v1.10.0 + uses: lycheeverse/lychee-action@v2.0.2 with: fail: true args: --accept '200,201,202,203,204,403,429,500' --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md' diff --git a/.github/workflows/cleanup-pr.yml b/.github/workflows/cleanup-pr.yml index fae66fb01c7..bd38e11ea16 100644 --- a/.github/workflows/cleanup-pr.yml +++ b/.github/workflows/cleanup-pr.yml @@ -37,8 +37,8 @@ jobs: key: ${{ secrets.buildJabRefPrivateKey }} - name: Update PR comment if: steps.checksecrets.outputs.secretspresent == 'YES' - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@v3 with: - comment_tag: download-link + comment-tag: download-link message: The build for this PR is no longer available. Please visit for the latest build. mode: upsert diff --git a/.github/workflows/deployment-arm64.yml b/.github/workflows/deployment-arm64.yml index a160ec1c244..cd360c1f474 100644 --- a/.github/workflows/deployment-arm64.yml +++ b/.github/workflows/deployment-arm64.yml @@ -205,7 +205,7 @@ jobs: if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'ubuntu-latest') || ((matrix.os == 'macos-14') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)))) }} shell: bash run: | - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true - name: Upload to GitHub workflow artifacts store (macOS) if: (matrix.os == 'macos-14') && (steps.checksecrets.outputs.secretspresent == 'YES') && (startsWith(github.ref, 'refs/tags/') || inputs.notarization == true) uses: actions/upload-artifact@v4 diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index fb2c15fcf7d..2bc7390f568 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -266,7 +266,7 @@ jobs: shell: cmd # for rsync installed by chocolatey, we need the ssh.exe delivered with that installation run: | - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/jdk-ea && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/jdk-ea/ || true - name: Upload to builds.jabref.org (linux, macOS) if: (matrix.os != 'windows-latest') && (steps.checksecrets.outputs.secretspresent == 'YES') && (github.ref == 'refs/heads/main') shell: bash diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7bd460fd4d6..e6796073e08 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -242,7 +242,7 @@ jobs: shell: cmd # for rsync installed by chocolatey, we need the ssh.exe delivered with that installation run: | - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'C:\ProgramData\chocolatey\lib\rsync\tools\bin\ssh.exe -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true - name: Upload to builds.jabref.org (linux, macOS) # macOS: Negated condition of "Upload to GitHub workflow artifacts store (macOS)" # Reason: We either upload the non-notarized files - or notarize the files later (and upload these later) @@ -250,7 +250,7 @@ jobs: if: ${{ (!startsWith(github.ref, 'refs/heads/gh-readonly-queue')) && (steps.checksecrets.outputs.secretspresent == 'YES') && ((matrix.os == 'ubuntu-latest') || ((matrix.os == 'macos-13') && !((startsWith(github.ref, 'refs/tags/') || inputs.notarization == true)))) }} shell: bash run: | - rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ + rsync -rt --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --itemize-changes --stats --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" -e 'ssh -p 9922 -i sshkey -o StrictHostKeyChecking=no' build/distribution/ jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ || true - name: Upload to GitHub workflow artifacts store (macOS) if: (matrix.os == 'macos-13') && (steps.checksecrets.outputs.secretspresent == 'YES') && (startsWith(github.ref, 'refs/tags/') || inputs.notarization == true) uses: actions/upload-artifact@v4 @@ -287,11 +287,11 @@ jobs: BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} - name: Comment PR if: (steps.checksecrets.outputs.secretspresent == 'YES') - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@v3 with: message: | The build of this PR is available at . - comment_tag: download-link + comment-tag: download-link mode: recreate notarize: # outsourced in a separate job to be able to rerun if this fails for timeouts name: macOS notarization diff --git a/.github/workflows/on-labeled-issue.yml b/.github/workflows/on-labeled-issue.yml new file mode 100644 index 00000000000..8839eca84b7 --- /dev/null +++ b/.github/workflows/on-labeled-issue.yml @@ -0,0 +1,96 @@ +name: On labeled issue + +on: + issues: + types: + - labeled + +jobs: + FirstTimeCodeContribution: + if: ${{ github.event.label.name == 'FirstTimeCodeContribution' }} + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: GreetingFirstTimeCodeContribution + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} + body: | + Welcome to the vibrant world of open-source development with JabRef! + + Newcomers, we're excited to have you on board. Start by exploring our [Contributing](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md) guidelines, and don't forget to check out our [workspace setup guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace) to get started smoothly. + + In case you encounter failing tests during development, please check our [developer FAQs](https://devdocs.jabref.org/code-howtos/faq.html)! + + Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on [JabRef's Gitter chat](https://gitter.im/JabRef/jabref). And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. + + ⚠ Note that this issue will become unassigned if it isn't closed within **30 days**. + + 🔧 A maintainer can also add the **`Pinned`** label to prevent it from being unassigned automatically. + + Happy coding! 🚀 + - name: Move Issue to "Assigned" Column in "Candidates for University Projects" + uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/3" + target-labels: "📍 Assigned" + target-column: "Assigned" + ignored-columns: "" + default-column: "Free to take" + skip-if-not-in-project: true + - name: Move Issue to "Assigned" Column in "Good First Issues" + uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/5" + target-labels: "📍 Assigned" + target-column: "Assigned" + ignored-columns: "" + default-column: "Free to take" + skip-if-not-in-project: true + good-first-issue: + name: "good first issue" + if: "${{ github.event.label.name == 'good first issue' }}" + runs-on: ubuntu-latest + steps: + - name: "good first issue" + env: + GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} + run: | + ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") + gh project item-add 5 --owner JabRef --url $ISSUE_URL + needs-refinement: + if: github.event.label.name == 'needs-refinement' + runs-on: ubuntu-latest + steps: + - name: needs-refinement + env: + GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} + run: | + ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") + gh project item-add 15 --owner JabRef --url $ISSUE_URL + status-freeze: + name: "status: freeze" + if: "${{ github.event.label.name == 'status: freeze' }}" + runs-on: ubuntu-latest + steps: + - name: "status: freeze" + env: + GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} + run: | + ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") + gh project item-add 9 --owner JabRef --url $ISSUE_URL + ui: + if: "${{ github.event.label.name == 'ui' }}" + runs-on: ubuntu-latest + steps: + - name: ui + env: + GH_DEBUG: api + GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }} + run: | + ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH") + echo $ISSUE_URL + gh project item-add 8 --owner JabRef --url $ISSUE_URL diff --git a/.github/workflows/on-labeled-pr.yml b/.github/workflows/on-labeled-pr.yml new file mode 100644 index 00000000000..4ceb3844fe7 --- /dev/null +++ b/.github/workflows/on-labeled-pr.yml @@ -0,0 +1,23 @@ +name: On labeled PR + +on: + pull_request: + types: + - labeled + +jobs: + automerge: + name: Auto Merge + if: "${{ github.event.label.name == 'automerge' }}" + runs-on: ubuntu-latest + steps: + - name: Approve PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}} + - name: Merge PR + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}} diff --git a/.github/workflows/on-unlabeled-issue.yml b/.github/workflows/on-unlabeled-issue.yml new file mode 100644 index 00000000000..9c5870066ca --- /dev/null +++ b/.github/workflows/on-unlabeled-issue.yml @@ -0,0 +1,34 @@ +name: On unlabeled issue + +on: + issues: + types: + - unlabeled + +jobs: + FirstTimeCodeContribution_or_Assigned: + if: ${{ (github.event.label.name == 'FirstTimeCodeContribution') || (github.event.label.name == '📍 Assigned') }} + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Move Issue to "Free to take" Column in "Candidates for University Projects" + uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/3" + target-labels: "📍 Assigned" + target-column: "Assigned" + ignored-columns: "" + default-column: "Free to take" + skip-if-not-in-project: true + - name: Move Issue to "Free to take" Column in "Good First Issues" + uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/5" + target-labels: "📍 Assigned" + target-column: "Assigned" + ignored-columns: "" + default-column: "Free to take" + skip-if-not-in-project: true diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0b1f5f0a423..2cf13e04a3f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -6,6 +6,8 @@ on: - 'docs/**' - '.github/workflows/pages.yml' push: + branches: + main paths: - 'docs/**' - '.github/workflows/pages.yml' @@ -17,9 +19,8 @@ permissions: pages: write id-token: write -# Allow one concurrent deployment concurrency: - group: "pages" + group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" cancel-in-progress: true jobs: @@ -33,9 +34,9 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' # Not needed with a .ruby-version file + ruby-version: '3.3' # Not needed with a .ruby-version file bundler-cache: true # runs 'bundle install' and caches installed gems automatically - cache-version: 1 # Increment this number if you need to re-download cached gems + cache-version: 0 # Increment this number if you need to re-download cached gems working-directory: docs/ - name: Setup Pages id: pages diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index e3a82fa08ce..c362f5e250a 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -34,15 +34,24 @@ jobs: PR_NUMBER=$(cat pr_number.txt) echo "Read PR number $PR_NUMBER" echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT - - name: Checkout + - name: Determine owner if: ${{ steps.read-pr_number.outputs.pr_number != '' }} + id: owner + run: | + owner=$(gh pr view $pr_number --json headRepositoryOwner --jq '.headRepositoryOwner') + echo "Got owner $owner" + echo owner=$owner >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + - name: Checkout + if: ${{ (steps.read-pr_number.outputs.pr_number != '') && (steps.owner.owner != 'JabRef') }} uses: actions/checkout@v4 with: fetch-depth: '0' show-progress: 'false' token: ${{ secrets.GITHUB_TOKEN }} - name: jbang - if: ${{ steps.read-pr_number.outputs.pr_number != '' }} + if: ${{ (steps.read-pr_number.outputs.pr_number != '') && (steps.owner.owner != 'JabRef') }} uses: jbangdev/jbang-action@v0.119.0 with: script: ghprcomment@koppor/ghprcomment diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index de37898ff70..31a8c063e16 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -347,6 +347,8 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - run: ./gradlew traceRequirements + - if: failure() + run: cat build/reports/tracing.txt # This is https://github.com/marketplace/actions/gradle-wrapper-validation # It ensures that the jar file is from gradle and not by a strange third party. @@ -378,7 +380,7 @@ jobs: uses: actions/github-script@v7 with: script: | - core.setFailed('Pull requests should come from a branch other than "main"\n\n👉 Please read https://devdocs.jabref.org/contributing again carefully. 👈') + core.setFailed('Pull requests should come from a branch other than "main"\n\n👉 Please read [the CONTRIBUTING guide](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md#contributing) carefully again. 👈') upload-pr-number: runs-on: ubuntu-latest diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 972ebae9d71..d9b2c4ab386 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ "davidanson.vscode-markdownlint", - "valentjn.vscode-ltex" + "ltex-plus.vscode-ltex-plus" ] } diff --git a/.vscode/ltex.dictionary.en-US.txt b/.vscode/ltex.dictionary.en-US.txt index 1345f479d73..b39ebc75eeb 100644 --- a/.vscode/ltex.dictionary.en-US.txt +++ b/.vscode/ltex.dictionary.en-US.txt @@ -2,4 +2,5 @@ Checkstyle CouchDB JabDrive JabRef +OpenFastTrace OpenRewrite diff --git a/CHANGELOG.md b/CHANGELOG.md index e7dfa68336c..34ff63dda43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,6 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv ### Added - We added a "view as BibTeX" option before importing an entry from the citation relation tab. [#11826](https://github.com/JabRef/jabref/issues/11826) -- We added probable search hits instead of exact matches. Sorting by hit score can be done by the new score table column. [#11542](https://github.com/JabRef/jabref/pull/11542) - We added support finding LaTeX-encoded special characters based on plain Unicode and vice versa. [#11542](https://github.com/JabRef/jabref/pull/11542) - When a search hits a file, the file icon of that entry is changed accordingly. [#11542](https://github.com/JabRef/jabref/pull/11542) - We added an AI-based chat for entries with linked PDF files. [#11430](https://github.com/JabRef/jabref/pull/11430) @@ -31,14 +30,19 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We added a switch not to store the linked file URL, because it caused troubles at other apps. [#11735](https://github.com/JabRef/jabref/pull/11735) - When starting a new SLR, the selected catalogs now persist within and across JabRef sessions. [koppor#614](https://github.com/koppor/jabref/issues/614) - We added support for drag'n'drop on an entry in the maintable to an external application to get the entry preview dropped. [#11846](https://github.com/JabRef/jabref/pull/11846) +- We added the functionality to double click on a [LaTeX citation](https://docs.jabref.org/advanced/entryeditor/latex-citations) to jump to the respective line in the LaTeX editor. [#11996](https://github.com/JabRef/jabref/issues/11996) - We added a different background color to the search bar to indicate when the search syntax is wrong. [#11658](https://github.com/JabRef/jabref/pull/11658) - We added a setting which always adds the literal "Cited on pages" text before each JStyle citation. [#11691](https://github.com/JabRef/jabref/pull/11732) - We added a new plain citation parser that uses LLMs. [#11825](https://github.com/JabRef/jabref/issues/11825) +- We added support for modifier keys when dropping a file on an entry in the main table. [#12001](https://github.com/JabRef/jabref/pull/12001) +- We added an importer for SSRN URLs. [#12021](https://github.com/JabRef/jabref/pull/12021) +- We added a compare button to the duplicates in the citation relations tab to open the "Possible duplicate entries" window. [#11192](https://github.com/JabRef/jabref/issues/11192) +- We added automatic browser extension install on Windows for Chrome and Edge. [#6076](https://github.com/JabRef/jabref/issues/6076) +- We added a search bar for filtering keyboard shortcuts. [#11686](https://github.com/JabRef/jabref/issues/11686) +- By double clicking on a local citation in the Citation Relations Tab you can now jump the linked entry. [#11955](https://github.com/JabRef/jabref/pull/11955) ### Changed -- The search syntax is changed to [Apache Lucene syntax](https://lucene.apache.org/core/9_11_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Overview) (also to be similar to the [online search syntax](https://docs.jabref.org/collect/import-using-online-bibliographic-database#search-syntax)). [#11542](https://github.com/JabRef/jabref/pull/11542/) -- When searching using a regular expression, one needs to enclose the search string in `/`. [#11542](https://github.com/JabRef/jabref/pull/11542/) - A search in "any" fields ignores the [groups](https://docs.jabref.org/finding-sorting-and-cleaning-entries/groups). [#7996](https://github.com/JabRef/jabref/issues/7996) - When a communication error with an [online service](https://docs.jabref.org/collect/import-using-online-bibliographic-database) occurs, JabRef displays the HTTP error. [#11223](https://github.com/JabRef/jabref/issues/11223) - The Pubmed/Medline Plain importer now imports the PMID field as well [#11488](https://github.com/JabRef/jabref/issues/11488) @@ -46,9 +50,12 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - JabRef respects the [configuration for storing files relative to the .bib file](https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files) in more cases. [#11492](https://github.com/JabRef/jabref/pull/11492) - JabRef does not show finished background tasks in the status bar popup. [#11821](https://github.com/JabRef/jabref/pull/11821) - We enhanced the indexing speed. [#11502](https://github.com/JabRef/jabref/pull/11502) +- When dropping a file into the main table, after copy or move, the file is now put in the [configured directory and renamed according to the configured patterns](https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#filename-format-and-file-directory-pattern). [#12001](https://github.com/JabRef/jabref/pull/12001) - ⚠️ Renamed command line parameters `embeddBibfileInPdf` to `embedBibFileInPdf`, `writeMetadatatoPdf` to `writeMetadataToPdf`, and `writeXMPtoPdf` to `writeXmpToPdf`. [#11575](https://github.com/JabRef/jabref/pull/11575) - The browse button for a Custom theme now opens in the directory of the current used CSS file. [#11597](https://github.com/JabRef/jabref/pull/11597) - The browse button for a Custom exporter now opens in the directory of the current used exporter file. [#11717](https://github.com/JabRef/jabref/pull/11717) +- ⚠️ We relaxed the escaping requirements for [bracketed patterns](https://docs.jabref.org/setup/citationkeypatterns), which are used for the [citaton key generator](https://docs.jabref.org/advanced/entryeditor#autogenerate-citation-key) and [filename and directory patterns](https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#auto-linking-files). One only needs to write `\"` if a quote sign should be escaped. All other escapings are not necessary (and working) any more. [#11967](https://github.com/JabRef/jabref/pull/11967) +- When importing BibTeX data starging from on a PDF, the XMP metadata takes precedence over Grobid data. [#11992](https://github.com/JabRef/jabref/pull/11992) - JabRef now uses TLS 1.2 for all HTTPS connections. [#11852](https://github.com/JabRef/jabref/pull/11852) - We improved the display of long messages in the integrity check dialog. [#11619](https://github.com/JabRef/jabref/pull/11619) - We improved the undo/redo buttons in the main toolbar and main menu to be disabled when there is nothing to undo/redo. [#8807](https://github.com/JabRef/jabref/issues/8807) @@ -57,6 +64,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - When fulltext search is selected but indexing is deactivated, a dialog is now shown asking if the user wants to enable indexing now [#9491](https://github.com/JabRef/jabref/issues/9491) - We changed instances of 'Search Selected' to 'Search Pre-configured' in Web Search Preferences UI. [#11871](https://github.com/JabRef/jabref/pull/11871) - We added a new CSS style class `main-table` for the main table. [#11881](https://github.com/JabRef/jabref/pull/11881) +- When renaming a file, the old extension is now used if there is none provided in the new name. [#11903](https://github.com/JabRef/jabref/issues/11903) +- We changed the name of the library-based file directory from 'General File Directory' to 'Library-specific File Directory' per issue [#571](https://github.com/koppor/jabref/issues/571) ### Fixed @@ -85,16 +94,21 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where unescaped braces in the arXiv fetcher were not treated. [#11704](https://github.com/JabRef/jabref/issues/11704) - We fixed an issue where HTML instead of the fulltext pdf was downloaded when importing arXiv entries. [#4913](https://github.com/JabRef/jabref/issues/4913) - We fixed an issue where the keywords and crossref fields were not properly focused. [#11177](https://github.com/JabRef/jabref/issues/11177) +- We fixed handling of `\"` in [bracketed patterns](https://docs.jabref.org/setup/citationkeypatterns) containing a RegEx. [#11967](https://github.com/JabRef/jabref/pull/11967) - We fixed an issue where the Undo/Redo buttons were active even when all libraries are closed. [#11837](https://github.com/JabRef/jabref/issues/11837) - We fixed an issue where recently opened files were not displayed in the main menu properly. [#9042](https://github.com/JabRef/jabref/issues/9042) - We fixed an issue where the DOI lookup would show an error when a DOI was found for an entry. [#11850](https://github.com/JabRef/jabref/issues/11850) +- We fixed an issue where Tab cannot be used to jump to next field in some single-line fields. [#11785](https://github.com/JabRef/jabref/issues/11785) +- We fixed an issue where it was not possible to select selecting content of other user's comments.[#11106](https://github.com/JabRef/jabref/issues/11106) +- We fixed an issue where web search preferences "Custom API key" table modifications not discarded. [#11925](https://github.com/JabRef/jabref/issues/11925) +- We fixed an issue where trying to open a library from a failed mounted directory on Mac would cause an error. [#10548](https://github.com/JabRef/jabref/issues/10548) - We fixed an issue where the response from the local ai model is cuttoff.[#11870](https://github.com/JabRef/jabref/issues/11870) + ### Removed -- We removed support for case-sensitive and exact search. [#11542](https://github.com/JabRef/jabref/pull/11542) - We removed the description of search strings. [#11542](https://github.com/JabRef/jabref/pull/11542) - We removed support for importing using the SilverPlatterImporter (`Record INSPEC`). [#11576](https://github.com/JabRef/jabref/pull/11576) - +- We removed support for automatically generating file links using the CLI (`--automaticallySetFileLinks`). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4aebe4a5b6b..e0efbdd98f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,198 @@ # Contributing -When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. +General overview about contributing for non-programmers is available at . -Support on **code contribution** is available at . +We welcome contributions to JabRef and encourage you to follow the GitHub workflow specified below. +If you are not familiar with this type of workflow, take a look at GitHub's excellent overview on the [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow) and the explanation of [Feature Branch Workflow](https://atlassian.com/git/tutorials/comparing-workflows#feature-branch-workflow) for the idea behind this kind of development. -General overview about contributing for programmers and non-programmers is available at . +Before you start, get the JabRef code on your local machine. +Detailed instructions about this step can be found in our [guidelines for setting up a local workspace](getting-into-the-code/guidelines-for-setting-up-a-local-workspace/). + +## Table of Contents + +* [Choosing a task](#choosing-a-task-) +* [Getting a task assigned](#getting-a-task-assigned) +* [Pull Request Process](#pull-request-process) + * [Requirements on the pull request and code](#requirements-on-the-pull-request-and-code) + * [After submission of a pull request](#after-submission-of-a-pull-request) + * [Development hints](#development-hints) + +## Choosing a task [![Join the chat at https://gitter.im/JabRef/jabref](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JabRef/jabref) + +In general, we offer small issues perfect for aspiring developers. +These tasks provide an opportunity to learn how to set up your local workspace, create your first pull request on GitHub, and contribute towards solving minor problems or making small enhancements in JabRef. + +It is essential to note that JabRef's issues vary in difficulty. +Some are simpler, while others are more complex. Our primary aim is to guide you through the code, ensuring that the understanding scope remains manageable. Sometimes, grasping the code might demand more effort than actually writing lines of code. + +### I am a student and I want to start with something easy + +We collect good issues to start with at our [list of good first issues](https://github.com/orgs/JabRef/projects/5/views/1). + +### I am a student and I want to choose from a curated list of university projects + +Take a look at [JabRef's candidates for university projects](https://github.com/orgs/JabRef/projects/3). There, a list of possible projects to work on during a teaching period is offered. + +### I am a lecturer + +If you ask yourself how to integrate JabRef into your class, please read the [documentation about how to integrate JabRef into a class of software engineering training](https://devdocs.jabref.org/teaching.html#jabref-and-software-engineering-training). +As student, you may notify your lecturer about this possibility. + +### I want something with huge impact + +Look at the discussions in our forum about [new features](https://discourse.jabref.org/c/features/6). +Find an interesting topic, discuss it and start contributing. +Alternatively, you can check out [JabRef's projects page at GitHub](https://github.com/JabRef/jabref/projects?query=is%3Aopen). +Although, of course, you can choose to work on ANY issue, choosing from the projects page has the advantage that these issues have already been categorized, sorted and screened by JabRef maintainers. +A typical subclassifications scheme is "priority" (high, normal and low). Fixing high priority issues is preferred. + +### I want to know how to contribute code and set up my workspace + +Check out the [documentation for developers](https://devdocs.jabref.org/contributing.html#contribute-code) + +### I want to improve the developer's documentation + +For improving developer's documentation, go on at the [docs/ subdirectory of JabRef's code](https://github.com/JabRef/jabref/tree/main/docs) and edit the file. +GitHub offers a good guide at [Editing files in another user's repository](https://help.github.com/en/github/managing-files-in-a-repository/editing-files-in-another-users-repository). +One can also add [callouts](https://just-the-docs.github.io/just-the-docs-tests/components/callouts/). + +## Getting a task assigned + +Comment on the issue you want to work at with `/assign-me`. +GitHub will then automatically assign you. ## Pull Request Process -1. Understand the basics listed at . -2. Follow the "formal requirements". They are not too hard, they merely support the maintainers to focus on supportive feedback than just stating the obvious. They also have helpful hints how to work with localization. -3. Create a pull request. You can create a draft pull request to enable automatic checks. -4. Wait for feedback of the developers -5. Address the feedback of the developers -6. After two developers gave their green flag, the pull request will be merged. +1. Follow the steps at [Pre Condition 3: Code on the local machine](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/pre-03-code.html) to a) create a fork and b) have the fork checked out on your local machine +2. Ensure that you followed the [steps to set up a local workspace](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/) to have the code running properly in IntelliJ. +3. **Create a new branch** (such as `fix-for-issue-121`). Be sure to create a **separate branch** for each improvement you implement. +4. Work on the **new branch — not the `main` branch.** Refer to our [code how-tos](https://devdocs.jabref.org/code-howtos) if you have questions about your implementation. +5. Create a [pull request to JabRef main repository](https://github.com/JabRef/jabref/pulls). + For an overview on the concept of pull requests, take a look at GitHub's [pull request help documentation](https://help.github.com/articles/about-pull-requests/). + 1. Ensure that you followed the requirements listed below. They are not too hard, they merely support the maintainers to focus on supportive feedback than just stating the obvious. + 2. For text inspirations, consider [How to write the perfect pull request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request). + 3. In case your pull request is not yet complete or not yet ready for review, create a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) instead. +6. Wait for feedback of the developers +7. Address the feedback of the developers +8. After two developers gave their green flag, the pull request will be merged. + +In case you have any questions, please + +1. comment on the issue, +2. show up in our [Gitter chat](https://gitter.im/JabRef/jabref), or +3. show your current code using a draft pull request and ask questions. + +We favor looking into your code using a draft pull request, because we can then also load the code into our IDE. +As counterexample, if you provide us with a screenshot of your changes, we cannot run it in our IDE. + +### Requirements on the pull request and code + +#### Test your code + +We know that writing test cases takes a lot of time. +Nevertheless, we rely on our test cases to ensure that a bug fix or a feature implementation does not break anything. + +For UI changes, we know that test cases are hard to write. +Therefore, you can omit them. +However, please at least add a screenshot showing your changes to the request. + + + +#### Write a good commit message + +See [good commit message](https://github.com/joelparkerhenderson/git-commit-message) or [commit guidelines section of Pro Git](http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines). For the curious: [Why good commit messages matter!](https://cbea.ms/git-commit/). The first line of your commit message is automatically taken as the title for the pull-request. All other lines make up the body of the pull request. Add the words `fixes #xxx` to your PR to auto-close the corresponding issue. + +#### Add your change to `CHANGELOG.md` + +You should edit the [`CHANGELOG.md`](https://github.com/JabRef/jabref/blob/main/CHANGELOG.md#changelog) file located in the root directory of the JabRef source. Add a line with your changes in the appropriate section. + +If you did internal refactorings or improvements not visible to the user (e.g., UI, .bib file), then you don't need to put an entry there. + +#### Author credits + +Please, **do not add yourself at JavaDoc's `@authors`**. +The contribution information is tracked via the version control system and shown at [https://github.com/JabRef/jabref/graphs/contributors](https://github.com/JabRef/jabref/graphs/contributors). +We also show all contributors in our blog posts. See [Release 5.15 blog post](https://blog.jabref.org/2024/07/16/JabRef5-15/) for an example. + +Your contribution is considered being made under [MIT license](https://tldrlegal.com/license/mit-license). + +#### Notes on AI usage + +Please keep these two principles in mind when you contribute: + +1. Never let an LLM speak for you. +2. Never let an LLM think for you. + +More reading on that is available at . + +We reserve the right to reject pull requests that contain little or no genuine and original contribution from the contributor. + +### After submission of a pull request + +After you submitted a pull request, automated checks will run. +You may see "Some checks were not successful". +You can click on failing checks to see more information about why they failed. +Then, please look into them and handle accordingly. + +Afterwards, you will receive comments on your pull request. +The pull request may be approved immediatly, or a reviewer may request changes. +In that case, please implement the requested changes. + +After implementing changes, commit to the branch your pull request is *from* and push. +The pull request will automatically be updated with your changes. +Your commits will also be automatically squashed upon the pull request being accepted. + +Please – **Never ever close a pull request and open a new one** - +This causes unessesary work on our side, and is not in the the style of the GitHub open source community. +You can push any changes you need to make to the branch your pull request is *from*. +These changes will be automatically added to your pull request. + +### Development hints + +#### When adding an external dependency + +Please try to use a version available at JCenter and add it to `build.gradle`. +In any case, describe the library at [`external-libraries.md`](https://github.com/JabRef/jabref/blob/main/external-libraries.md#external-libraries). +We need that information for our package maintainers (e.g., those of the [debian package](https://tracker.debian.org/pkg/jabref)). + +#### When making an architectural decision + +In case you add a library or do major code rewrites, we ask you to document your decision. Recommended reading: [https://adr.github.io/](https://adr.github.io). + +We simply ask to create a new markdown file in `docs/adr` following the template presented at [https://adr.github.io/madr/](https://adr.github.io/madr/). +You can link that ADR using `@ADR({num})` as annotation. + +#### When adding a new `Localization.lang` entry + +Add new `Localization.lang("KEY")` to a Java file. The tests will fail. In the test output a snippet is generated, which must be added to the English translation file. + +Example: + +```text +java.lang.AssertionError: DETECTED LANGUAGE KEYS WHICH ARE NOT IN THE ENGLISH LANGUAGE FILE +PASTE THESE INTO THE ENGLISH LANGUAGE FILE +[ +Opens\ JabRef's\ Twitter\ page=Opens JabRef's Twitter page +] +Expected :[] +Actual :[Opens\ JabRef's\ Twitter\ page (src\main\java\org\jabref\gui\JabRefFrame.java LANG)] +``` + +Add the above snippet to the English translation file located at `src/main/resources/l10n/JabRef_en.properties`. +[Crowdin](https://crowdin.com/project/jabref) will automatically pick up the new string and add it to the other translations. + +You can also directly run the specific test in your IDE. +The test "`LocalizationConsistencyTest`" is placed under `src/test/java/org.jabref.logic.l10n/LocalizationConsistencyTest.java`. +Find more information in the [JabRef developer docs](https://devdocs.jabref.org/code-howtos/localization.html). + +#### **Format of keyboard shortcuts** + +In Markdown files (e.g., `CHANGELOG.md`), sometimes keyboard shortcuts need to be added. +Example: `Ctrl + Enter` + +In case you add keys to the changelog, please follow these rules: + +* `` tag for each key +* First letter of key capitalized +* Combined keys separated by `+` +* Spaces before and after separator `+` diff --git a/build.gradle b/build.gradle index b7b3eef0252..116feba772b 100644 --- a/build.gradle +++ b/build.gradle @@ -29,9 +29,9 @@ plugins { id 'idea' - id 'org.openrewrite.rewrite' version '6.23.4' + id 'org.openrewrite.rewrite' version '6.25.1' - id "org.itsallcode.openfasttrace" version "3.0.0" + id "org.itsallcode.openfasttrace" version "3.0.1" } // Enable following for debugging @@ -142,7 +142,7 @@ dependencyLocking { } javafx { - version = "23" + version = "23.0.1" modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.swing' ] } @@ -166,7 +166,7 @@ dependencies { exclude group: 'commons-logging' } - def luceneVersion = "9.12.0" + def luceneVersion = "10.0.0" implementation "org.apache.lucene:lucene-core:$luceneVersion" implementation "org.apache.lucene:lucene-queryparser:$luceneVersion" implementation "org.apache.lucene:lucene-queries:$luceneVersion" @@ -238,7 +238,7 @@ dependencies { } implementation 'org.fxmisc.flowless:flowless:0.7.3' implementation 'org.fxmisc.richtext:richtextfx:0.11.3' - implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.51.0') { + implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.60.0') { exclude module: 'javax.inject' // Split package, use only jakarta.inject exclude module: 'commons-lang3' exclude group: 'org.apache.commons.validator' @@ -302,16 +302,16 @@ dependencies { // API implementation 'jakarta.ws.rs:jakarta.ws.rs-api:4.0.0' // Implementation of the API - implementation 'org.glassfish.jersey.core:jersey-server:3.1.8' + implementation 'org.glassfish.jersey.core:jersey-server:3.1.9' // injection framework - implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.8' + implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.9' implementation 'org.glassfish.hk2:hk2-api:3.1.1' // testImplementation 'org.glassfish.hk2:hk2-testing:3.0.4' // implementation 'org.glassfish.hk2:hk2-testing-jersey:3.0.4' // testImplementation 'org.glassfish.hk2:hk2-junitrunner:3.0.4' // HTTP server // implementation 'org.glassfish.jersey.containers:jersey-container-netty-http:3.1.1' - implementation 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:3.1.8' + implementation 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:3.1.9' testImplementation 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:3.1.8' // Allow objects "magically" to be mapped to JSON using GSON // implementation 'org.glassfish.jersey.media:jersey-media-json-gson:3.1.1' @@ -370,11 +370,14 @@ dependencies { // Even if "compileOnly" is used, IntelliJ always adds to module-info.java. To avoid issues during committing, we use "implementation" instead of "compileOnly" implementation 'io.github.adr:e-adr:2.0.0-SNAPSHOT' - testImplementation 'io.github.classgraph:classgraph:4.8.176' + implementation 'io.zonky.test:embedded-postgres:2.0.7' + implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:17.0.0') + + testImplementation 'io.github.classgraph:classgraph:4.8.177' testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0' testImplementation 'org.junit.platform:junit-platform-launcher:1.10.3' - testImplementation 'org.mockito:mockito-core:5.14.1' + testImplementation 'org.mockito:mockito-core:5.14.2' testImplementation 'org.xmlunit:xmlunit-core:2.10.0' testImplementation 'org.xmlunit:xmlunit-matchers:2.10.0' testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:1.3.0' @@ -793,9 +796,13 @@ jlink { requires 'org.apache.commons.lang3' requires 'org.apache.commons.logging' requires 'org.apache.commons.text' + requires 'org.apache.commons.codec' + requires 'org.apache.commons.io' + requires 'org.apache.commons.compress' requires 'org.freedesktop.dbus' requires 'org.jsoup' requires 'org.slf4j' + requires 'org.tukaani.xz'; uses 'ai.djl.engine.EngineProvider' uses 'ai.djl.repository.RepositoryFactory' uses 'ai.djl.repository.zoo.ZooProvider' @@ -807,6 +814,7 @@ jlink { uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin' uses 'org.mariadb.jdbc.credential.CredentialPlugin' uses 'org.mariadb.jdbc.tls.TlsSocketPlugin' + uses 'org.postgresql.shaded.com.ongres.stringprep.Profile' provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin' provides 'java.sql.Driver' with 'org.postgresql.Driver' diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index 6ec4cd0ea47..50edbd56165 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit 6ec4cd0ea474313bc39e0d81aae43a9e8b598f21 +Subproject commit 50edbd56165d8efa27be7d06ff1df5d20aa8d2c7 diff --git a/buildres/windows/JabRef-post-image.wsf b/buildres/windows/JabRef-post-image.wsf index afdf92ef0ad..96717d1da55 100644 --- a/buildres/windows/JabRef-post-image.wsf +++ b/buildres/windows/JabRef-post-image.wsf @@ -21,7 +21,7 @@ wxsFile.Close(); // Add registry values for JabRef Browser Extension - contents = contents.replace("", ""); + contents = contents.replace("", ""); // Specify banner contents = contents.replace("", ""); diff --git a/docs/Gemfile b/docs/Gemfile index 289a8081022..c4cfb6ca09b 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,11 +1,11 @@ source 'https://rubygems.org' -gem "jekyll", "~> 4.3" # installed by `gem jekyll` +gem "jekyll", "~> 4.3.4" # installed by `gem jekyll` # Homepage: https://github.com/paulrobertlloyd/jekyll-figure#jekyll-figure gem 'jekyll-figure' -gem "just-the-docs", "0.5.0" +gem "just-the-docs", "0.10.0" gem "jekyll-remote-theme" diff --git a/docs/code-howtos/bibtex.md b/docs/code-howtos/bibtex.md new file mode 100644 index 00000000000..1ab3f3e7a73 --- /dev/null +++ b/docs/code-howtos/bibtex.md @@ -0,0 +1,19 @@ +--- +parent: Code Howtos +--- +# JabRef's handling of BibTeX + +The main class to handle a single BibTeX entry is `org.jabref.model.entry.BibEntry`. +The content of a `.bib` file is handled in `org.jabref.model.database.BibDatabase`. +Things not written in the `.bib` file, but required for handling are stored in `org.jabref.model.database.BibDatabaseContext`. +For instance, this stores the mode of the library, which can be BibTeX or `biblatex`. + +Standard BibTeX fields known to JabRef are modeled in `org.jabref.model.entry.field.StandardField`. +A user-defined field not known to JabRef's code is modelled in `org.jabref.model.entry.field.UnknownField`. +Typically, to get from a String to a `Field`, one needs to use `org.jabref.model.entry.field.FieldFactory#parseField(java.lang.String)`. + +## Cross-references + +BibTeX allows for referencing other entries by the field `crossref` (`org.jabref.model.entry.field.StandardField#CROSSREF`). +Note that BibTeX and `biblatex` handle this differently. +The method `org.jabref.model.entry.BibEntry#getResolvedFieldOrAlias(org.jabref.model.entry.field.Field, org.jabref.model.database.BibDatabase)` handles this difference. diff --git a/docs/code-howtos/fetchers.md b/docs/code-howtos/fetchers.md index b9520cb56be..e10c800b940 100644 --- a/docs/code-howtos/fetchers.md +++ b/docs/code-howtos/fetchers.md @@ -76,10 +76,16 @@ In `build.gradle`, these variables are filled: "springerNatureAPIKey" : System.getenv('SpringerNatureAPIKey') ``` -The `BuildInfo` class reads from that file. +The `BuildInfo` class reads from that file and the key needs to be put into the map of default API keys in `JabRefCliPreferences::getDefaultFetcherKeys`. ```java -new BuildInfo().springerNatureAPIKey +keys.put(SpringerFetcher.FETCHER_NAME, buildInfo.springerNatureAPIKey); +``` + +The fetcher api key can then be obtained by calling the preferences. + +```java +importerPreferences.getApiKey(SpringerFetcher.FETCHER_NAME); ``` When executing `./gradlew run`, gradle executes `processResources` and populates `build/build.properties` accordingly. However, when working directly in the IDE, Eclipse keeps reading `build.properties` from `src/main/resources`. In IntelliJ, the task `JabRef Main` is executing `./gradlew processResources` before running JabRef from the IDE to ensure the `build.properties` is properly populated. diff --git a/docs/code-howtos/http-server.md b/docs/code-howtos/http-server.md index 1543e460fa2..295c02aad40 100644 --- a/docs/code-howtos/http-server.md +++ b/docs/code-howtos/http-server.md @@ -3,7 +3,7 @@ parent: Code Howtos --- # HTTP Server -JabRef has a build in http server. +JabRef has a built-in http server. For example, the resource for a library is implemented at [`org.jabref.http.server.LibraryResource`](https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/http/server/LibraryResource.java). ## Start http server diff --git a/docs/code-howtos/ui-recommendations.md b/docs/code-howtos/ui-recommendations.md index 4121226d666..def73591940 100644 --- a/docs/code-howtos/ui-recommendations.md +++ b/docs/code-howtos/ui-recommendations.md @@ -23,6 +23,8 @@ More information: ### Name your buttons for the actions `req~ui.dialogs.confirmation.naming~1` +Needs: impl + ## Form validation * Only validate input after leaving the field (or after the user stopped typing for some time) diff --git a/docs/contributing.md b/docs/contributing.md index d827129b175..b93fe7b58c7 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -3,114 +3,4 @@ nav_order: 2 --- # Contributing -* After reading through this guide, check out some good first issues to contribute to by going to our [list of good first issues](https://github.com/orgs/JabRef/projects/5/views/1). - We offer small issues perfect for aspiring developers. These tasks provide an opportunity to learn how to set up your local workspace, create your first pull request on GitHub, and contribute towards solving minor problems or making small enhancements in JabRef. It is essential to note that the issues vary in difficulty. Some are simpler, while others are more complex. Our primary aim is to guide you through the code, ensuring that the understanding scope remains manageable. Sometimes, grasping the code might demand more effort than actually writing lines of code. -* In case you are aiming to contribute other improvements, please head over to our [general JabRef contribution page](https://docs.jabref.org/faqcontributing). -* In case you are an instructor and want to use **JabRef as a software engineering example**, please head to [https://devdocs.jabref.org/teaching](https://devdocs.jabref.org/teaching). - -## Contribute code - -### Understanding the basics of code contributions - -We welcome contributions to JabRef and encourage you to follow the GitHub workflow specified below. If you are not familiar with this type of workflow, take a look at GitHub's excellent overview on the [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow) and the explanation of [Feature Branch Workflow](https://atlassian.com/git/tutorials/comparing-workflows#feature-branch-workflow) for the idea behind this kind of development. - -1. Get the JabRef code on your local machine. Detailed instructions about this step can be found in our [guidelines for setting up a local workspace](getting-into-the-code/guidelines-for-setting-up-a-local-workspace/). - 1. Fork the JabRef into your GitHub account. - 2. Clone your forked repository on your local machine. -2. **Create a new branch** (such as `fix-for-issue-121`). Be sure to create a **separate branch** for each improvement you implement. -3. Work on the **new branch — not the `main` branch.** Refer to our [code how-tos](https://devdocs.jabref.org/code-howtos) if you have questions about your implementation. -4. Create a pull request. For an overview of pull requests, take a look at GitHub's [pull request help documentation](https://help.github.com/articles/about-pull-requests/). -5. In case your pull request is not yet complete or not yet ready for review, create a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) instead. - -In case you have any questions, please comment on the issue - or show up in our [gitter chat](https://gitter.im/JabRef/jabref). -Please also help others in case of general questions there. - -### Formal requirements for a pull request - -The main goal of the formal requirements is to provide credit to you and to be able to understand the patch. - -#### Add your change to `CHANGELOG.md` - -You should edit the [`CHANGELOG.md`](https://github.com/JabRef/jabref/blob/main/CHANGELOG.md#changelog) file located in the root directory of the JabRef source. Add a line with your changes in the appropriate section. - -If you did internal refactorings or improvements not visible to the user (e.g., UI, .bib file), then you don't need to put an entry there. - -#### **Format of keyboard shortcuts** - -Example: `Ctrl + Enter` - -In case you add keys to the changelog, please follow these rules: - -* `` tag for each key -* First letter of key capitalized -* Combined keys separated by `+` -* Spaces before and after separator `+` - -#### Author credits - -Please, **do not add yourself at JavaDoc's `@authors`**. The contribution information is tracked via the version control system and shown at [https://github.com/JabRef/jabref/graphs/contributors](https://github.com/JabRef/jabref/graphs/contributors). We also link to the contributors page in our about dialog. - -Your contribution is considered being made under [MIT license](https://tldrlegal.com/license/mit-license). - -#### Write a good commit message - -See [good commit message](https://github.com/joelparkerhenderson/git-commit-message) or [commit guidelines section of Pro Git](http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines). For the curious: [Why good commit messages matter!](https://cbea.ms/git-commit/). The first line of your commit message is automatically taken as the title for the pull-request. All other lines make up the body of the pull request. Add the words `fixes #xxx` to your PR to auto-close the corresponding issue. - -#### Test your code - -We know that writing test cases takes a lot of time. Nevertheless, we rely on our test cases to ensure that a bug fix or a feature implementation doesn't break anything. In case you do not have time to add a test case, we nevertheless ask you to at least run `gradlew check` to ensure that your change doesn't break anything else. - -#### When adding a new `Localization.lang` entry - -Add new `Localization.lang("KEY")` to a Java file. The tests will fail. In the test output a snippet is generated, which must be added to the English translation file. - -Example: - -```text -java.lang.AssertionError: DETECTED LANGUAGE KEYS WHICH ARE NOT IN THE ENGLISH LANGUAGE FILE -PASTE THESE INTO THE ENGLISH LANGUAGE FILE -[ -Opens\ JabRef's\ Twitter\ page=Opens JabRef's Twitter page -] -Expected :[] -Actual :[Opens\ JabRef's\ Twitter\ page (src\main\java\org\jabref\gui\JabRefFrame.java LANG)] -``` - -Add the above snippet to the English translation file located at `src/main/resources/l10n/JabRef_en.properties`. [Crowdin](https://crowdin.com/project/jabref) will automatically pick up the new string and add it to the other translations. - -You can also directly run the specific test in your IDE. The test "LocalizationConsistencyTest" is placed under `src/test/java/org.jabref.logic.l10n/LocalizationConsistencyTest.java`. Find more information in the [JabRef developer docs](code-howtos/localization.md). - -#### When adding a library - -Please try to use a version available at JCenter and add it to `build.gradle`. In any case, describe the library at [`external-libraries.md`](https://github.com/JabRef/jabref/blob/main/external-libraries.md#external-libraries). We need that information for our package maintainers (e.g., those of the [debian package](https://tracker.debian.org/pkg/jabref)). Also add a txt file stating the license in `libraries/`. It is used at `gradlew processResources` to generate the About.html files. You can see the result in `build\resources\main\help\en\About.html` or when clicking Help -> About. - -#### When making an architectural decision - -In case you add a library or do major code rewrites, we ask you to document your decision. Recommended reading: [https://adr.github.io/](https://adr.github.io). - -We simply ask to create a new markdown file in `docs/adr` following the template presented at [https://adr.github.io/madr/](https://adr.github.io/madr/). - -In case you want to directly add a comment to a class, simply use the following template (based on [sustainable architectural decisions](https://www.infoq.com/articles/sustainable-architectural-design-decisions)): - -```text -In the context of , -facing -we decided for