Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fix-10424
Browse files Browse the repository at this point in the history
* upstream/main:
  App semantic scholar api key to properties (#10656)
  Replace cache: gradle with "odern" gradle-build-action (#10657)
  Clean up test code (#10658)
  Bump org.openrewrite.rewrite from 6.4.0 to 6.5.4 (#10650)
  Bump com.puppycrawl.tools:checkstyle from 10.12.4 to 10.12.5 (#10654)
  Bump com.fasterxml.jackson.dataformat:jackson-dataformat-yaml (#10653)
  Bump com.github.Dansoftowner:jSystemThemeDetector from 3.6 to 3.8
  Remove comments - don't work on forks
  • Loading branch information
Siedlerchr committed Nov 26, 2023
2 parents 5a820a7 + 43364b8 commit b9b4da0
Show file tree
Hide file tree
Showing 32 changed files with 145 additions and 156 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Clean up keychain
run: |
security delete-keychain signing_temp.keychain ${{runner.temp}}/keychain/notarization.keychain || true
Expand All @@ -85,6 +84,8 @@ jobs:
mkdir ${{runner.temp}}/keychain
security create-keychain -p jabref ${{runner.temp}}/keychain/notarization.keychain
security set-keychain-settings ${{runner.temp}}/keychain/notarization.keychain
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Prepare merged jars and modules dir (macOS)
run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir
- name: Build dmg (macOS)
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Prepare merged jars and modules dir (macOS)
if: (matrix.os == 'macos-latest') || (steps.checksecrets.outputs.secretspresent == 'NO')
run: ./gradlew -i -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" prepareModulesDir
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-journal-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Check whether journal-list.mv can be generated (the "real" generation is done inside JabRef's build process)
run: |
./gradlew generateJournalListMV
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests-fetchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run fetcher tests
run: ./gradlew fetcherTest
env:
Expand Down
79 changes: 14 additions & 65 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,17 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Run checkstyle reporter
uses: nikitasavinov/checkstyle-action@master
with:
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
checkstyle_config: 'config/checkstyle/checkstyle_reviewdog.xml'
checkstyle_version: '10.3'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run checkstyle using gradle
run: ./gradlew checkstyleMain checkstyleTest checkstyleJmh
- name: Add comment on pull request
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: >
Your code currently does not meet JabRef's code guidelines.
We use [Checkstyle](https://checkstyle.sourceforge.io/) to identify issues.
The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR.
Please carefully follow [the setup guide for the codestyle](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html).
Afterwards, please run checkstyle locally and fix the issues.
More information on code quality in JabRef is available at <https://devdocs.jabref.org/getting-into-the-code/development-strategy.html>.
comment_tag: checkstyle
openrewrite:
name: OpenRewrite
runs-on: ubuntu-latest
Expand All @@ -77,23 +64,11 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run OpenRewrite
run: |
./gradlew rewriteDryRun
- name: Add comment on pull request
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: >
Your code currently does not meet JabRef's code guidelines.
We use [OpenRewrite](https://docs.openrewrite.org/) to ensure "modern" Java coding practices.
The issues found can be **automatically fixed**.
Please execute the gradle task *`rewriteRun`*, check the results, commit, and push.
You can check the detailed error output at the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".
comment_tag: openrewrite
modernizer:
name: Modernizer
runs-on: ubuntu-latest
Expand All @@ -108,24 +83,13 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run modernizer
run: |
# enable failing of this task if modernizer complains
sed -i "s/failOnViolations = false/failOnViolations = true/" build.gradle
./gradlew modernizer
- name: Add comment on pull request
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: >
Your code currently does not meet JabRef's code guidelines.
We use [Gradle Modernizer Plugin](https://github.com/andygoossens/gradle-modernizer-plugin#gradle-modernizer-plugin) to ensure "modern" Java coding practices.
Please fix the detected errors, commit, and push.
You can check the detailed error output at the tab "Checks", section "Tests" (on the left), subsection "Modernizer".
comment_tag: modernizer
markdown:
name: Markdown
runs-on: ubuntu-latest
Expand All @@ -141,17 +105,6 @@ jobs:
globs: |
*.md
docs/**/*.md
- name: Add comment on pull request
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: >
You modified Markdown (*.md) files.
To ensure consistent styling, we have [markdown-lint](https://github.com/DavidAnson/markdownlint) in place.
[Markdown lint's rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#rules) help to keep our Markdown files consistent within this repository and consistent with the Markdown files outside here.
You can check the detailed error output at the tab "Checks", section "Tests" (on the left), subsection "Markdown".
comment_tag: markdown
changelog:
name: CHANGELOG.md
runs-on: ubuntu-latest
Expand Down Expand Up @@ -198,14 +151,6 @@ jobs:
diff \
<(git show origin/main:CHANGELOG.md | clparse --format=json --separator=– - | jq '.releases[] | select(.version != null)') \
<(git show HEAD:CHANGELOG.md | clparse --format=json --separator=– - | jq '.releases[] | select(.version != null)')
- name: Add comment on pull request
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: >
While the PR was in progress, JabRef released a new version.
You have to merge `upstream/main` and move your entry in `CHANGELOG.md` to section `## [Unreleased]`.
comment_tag: changelog-unreleased-only
tests:
name: Unit tests
runs-on: ubuntu-latest
Expand All @@ -220,7 +165,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run tests
run: xvfb-run --auto-servernum ./gradlew check -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x modernizer
env:
Expand Down Expand Up @@ -255,7 +201,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run tests on PostgreSQL
run: ./gradlew databaseTest --rerun-tasks
env:
Expand Down Expand Up @@ -292,7 +239,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run GUI tests
run: xvfb-run --auto-servernum ./gradlew guiTest
env:
Expand Down Expand Up @@ -336,7 +284,8 @@ jobs:
with:
java-version: 21.0.1
distribution: 'liberica'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Update test coverage metrics
if: (github.ref == 'refs/heads/main') && (steps.checksecrets.outputs.secretspresent == 'YES')
run: xvfb-run --auto-servernum ./gradlew jacocoTestReport
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugins {

id 'idea'

id 'org.openrewrite.rewrite' version '6.4.0'
id 'org.openrewrite.rewrite' version '6.5.4'
}

// Enable following for debugging
Expand Down Expand Up @@ -144,7 +144,7 @@ dependencies {

implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.7.0.202309050840-r'

implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.3'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.16.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.15.3'

implementation 'com.fasterxml:aalto-xml:1.3.2'
Expand Down Expand Up @@ -180,7 +180,7 @@ dependencies {
}

implementation 'org.controlsfx:controlsfx:11.2.0'
implementation 'com.github.Dansoftowner:jSystemThemeDetector:3.6'
implementation 'com.github.Dansoftowner:jSystemThemeDetector:3.8'

implementation 'org.jsoup:jsoup:1.16.2'
implementation 'com.konghq:unirest-java:3.14.5'
Expand Down Expand Up @@ -248,12 +248,12 @@ dependencies {
testImplementation "org.testfx:testfx-junit5:4.0.16-alpha"
testImplementation "org.hamcrest:hamcrest-library:2.2"

checkstyle 'com.puppycrawl.tools:checkstyle:10.12.4'
checkstyle 'com.puppycrawl.tools:checkstyle:10.12.5'
// xjc needs the runtime as well for the ant task, otherwise it fails
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.4.1"))
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.5.0"))
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
Expand All @@ -277,7 +277,8 @@ processResources {
"astrophysicsDataSystemAPIKey": System.getenv('AstrophysicsDataSystemAPIKey') ? System.getenv('AstrophysicsDataSystemAPIKey') : '',
"ieeeAPIKey": System.getenv('IEEEAPIKey') ? System.getenv('IEEEAPIKey') : '',
"scienceDirectApiKey": System.getenv('SCIENCEDIRECTAPIKEY') ? System.getenv('SCIENCEDIRECTAPIKEY') : '',
"biodiversityHeritageApiKey": System.getenv('BiodiversityHeritageApiKey') ? System.getenv('BiodiversityHeritageApiKey') : ''
"biodiversityHeritageApiKey": System.getenv('BiodiversityHeritageApiKey') ? System.getenv('BiodiversityHeritageApiKey') : '',
"semanticScholarApiKey": System.getenv('SemanticScholarApiKey') ? System.getenv("SemanticScholarApiKey") : ''
)
filteringCharset = 'UTF-8'
}
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/groovy/org/jabref/build/xjc/XjcTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ class XjcTask extends DefaultTask {
}

private void updateOutput() {
if (outputDirectory != null && javaPackage != null)
outputs.dir(new File(getOutputDirectory(), packageAsPath(javaPackage)))
if (outputDirectory != null && javaPackage != null) {
outputs.dir(new File(getOutputDirectory(), packageAsPath(javaPackage)))
}
}

private static String packageAsPath(String pkg) {
Expand Down
21 changes: 11 additions & 10 deletions docs/code-howtos/fetchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ parent: Code Howtos

Fetchers are the implementation of the [search using online services](https://docs.jabref.org/collect/import-using-online-bibliographic-database). Some fetchers require API keys to get them working. To get the fetchers running in a JabRef development setup, the keys need to be placed in the respective environment variable. The following table lists the respective fetchers, where to get the key from and the environment variable where the key has to be placed.

| Service | Key Source | Environment Variable | Rate Limit |
|:-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------|----------------------------------|
| [IEEEXplore](https://docs.jabref.org/collect/import-using-online-bibliographic-database#ieeexplore) | [IEEE Xplore API portal](https://developer.ieee.org) | `IEEEAPIKey` | 200 calls/day |
| [MathSciNet](http://www.ams.org/mathscinet) | (none) | (none) | Depending on the current network |
| [SAO/NASA Astrophysics Data System](https://docs.jabref.org/collect/import-using-online-bibliographic-database#sao-nasa-astrophysics-data-system) | [ADS UI](https://ui.adsabs.harvard.edu/user/settings/token) | `AstrophysicsDataSystemAPIKey` | 5000 calls/day |
| [ScienceDirect](https://www.sciencedirect.com) | | `ScienceDirectApiKey` | |
| [Springer Nature](https://docs.jabref.org/collect/import-using-online-bibliographic-database#springer) | [Springer Nature API Portal](https://dev.springernature.com) | `SpringerNatureAPIKey` | 5000 calls/day |
| [Zentralblatt Math](https://www.zbmath.org) | (none) | (none) | Depending on the current network |
| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | [Biodiversitylibrary](https://about.biodiversitylibrary.org/tools-and-services/developer-and-data-tools/#APIs) | `BiodiversityHeritageApiKey` | - |
| Service | Key Source | Environment Variable | Rate Limit |
|:--------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------|----------------------------------|
| [IEEEXplore](https://docs.jabref.org/collect/import-using-online-bibliographic-database#ieeexplore) | [IEEE Xplore API portal](https://developer.ieee.org) | `IEEEAPIKey` | 200 calls/day |
| [MathSciNet](http://www.ams.org/mathscinet) | (none) | (none) | Depending on the current network |
| [SAO/NASA Astrophysics Data System](https://docs.jabref.org/collect/import-using-online-bibliographic-database#sao-nasa-astrophysics-data-system) | [ADS UI](https://ui.adsabs.harvard.edu/user/settings/token) | `AstrophysicsDataSystemAPIKey` | 5000 calls/day |
| [ScienceDirect](https://www.sciencedirect.com) | | `ScienceDirectApiKey` | |
| [SemanticScholar](https://www.semanticscholar.org/) | <https://www.semanticscholar.org/product/api#api-key-form> | `SemanticScholarApiKey` | |
| [Springer Nature](https://docs.jabref.org/collect/import-using-online-bibliographic-database#springer) | [Springer Nature API Portal](https://dev.springernature.com) | `SpringerNatureAPIKey` | 5000 calls/day |
| [Zentralblatt Math](https://www.zbmath.org) | (none) | (none) | Depending on the current network |
| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | [Biodiversitylibrary](https://about.biodiversitylibrary.org/tools-and-services/developer-and-data-tools/#APIs) | `BiodiversityHeritageApiKey` | - |

"Depending on the current network" means that it depends on whether your request is routed through a network having paid access. For instance, some universities have subscriptions to MathSciNet.

Expand Down Expand Up @@ -72,7 +73,7 @@ springerNatureAPIKey=${springerNatureAPIKey}
In `build.gradle`, these variables are filled:

```groovy
"springerNatureAPIKey": System.getenv('SpringerNatureAPIKey')
"springerNatureAPIKey" : System.getenv('SpringerNatureAPIKey')
```

The `BuildInfo` class reads from that file.
Expand Down
Loading

0 comments on commit b9b4da0

Please sign in to comment.