Skip to content

Commit

Permalink
Merge pull request #5 from JabRef/main
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
arfazhxss authored Sep 16, 2024
2 parents 6f190fc + 3dd1f86 commit 7d3f66c
Show file tree
Hide file tree
Showing 638 changed files with 6,693 additions and 5,817 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,22 @@ jobs:
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

requirements_coverage:
name: "Validate requiremenet coverage"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: 'false'
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.2
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- run: ./gradlew traceRequirements

# 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.
gradlevalidation:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We enabled creating a new file link manually. [#11017](https://github.com/JabRef/jabref/issues/11017)
- We added a toggle button to invert the selected groups. [#9073](https://github.com/JabRef/jabref/issues/9073)
- We reintroduced the floating search in the main table. [#4237](https://github.com/JabRef/jabref/issues/4237)
- We improved [cleanup](https://docs.jabref.org/finding-sorting-and-cleaning-entries/cleanupentries) of `arXiv` IDs in distributed in the fields `note`, `version`, `institution`, and `eid` fields. [#11306](https://github.com/JabRef/jabref/issues/11306)
- 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 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)

### Changed

Expand All @@ -44,6 +47,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- 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 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)

### Fixed

Expand All @@ -65,7 +69,9 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where the full-text search results were incomplete. [#8626](https://github.com/JabRef/jabref/issues/8626)
- We fixed an issue where search result highlighting was incorrectly highlighting the boolean operators. [#11595](https://github.com/JabRef/jabref/issues/11595)
- We fixed an issue where search result highlighting was broken at complex searches. [#8067](https://github.com/JabRef/jabref/issues/8067)
- 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 exception when searching for unlinked files. [#11731](https://github.com/JabRef/jabref/issues/11731)
- We fixed an issue where two contradicting notifications were shown when cutting an entry in the main table. [#11724](https://github.com/JabRef/jabref/pull/11724)
- We fixed an issue where unescaped braces in the arXiv fetcher were not treated. [#11704](https://github.com/JabRef/jabref/issues/11704)

### Removed

Expand Down
77 changes: 39 additions & 38 deletions PRIVACY.md

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ plugins {
id 'idea'

id 'org.openrewrite.rewrite' version '6.20.0'

id "org.itsallcode.openfasttrace" version "3.0.0"
}

// Enable following for debugging
Expand Down Expand Up @@ -236,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.43.0') {
implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.48.0') {
exclude module: 'javax.inject' // Split package, use only jakarta.inject
exclude module: 'commons-lang3'
exclude group: 'org.apache.commons.validator'
Expand Down Expand Up @@ -323,20 +325,21 @@ dependencies {
implementation 'com.github.vatbub:mslinks:1.0.6.2'

// YAML formatting
implementation 'org.yaml:snakeyaml:2.2'
implementation 'org.yaml:snakeyaml:2.3'

// AI
implementation 'dev.langchain4j:langchain4j:0.33.0'
implementation 'dev.langchain4j:langchain4j:0.34.0'
// Even though we use jvm-openai for LLM connection, we still need this package for tokenization.
implementation('dev.langchain4j:langchain4j-open-ai:0.33.0') {
implementation('dev.langchain4j:langchain4j-open-ai:0.34.0') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
implementation('dev.langchain4j:langchain4j-mistral-ai:0.33.0')
implementation('dev.langchain4j:langchain4j-hugging-face:0.33.0')
implementation('dev.langchain4j:langchain4j-mistral-ai:0.34.0')
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.34.0')
implementation('dev.langchain4j:langchain4j-hugging-face:0.34.0')
implementation 'ai.djl:api:0.29.0'
implementation 'ai.djl.pytorch:pytorch-model-zoo:0.29.0'
implementation 'ai.djl.huggingface:tokenizers:0.29.0'
implementation 'io.github.stefanbratanov:jvm-openai:0.10.0'
implementation 'io.github.stefanbratanov:jvm-openai:0.11.0'
// openai depends on okhttp, which needs kotlin - see https://github.com/square/okhttp/issues/5299 for details
implementation ('com.squareup.okhttp3:okhttp:4.12.0') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
Expand Down Expand Up @@ -367,7 +370,7 @@ dependencies {
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'

rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.17.0"))
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.18.0"))
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
Expand Down Expand Up @@ -776,6 +779,7 @@ jlink {
uses 'org.eclipse.jgit.transport.SshSessionFactory'
uses 'org.eclipse.jgit.lib.GpgSigner'
uses 'kong.unirest.core.json.JsonEngine';
uses 'ai.djl.repository.zoo.ZooProvider';
provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin'
provides 'java.sql.Driver' with 'org.postgresql.Driver'
provides 'org.mariadb.jdbc.authentication.AuthenticationPlugin' with 'org.mariadb.jdbc.internal.com.send.authentication.CachingSha2PasswordPlugin',
Expand All @@ -792,7 +796,10 @@ jlink {
provides 'java.security.Provider' with 'org.bouncycastle.jce.provider.BouncyCastleProvider',
'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider'
provides 'kong.unirest.core.json.JsonEngine' with 'kong.unirest.modules.gson.GsonEngine';

provides 'ai.djl.repository.zoo.ZooProvider' with 'ai.djl.engine.rust.zoo.RsZooProvider',
'ai.djl.huggingface.zoo.HfZooProvider',
'ai.djl.pytorch.zoo.PtZooProvider',
'ai.djl.repository.zoo.DefaultZooProvider';
}

jpackage {
Expand Down Expand Up @@ -898,3 +905,7 @@ jmh {
iterations = 10
fork = 2
}

requirementTracing {
inputDirectories = files('docs', 'src/main/java', 'src/test/java')
}
2 changes: 1 addition & 1 deletion buildres/abbrv.jabref.org
4 changes: 2 additions & 2 deletions docs/code-howtos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ JabRef stores files relative to one of [multiple possible directories](https://d
The convert the relative path to an absolute one, there is the `find` method in `FileUtil`:

```java
org.jabref.logic.util.io.FileUtil.find(org.jabref.model.database.BibDatabaseContext, java.lang.String, org.jabref.preferences.FilePreferences)
org.jabref.logic.util.io.FileUtil.find(org.jabref.model.database.BibDatabaseContext, java.lang.String, org.jabref.logic.FilePreferences)
```

`String path` Can be the files name or a relative path to it. The Preferences should only be directly accessed in the GUI. For the usage in logic pass them as parameter
Expand All @@ -59,7 +59,7 @@ When adding a file to a library, the path should be stored relative to "the best
This is implemented in `FileUtil`:

```java
org.jabref.logic.util.io.FileUtil.relativize(java.nio.file.Path, org.jabref.model.database.BibDatabaseContext, org.jabref.preferences.FilePreferences)
org.jabref.logic.util.io.FileUtil.relativize(java.nio.file.Path, org.jabref.model.database.BibDatabaseContext, org.jabref.logic.FilePreferences)
```

## Setting a Directory for a .bib File
Expand Down
2 changes: 2 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,5 @@ If you want to indicate that a pull request is not yet complete **before** creat

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/).
16 changes: 16 additions & 0 deletions docs/requirements/ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
parent: Requirements
---
# AI

## User Interface

### Chatting with AI
`req~ai.chat.new-message-based-on-previous~1`

To enable simple editing and resending of previous messages, <kbd>Cursor Up</kbd> should show last message.
This should only happen if the current text field is empty.

Needs: impl

<!-- markdownlint-disable-file MD022 -->
49 changes: 49 additions & 0 deletions docs/requirements/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
nav_order: 7
has_children: true
---
# Requirements

This part of the documentation collects requirements using [OpenFastTrace](https://github.com/itsallcode/openfasttrace).

## Specifying requirements

One writes directly below a Markdown heading a requirement identifier.

Example:

```markdown
### Example
`req~ai.example~1`
```

It is important that there is no empty line directly after the heading.

{: note}
One needs to add `<!-- markdownlint-disable-file MD022 -->` to the end of the file, because the id of the requirement needs to follow the heading directly.

## Linking implementations

Then, one writes down at the requirement.
Directly at the end, one writes that it requires an implementation:

```markdown
Needs: impl
```

One can also state that there should be detailed design document (`dsn`).
However, typically in JabRef, we go from the requirement directly to the implementation.

Then, at the implementation, a comment is added this implementation is covered:

```java
// [impl->req~ai.example~1]
```

When executing the gradle task `traceRequirements`, `build/tracing.txt` is generated.
In case of a tracing error, one can inspect this file to see which requirements were not covered.

## More Information

- [User manual of OpenFastTrace](https://github.com/itsallcode/openfasttrace/blob/main/doc/user_guide.md)
- We cannot copy and paste real examples here, because of [openfasttrace#280](https://github.com/itsallcode/openfasttrace/issues/280).
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=5b9c5eb3f9fc2c94abaea57d90bd78747ca117ddbbf96c859d3741181a12bf2a
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 2 additions & 1 deletion scripts/vms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Then, everything is removed.
| [`fedora`](fedora/) | source | -- | -- | -- |
| [`Linux Mint (Cinnamon)`](linux-mint-cinnamon/) | source | Firefox | yes | -- |
| [`ubuntu`](ubuntu/) | snap | Firefox | yes | -- |
| [`windows`](windows/) | source | Edge | -- | -- |
| [`windows 10`](windows10/) | source | Edge | -- | -- |
| [`windows 11`](windows11/) | source | Edge | -- | -- |

## Troubleshooting

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Windows VM
# Windows 10 VM

A Windows-based VM to test JabRef.
As user, you need to ensure to have the proper Windows license to use this VM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-windows-sandbox"
NAME = "jabref-windows-10-sandbox"

Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/windows-10"
Expand Down
49 changes: 49 additions & 0 deletions scripts/vms/windows11/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Windows 11 VM

A Windows-based VM to test JabRef.
As user, you need to ensure to have the proper Windows license to use this VM.

In case you have many CPU cores, you can adapt `vb.cpus` in `Vagrantfile` to a higher number.

One has to install the [JabRef Browser Extension](https://addons.mozilla.org/en-US/firefox/addon/jabref/) manually.

## Troubleshooting

### "Waiting for machine to reboot..."

In case Vagrant reports "Waiting for machine to reboot..." and nothing happens, one has to "power off" the machine, execute `vagrant destory`, and then run `vagrant up` again.

### `fatal: early EOF`

```console
jabref-windows-sandbox: Cloning into 'jabref'...
jabref-windows-sandbox: error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
jabref-windows-sandbox: error: 6846 bytes of body are still expected
jabref-windows-sandbox: fetch-pack: unexpected disconnect while reading sideband packet
jabref-windows-sandbox: fatal: early EOF
jabref-windows-sandbox: fatal: fetch-pack: invalid index-pack output
```

The `git clone` command did not work.

Login, open `cmd` and then execute following commands:

```cmd
git clone --recurse-submodules https://github.com/JabRef/jabref.git
cd jabref
gradlew run
```

## Background

`Vagrantfile` is based on [SeisoLLC/windows-sandbox](https://github.com/SeisoLLC/windows-sandbox/tree/main).

The most use image seems to be the [Windows 10 image by `gusztavvargadr`](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10).
List of all images at <https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr>.

[Chocolatey](https://chocolatey.org/) is used instead of [winget-cli](https://learn.microsoft.com/en-us/windows/package-manager/), because Chocolatey installation does not hit GitHub's rate limits during unattended installation.

## Atlernatives

- Atlernative Vagrant images: <https://app.vagrantup.com/boxes/search?q=windows+10&utf8=%E2%9C%93>.
- [Windows Sandbox](https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-overview)
46 changes: 46 additions & 0 deletions scripts/vms/windows11/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-windows-11-sandbox"

Vagrant.configure("2") do |config|
# config.vm.box = "Caden/windows-11-pro-jp-22h2-22621.1992"
config.vm.box = "stromweld/windows-11"

config.vm.define NAME
config.vm.hostname = NAME

config.vm.provider "virtualbox" do |vb|
vb.name = NAME

vb.memory = 6000
vb.cpus = 2

vb.customize ['modifyvm', :id, '--clipboard-mode', 'bidirectional']
vb.gui = true
end

config.vm.provision "shell", privileged: "true", powershell_elevated_interactive: "true", inline: <<-SHELL
# Install chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco feature enable -n=allowGlobalConfirmation
choco install libericajdk
choco install git.install -y --params "/GitAndUnixToolsOnPath /WindowsTerminal /WindowsTerminalProfile"
# Required by AI functionaltiy
choco choco install vcredist140
# choco install firefox
# choco install libreoffice-fresh
SHELL

config.vm.provision "shell", reboot: true

config.vm.provision "shell", privileged: "false", inline: <<-SHELL
cd \\users\\vagrant
git clone --depth=1 --recurse-submodules https://github.com/JabRef/jabref.git
# cd jabref
# .\\gradlew jar
SHELL
end
Loading

0 comments on commit 7d3f66c

Please sign in to comment.