diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 16199f2abf7..fc055df043f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,6 +13,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/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..70c89775742 --- /dev/null +++ b/.github/workflows/assign-issue.yml @@ -0,0 +1,34 @@ +name: Assign Issue + +on: + schedule: + - cron: 0 0 * * * + issue_comment: + types: [created] + workflow_dispatch: + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - name: Assign the user or unassign stale assignments + uses: takanome-dev/assign-issue-action@v2.1.1 + with: + github_token: '${{ secrets.GITHUB_TOKEN }}' + days_until_unassign: 30 + assigned_comment: | + 👋 Hey @{{ comment.user.login }}, + + Thanks for your interest in this issue! 🎉 + + 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 **{{ totalDays }} days**. + + 🔧 A maintainer can also add the **{{ inputs.pin_label }}** label to prevent it from being unassigned automatically. + + Happy coding! 🚀 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..5c816f920fa 100644 --- a/.github/workflows/cleanup-pr.yml +++ b/.github/workflows/cleanup-pr.yml @@ -37,7 +37,7 @@ 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 message: The build for this PR is no longer available. Please visit for the latest build. diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7bd460fd4d6..0b015838d63 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -287,7 +287,7 @@ 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 . diff --git a/.github/workflows/on-labeled.yml b/.github/workflows/on-labeled.yml new file mode 100644 index 00000000000..e90a9d32599 --- /dev/null +++ b/.github/workflows/on-labeled.yml @@ -0,0 +1,114 @@ +name: On labeled + +on: + issues: + types: + - labeled + pull_request_target: + 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. + + Happy coding! 🚀 + - name: Move Issue to "Assigned" Column in "Candidates for University Projects" + uses: m7kvqbe1/github-action-move-issues@v1.0.9 + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/3" + target-labels: "FirstTimeCodeContribution" + target-column: "Assigned" + ignored-columns: "" + - name: Move Issue to "Assigned" Column in "Good First Issues" + uses: m7kvqbe1/github-action-move-issues@v1.0.9 + with: + github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }} + project-url: "https://github.com/orgs/JabRef/projects/5" + target-labels: "FirstTimeCodeContribution" + target-column: "Assigned" + ignored-columns: "" + Assigned: + name: "📍 Assigned" + if: ${{ github.event.label.name == '📍 Assigned' }} + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Move Issue to "Assigned" Column in "Candidates for University Projects" + uses: m7kvqbe1/github-action-move-issues@v1.0.9 + 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: "" + - name: Move Issue to "Assigned" Column in "Good First Issues" + uses: m7kvqbe1/github-action-move-issues@v1.0.9 + 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: "" + 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-unlabeled.yml b/.github/workflows/on-unlabeled.yml new file mode 100644 index 00000000000..aca9773385c --- /dev/null +++ b/.github/workflows/on-unlabeled.yml @@ -0,0 +1,35 @@ +name: On unlabeled + +on: + issues: + types: + - unlabeled + pull_request_target: + 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/default-column-label-remove + 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" + - name: Move Issue to "Free to take" Column in "Good First Issues" + uses: m7kvqbe1/github-action-move-issues@feat/default-column-label-remove + 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" 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/CHANGELOG.md b/CHANGELOG.md index a404f7e9e17..aa487a1574a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - 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 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 the linked entry. [#11955](https://github.com/JabRef/jabref/pull/11955) ### Changed @@ -58,9 +60,11 @@ 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) ### Fixed +- We fixed an issue where certain actions were not disabled when no libraries were open. [#11923](https://github.com/JabRef/jabref/issues/11923) - We fixed an issue where the "Check for updates" preference was not saved. [#11485](https://github.com/JabRef/jabref/pull/11485) - We fixed an issue where an exception was thrown after changing "show preview as a tab" in the preferences. [#11515](https://github.com/JabRef/jabref/pull/11515) - We fixed an issue where JabRef put file paths as absolute path when an entry was created using drag and drop of a PDF file. [#11173](https://github.com/JabRef/jabref/issues/11173) @@ -88,13 +92,14 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - 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) ### 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..90f735fa4a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,175 @@ # 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) + * [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. +1. **Create a new branch** (such as `fix-for-issue-121`). Be sure to create a **separate branch** for each improvement you implement. +2. 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. +3. 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/). + 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. 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. + +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. + +### 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](code-howtos/localization.md). + +#### **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..65b5d22bb38 100644 --- a/build.gradle +++ b/build.gradle @@ -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.58.0') { exclude module: 'javax.inject' // Split package, use only jakarta.inject exclude module: 'commons-lang3' exclude group: 'org.apache.commons.validator' @@ -302,7 +302,7 @@ 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.hk2:hk2-api:3.1.1' @@ -311,7 +311,7 @@ dependencies { // 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,7 +370,7 @@ 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' + 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' diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index 6ec4cd0ea47..d87037495de 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit 6ec4cd0ea474313bc39e0d81aae43a9e8b598f21 +Subproject commit d87037495de7213b896dbb6a20170387de170709 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/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