Skip to content

Commit 9047eed

Browse files
committed
Merge remote-tracking branch 'upstream/jetbrains-junie-issue-13623-run-c23b1a88-5c29-46a2-a007-701edd344b9b' into jetbrains-junie-issue-13623-run-c23b1a88-5c29-46a2-a007-701edd344b9b
* upstream/jetbrains-junie-issue-13623-run-c23b1a88-5c29-46a2-a007-701edd344b9b: Streamline code for getTabTitle() (#13781) Add missing variables Reformat BibTex in Show BibTex Source (#13761) Auto publish before JBang tests (#13779) Hotfix: calling of publish.yml Support BibLaTeX datamodel validations (#13693) Auto add and remove of "status: changes-required" label (#13778) New Crowdin updates (#13777) Restore local-only Git behavior for SLR to fix repository initialization error (#13775) Use vanilla hashset (#13771) Fix Springer Fetcher names (#13770) Fix condition Publish SNAPSHOT on jablib change (#13774) Adapt as per new set of checks (#13772) Bump jablib/src/main/resources/csl-styles from `1194364` to `17cfa60` (#13750) Fix path (#13769) Mode aware consistency check (#13584) Refine JBang check (#13765) Add Language Server to the UI and add the integrity/consistency check (#13697) Fix/remove comment code (#13763)
2 parents 27db77c + 7296ed3 commit 9047eed

File tree

90 files changed

+1563
-422
lines changed

Some content is hidden

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

90 files changed

+1563
-422
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Adapt PR status labels
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
jobs:
8+
label-changes-required:
9+
if: github.event.review.state == 'changes_requested'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Adapt labels
13+
run: |
14+
gh issue --repo ${{ github.repository }} edit ${{ github.event.pull_request.number }} --remove-label "status: ready-for-review"
15+
gh issue --repo ${{ github.repository }} edit ${{ github.event.pull_request.number }} --remove-label "status: awaiting-second-review"
16+
gh issue --repo ${{ github.repository }} edit ${{ github.event.pull_request.number }} --add-label "status: changes-required"
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/on-pr-opened-updated.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ jobs:
160160
echo "✅ No merge conflicts"
161161
env:
162162
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
remove_label:
164+
if: github.repository == 'JabRef/jabref'
165+
name: Remove label "status: changes-required"
166+
runs-on: ubuntu-latest
167+
steps:
168+
- run: gh issue --repo ${{ github.repository }} edit ${{ github.event.pull_request.number }} --remove-label "status: changes-required"
163169
upload-pr-number:
164170
if: github.repository == 'JabRef/jabref'
165171
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
name: Publish to maven central
22

33
on:
4-
pull_request:
5-
paths:
6-
- .github/workflows/publish.yml
4+
# On releases
75
push:
8-
paths:
9-
- .github/workflows/publish.yml
106
tags:
11-
- '*'
12-
schedule:
13-
# run on each Monday
14-
- cron: '2 3 * * 1'
7+
- '**'
8+
9+
# Called by the JBang testing jobs to ensure that SNAPSHOT is uptodate
10+
workflow_call:
11+
secrets:
12+
KOPPOR_SIGNING_SECRETKEYRINGFILE_BASE64:
13+
required: true
14+
KOPPOR_SIGNING_KEYID:
15+
required: true
16+
KOPPOR_SIGNING_PASSWORD:
17+
required: true
18+
KOPPOR_MAVENCENTRALUSERNAME:
19+
required: true
20+
KOPPOR_MAVENCENTRALPASSWORD:
21+
required: true
22+
1523
workflow_dispatch:
1624
inputs:
1725
tagbuild:
@@ -20,6 +28,11 @@ on:
2028
default: false
2129
type: boolean
2230

31+
# Additional run in addition to the other events, because some resources could have changes
32+
schedule:
33+
# Run on each Monday
34+
- cron: '2 3 * * 1'
35+
2336
permissions:
2437
actions: write
2538
contents: read
@@ -34,9 +47,33 @@ concurrency:
3447
cancel-in-progress: true
3548

3649
jobs:
50+
detect_changes:
51+
runs-on: ubuntu-latest
52+
outputs:
53+
changed: ${{ steps.changed.outputs.any_changed }}
54+
steps:
55+
- uses: actions/checkout@v5
56+
with:
57+
fetch-depth: 0
58+
- name: Detect changed jablib classes or workflow
59+
id: changed
60+
uses: tj-actions/changed-files@v45
61+
with:
62+
files: |
63+
jablib/src/main/java/**/*.java
64+
.github/workflows/publish.yml
65+
3766
publish:
3867
name: jablib
39-
if: github.repository == 'JabRef/jabref'
68+
needs: detect_changes
69+
if: >
70+
github.event_name == 'schedule' ||
71+
github.event_name == 'workflow_dispatch' ||
72+
(needs.detect_changes.outputs.changed == 'true' &&
73+
((github.event_name == 'workflow_call' && github.repository == 'JabRef/jabref') ||
74+
(github.event_name == 'push' && github.repository == 'JabRef/jabref') ||
75+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'JabRef/jabref'))
76+
)
4077
runs-on: ubuntu-latest
4178
steps:
4279
- name: Fetch all history for all tags and branches

.github/workflows/tests-code.yml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
permissions:
25+
# required for publish.yml
26+
actions: write
27+
contents: read
2528
pull-requests: write
2629

2730
jobs:
@@ -393,10 +396,20 @@ jobs:
393396
CI: "true"
394397
DBMS: "postgresql"
395398

399+
publish:
400+
if: github.ref == 'refs/heads/main'
401+
uses: ./.github/workflows/publish.yml
402+
secrets:
403+
KOPPOR_SIGNING_SECRETKEYRINGFILE_BASE64: ${{ secrets.KOPPOR_SIGNING_SECRETKEYRINGFILE_BASE64 }}
404+
KOPPOR_SIGNING_KEYID: ${{ secrets.KOPPOR_SIGNING_KEYID }}
405+
KOPPOR_SIGNING_PASSWORD: ${{ secrets.KOPPOR_SIGNING_PASSWORD }}
406+
KOPPOR_MAVENCENTRALUSERNAME: ${{ secrets.KOPPOR_MAVENCENTRALUSERNAME }}
407+
KOPPOR_MAVENCENTRALPASSWORD: ${{ secrets.KOPPOR_MAVENCENTRALPASSWORD }}
408+
396409
jbang:
397-
name: JBang
410+
name: JBang (main)
398411
runs-on: ubuntu-latest
399-
# JBang scripts depend on main-SNAPSHOT; thus, we can only test fully when main is updated
412+
needs: publish
400413
if: github.ref == 'refs/heads/main'
401414
steps:
402415
- name: Checkout source
@@ -426,8 +439,61 @@ jobs:
426439
- run: jbang build .jbang/CheckoutPR.java
427440
- run: jbang build .jbang/CloneJabRef.java
428441
- run: jbang build --fresh .jbang/JabKitLauncher.java
442+
- run: jbang build --fresh .jbang/JabLsLauncher.java
429443
- run: jbang build --fresh .jbang/JabSrvLauncher.java
430444

445+
jbang-pr:
446+
name: JBang (PR)
447+
runs-on: ubuntu-latest
448+
# does not need publish, because the JBang scripts are modified
449+
if: github.ref != 'refs/heads/main'
450+
strategy:
451+
fail-fast: false
452+
matrix:
453+
launcher: [JabKitLauncher, JabLsLauncher, JabSrvLauncher]
454+
steps:
455+
- name: Checkout source
456+
uses: actions/checkout@v5
457+
with:
458+
submodules: 'false'
459+
show-progress: 'false'
460+
- name: Set up JDK
461+
uses: actions/setup-java@v5
462+
with:
463+
java-version: 24
464+
distribution: 'corretto'
465+
- name: Generate JBang cache key
466+
id: cache-key
467+
shell: bash
468+
run: |
469+
echo "cache_key=jbang-$(date +%F)" >> $GITHUB_OUTPUT
470+
- name: Use cache
471+
uses: actions/cache@v4
472+
with:
473+
path: ~/.jbang
474+
key: ${{ steps.cache-key.outputs.cache_key }}
475+
restore-keys:
476+
jbang-
477+
- name: Setup JBang
478+
uses: jbangdev/setup-jbang@main
479+
480+
- name: Detect changed jablib classes
481+
id: changed-jablib-files
482+
uses: tj-actions/changed-files@v45
483+
with:
484+
files: |
485+
jablib/src/main/java/**/*.java
486+
487+
- name: Build ${{ matrix.launcher }} launcher including changed classes
488+
shell: bash
489+
# We always run, because changes in jabls, jabsrv also could cause JBang to fail
490+
run: |
491+
# We modify the JBang scripts directly to avoid issues with relative paths
492+
for f in ${{ steps.changed-jablib-files.outputs.all_changed_files }}; do
493+
echo "//SOURCES ../$f" >> ".jbang/${{ matrix.launcher }}.java"
494+
done
495+
jbang build --fresh ".jbang/${{ matrix.launcher }}.java"
496+
431497
codecoverage:
432498
if: false
433499
name: Code coverage

.github/workflows/tests-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ jobs:
127127
128128
LINE_COUNT=$(echo "$BOXES" | wc -l)
129129
130-
if [ "$LINE_COUNT" -ne 7 ]; then
131-
echo "❌ Found $LINE_COUNT lines instead of 7 required lines"
130+
if [ "$LINE_COUNT" -ne 6 ]; then
131+
echo "❌ Found $LINE_COUNT lines instead of 6 required lines"
132132
exit 1
133133
fi
134134

.jbang/JabLsLauncher.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010

1111
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/BibtexTextDocumentService.java
1212
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/BibtexWorkspaceService.java
13-
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/LSPLauncher.java
14-
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/LSPServer.java
13+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/controller/LanguageServerController.java
14+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/ExtensionSettings.java
15+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/LspClientHandler.java
16+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/LspLauncher.java
17+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/util/LspConsistencyCheck.java
18+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/util/LspDiagnosticBuilder.java
19+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/util/LspDiagnosticHandler.java
20+
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/util/LspIntegrityCheck.java
1521

1622
// REPOS mavencentral,snapshots=https://central.sonatype.com/repository/maven-snapshots/
1723
// REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
1111

1212
### Added
1313

14+
- We added the option to enable the language server in the preferences. [#13697](https://github.com/JabRef/jabref/pull/13697)
1415
- We introduced an option in Preferences under (under Linked files -> Linked file name conventions) to automatically rename linked files when an entry data changes. [#11316](https://github.com/JabRef/jabref/issues/11316)
1516
- We added tooltips (on hover) for 'Library-specific file directory', 'User-specific file directory' and 'LaTeX file directory' fields of the library properties window. [#12269](https://github.com/JabRef/jabref/issues/12269)
1617
- A space is now added by default after citations inserted via the Libre/OpenOffice integration. [#13559](https://github.com/JabRef/jabref/issues/13559)
@@ -31,6 +32,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
3132
- When relativizing file names, symlinks are now taken into account. [#12995](https://github.com/JabRef/jabref/issues/12995)
3233
- We added a new button for shortening the DOI near the DOI field in the general tab when viewing an entry. [#13639](https://github.com/JabRef/jabref/issues/13639)
3334
- We added support for finding CSL-Styles based on their short title (e.g. apa instead of "american psychological association"). [#13728](https://github.com/JabRef/jabref/pull/13728)
35+
- We added BibLaTeX datamodel validation support in order to improve error message quality in entries' fields validation. [#13318](https://github.com/JabRef/jabref/issues/13318)
3436

3537
### Changed
3638

@@ -71,6 +73,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
7173
- We improved JabRef's internal document viewer. It now allows text section, searching and highlighting of search terms and page rotation [#13193](https://github.com/JabRef/jabref/pull/13193).
7274
- When importing a PDF, there is no empty entry column shown in the multi merge dialog. [#13132](https://github.com/JabRef/jabref/issues/13132)
7375
- We added a progress dialog to the "Check consistency" action and progress output to the corresponding cli command. [#12487](https://github.com/JabRef/jabref/issues/12487)
76+
- The BibTeX source is now formatted using the JabRef style at the import inspection dialog. [#13015](https://github.com/JabRef/jabref/issues/13015)
7477
- We made the `check-consistency` command of the toolkit always return an exit code; 0 means no issues found, a non-zero exit code reflects any issues, which allows CI to fail in these cases [#13328](https://github.com/JabRef/jabref/issues/13328).
7578
- We changed the validation error dialog for overriding the default file directories to a confirmation dialog for saving other preferences under the library properties. [#13488](https://github.com/JabRef/jabref/pull/13488)
7679
- We made the copy sub menu on the context menu consistent with the copy sub menu at "Edit". [#13280](https://github.com/JabRef/jabref/pull/13280)
@@ -107,8 +110,9 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
107110
- We fixed an issue showing an empty tooltip in maintable. [#11681](https://github.com/JabRef/jabref/issues/11681)
108111
- We fixed an issue displaying a warning if a file to open is not found. [#13430](https://github.com/JabRef/jabref/pull/13430)
109112
- We fixed an issue where Document Viewer showed technical exceptions when opening entries with non-PDF files. [#13198](https://github.com/JabRef/jabref/issues/13198)
113+
- We fixed an issue with double display of the library filename in the tab tooltip in the case of a changed library. [#13781](https://github.com/JabRef/jabref/pull/13781)
110114
- When creating a library, if you drag a PDF file containing only a single column, the dialog will now automatically close. [#13262](https://github.com/JabRef/jabref/issues/13262)
111-
- We fixed an issue where the tab showing the fulltext search results would appear blank after switching library. [#13241](https://github.com/JabRef/jabref/issues/13241)
115+
- We fixed an issue where the tab showing the fulltext search results would appear blank after switching libraries. [#13241](https://github.com/JabRef/jabref/issues/13241)
112116
- We fixed an issue where "Copy to" was enabled even if no other library was opened. [#13280](https://github.com/JabRef/jabref/pull/13280)
113117
- We fixed an issue where the groups were still displayed after closing all libraries. [#13382](https://github.com/JabRef/jabref/issues/13382)
114118
- Enhanced field selection logic in the Merge Entries dialog when fetching from DOI to prefer valid years and entry types. [#12549](https://github.com/JabRef/jabref/issues/12549)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
nav_order: 48
3+
parent: Decision Records
4+
---
5+
6+
# JBang script modification for testing in CI
7+
8+
## Context and Problem Statement
9+
10+
All JBang scripts on `main` should always compile.
11+
12+
Example:
13+
14+
```terminal
15+
gg.cmd https://github.com/JabRef/jabref/blob/main/.jbang/JabLsLauncher.java
16+
```
17+
18+
- JBang scripts link to `org.jabref:jablib:6.0-SNAPSHOT`.
19+
- JBang scripts include java files from the respective `-cli` repository and the sources of the respective server project. E.g., `JabLsLauncher.java` includes `ServerCli.java` from `jabls-cli` and all sources from `jabls`.
20+
- Code changes might change a) things inside the server project and b) things in JabRef's logic.
21+
22+
As a consequence, the JBang script might break.
23+
24+
Case a) can be detected when running the JBang check in the respective PR.
25+
Case b) can be detected when running the JBang check in the main branch, because `org.jabref:jablib:6.0-SNAPSHOT` is updated there.
26+
27+
We aim for checking JBang scripts in PRs and on `main`.
28+
29+
## Decision Drivers
30+
31+
- Fast detection of issues at all JBang files
32+
- Easy CI pipeline
33+
34+
## Considered Options
35+
36+
- Have JBang script have all changed classes of `jablib` included directly
37+
- Use jitpack
38+
-Temporary `-SNAPSHOT.jar`
39+
40+
## Decision Outcome
41+
42+
Chosen option: "Have JBang script have all changed classes of `jablib` included directly.", because comes out best (see below).
43+
44+
## Pros and Cons of the Options
45+
46+
### Have JBang script have all changed classes of `jablib` included directly
47+
48+
- `org.jabref:jablib:6.0-SNAPSHOT` provides non-modified classes
49+
- modified classes are included using JBang's `//SOURCES` directive.
50+
51+
[tj-actions/changed-files](https://github.com/marketplace/actions/changed-files) can be used.
52+
53+
- Good, because least effort
54+
55+
### Use jitpack
56+
57+
- Bad, because jitpack is unreliable
58+
59+
### Temporary `-SNAPSHOT.jar`
60+
61+
- Bad, because setting up a temporary maven repository is effort.

jabgui/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ dependencies {
2020
// implementation("org.openjfx:javafx-fxml")
2121
// implementation("org.openjfx:javafx-graphics")
2222

23+
implementation(project(":jabls"))
24+
implementation(project(":jabsrv"))
25+
2326
implementation("org.openjfx:javafx-swing")
2427
implementation("org.openjfx:javafx-web")
2528

26-
implementation(project(":jabsrv"))
27-
2829
implementation("com.pixelduke:fxthemes")
2930

3031
// From JavaFX25 onwards

jabgui/src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
open module org.jabref {
22
requires org.jabref.jablib;
3-
3+
requires org.jabref.jabls;
44
requires org.jabref.jabsrv;
55

66
// Swing

0 commit comments

Comments
 (0)