Skip to content

Commit aa1818f

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: fix langchain module errors (#13853) Enhance PR validation actions (#13850)
2 parents 2a819aa + 614633b commit aa1818f

File tree

9 files changed

+153
-129
lines changed

9 files changed

+153
-129
lines changed

.github/ghprcomment.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,25 +168,25 @@
168168
169169
Give it a read, and you’ll discover the ancient wisdom of assigning issues to yourself. Trust me, it’s worth it. 🚀
170170
171-
- jobName: 'PR title must not start with "Fix for issue <number>"'
172-
workflowName: 'PR Tests'
171+
- jobName: 'PR title must not contain "issue <number>"'
172+
workflowName: 'PR Format'
173173
always: true
174174
message: >
175175
The title of the pull request must not start with "Fix for issue xyz".
176176
Please use a concise one-line summary that explains what the fix or change actually does.
177177
Example of a good title: "Prevent crash when importing malformed BibTeX entries".
178178
- jobName: 'Mandatory Checks present'
179-
workflowName: 'PR Tests'
179+
workflowName: 'PR Format'
180180
always: true
181181
message: >
182182
You have removed the "Mandatory Checks" section from your pull request description. Please adhere to our [pull request template](https://github.com/JabRef/jabref/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L10).
183183
- jobName: 'PR checklist OK'
184-
workflowName: 'PR Tests'
184+
workflowName: 'PR Format'
185185
always: true
186186
message: >
187187
Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of `[x]` (done), `[ ]` (not done yet) or `[/]` (not applicable).
188188
- jobName: 'Determine issue number'
189-
workflowName: 'PR Tests'
189+
workflowName: 'On PR opened/updated'
190190
always: true
191191
message: |
192192
Your pull request needs to link an issue correctly.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Welcome a first-time contributor
22

33
on:
44
pull_request_target:
5-
types: opened
5+
types: [opened]
66

77
jobs:
88
welcome-first-time-contributor:

.github/workflows/pr-comment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ name: Comment on PR
77

88
on:
99
workflow_run:
10-
workflows: ["Source Code Tests", "On PR opened/updated", "PR Tests"]
10+
# note when updating via a PR and testing - `workflow_run` executes from the `main` branch and not the PR branch
11+
workflows: ["Source Code Tests", "On PR opened/updated", "PR Tests", "PR Format"]
1112
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
1213
types: [completed]
1314
workflow_dispatch:

.github/workflows/pr-format.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: PR Format
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
check_title_format:
12+
name: PR title must not contain "issue <number>"
13+
if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name != 'JabRef/jabref'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout source
17+
uses: actions/checkout@v5
18+
with:
19+
submodules: 'false'
20+
show-progress: 'false'
21+
- name: Check PR title
22+
run: |
23+
TITLE=$(gh pr view "${{ github.event.number }}" --json title --template '{{.title}}')
24+
echo "Title: $TITLE"
25+
26+
if echo "$TITLE" | grep -Eiq 'issue ?#?[0-9]+.+'; then
27+
echo "❌ Title contains 'issue <number>' — not allowed."
28+
exit 1
29+
fi
30+
31+
echo "✅ Title format OK"
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
mandatory-checks-section-exists:
36+
if: >
37+
(github.event.pull_request.head.repo.full_name != 'JabRef/jabref') && !(
38+
(github.actor == 'dependabot[bot]') ||
39+
(
40+
startsWith(github.event.pull_request.title, '[Bot] ') ||
41+
startsWith(github.event.pull_request.title, 'Bump ') ||
42+
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
43+
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
44+
)
45+
)
46+
name: Mandatory Checks present
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout source
50+
uses: actions/checkout@v5
51+
with:
52+
submodules: 'false'
53+
show-progress: 'false'
54+
55+
- name: Check for existence of Mandatory Checks section
56+
id: check_mandatory_section
57+
run: |
58+
set -e
59+
60+
BODY=$(gh pr view "${{ github.event.number }}" --json body --template '{{.body}}')
61+
62+
if echo "$BODY" | grep -q "### Mandatory checks"; then
63+
echo "✅ '### Mandatory checks' section found."
64+
else
65+
echo "❌ '### Mandatory checks' section is missing!"
66+
exit 1
67+
fi
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
71+
checklist-checked:
72+
if: >
73+
(github.event.pull_request.head.repo.full_name != 'JabRef/jabref') &&
74+
!(
75+
(github.actor == 'dependabot[bot]') ||
76+
(
77+
startsWith(github.event.pull_request.title, '[Bot] ') ||
78+
startsWith(github.event.pull_request.title, 'Bump ') ||
79+
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
80+
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
81+
)
82+
)
83+
name: PR checklist OK
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Checkout source
87+
uses: actions/checkout@v5
88+
with:
89+
submodules: 'false'
90+
show-progress: 'false'
91+
- name: Check for PR checklist
92+
id: check_changelog_modification
93+
run: |
94+
set -e
95+
96+
BODY=$(gh pr view "${{ github.event.number }}" --json body --template '{{.body}}' | grep -A5000 '### Mandatory checks')
97+
echo "Found body: $BODY"
98+
99+
# Ensure the section exists
100+
if ! printf '%s\n' "$BODY" | grep -q "### Mandatory checks"; then
101+
echo "❌ '### Mandatory checks' section is missing!"
102+
exit 1
103+
fi
104+
105+
BOXES=$(printf '%s\n' "$BODY" | grep "^- \[")
106+
echo "Found boxes: $BOXES"
107+
108+
while IFS= read -r line; do
109+
if ! printf '%s\n' "$line" | grep -Eq "^- \[(x|/| )\] "; then
110+
echo "❌ Found improperly formatted checkbox: '$line'"
111+
exit 1
112+
fi
113+
done <<< "$BOXES"
114+
115+
LINE_COUNT=$(echo "$BOXES" | wc -l)
116+
117+
if [ "$LINE_COUNT" -ne 6 ]; then
118+
echo "❌ Found $LINE_COUNT lines instead of 6 required lines"
119+
exit 1
120+
fi
121+
122+
echo "✅ All checkboxes are present and in the correct format."
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests-pr.yml

Lines changed: 1 addition & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: PR Tests
22

33
on:
44
pull_request:
5+
types: [opened, reopened, synchronize]
56

67
concurrency:
78
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
@@ -21,122 +22,6 @@ jobs:
2122
name: pr_number
2223
path: pr_number.txt
2324

24-
check_title_format:
25-
name: PR title must not contain "issue <number>"
26-
if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name != 'JabRef/jabref'
27-
runs-on: ubuntu-latest
28-
steps:
29-
- name: Checkout source
30-
uses: actions/checkout@v5
31-
with:
32-
submodules: 'false'
33-
show-progress: 'false'
34-
- name: Check PR title
35-
run: |
36-
TITLE=$(gh pr view "${{ github.event.number }}" --json title --template '{{.title}}')
37-
echo "Title: $TITLE"
38-
39-
if echo "$TITLE" | grep -Eiq 'issue ?#?[0-9]+.+'; then
40-
echo "❌ Title contains 'issue <number>' — not allowed."
41-
exit 1
42-
fi
43-
44-
echo "✅ Title format OK"
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
48-
mandatory-checks-section-exists:
49-
if: >
50-
(github.event.pull_request.head.repo.full_name != 'JabRef/jabref') && !(
51-
(github.actor == 'dependabot[bot]') ||
52-
(
53-
startsWith(github.event.pull_request.title, '[Bot] ') ||
54-
startsWith(github.event.pull_request.title, 'Bump ') ||
55-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
56-
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
57-
)
58-
)
59-
name: Mandatory Checks present
60-
runs-on: ubuntu-latest
61-
steps:
62-
- name: Checkout source
63-
uses: actions/checkout@v5
64-
with:
65-
submodules: 'false'
66-
show-progress: 'false'
67-
68-
- name: Check for existence of Mandatory Checks section
69-
id: check_mandatory_section
70-
run: |
71-
set -e
72-
73-
BODY=$(gh pr view "${{ github.event.number }}" --json body --template '{{.body}}')
74-
75-
if echo "$BODY" | grep -q "### Mandatory checks"; then
76-
echo "✅ '### Mandatory checks' section found."
77-
else
78-
echo "❌ '### Mandatory checks' section is missing!"
79-
exit 1
80-
fi
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
84-
checklist-checked:
85-
if: >
86-
(github.event.pull_request.head.repo.full_name != 'JabRef/jabref') &&
87-
!(
88-
(github.actor == 'dependabot[bot]') ||
89-
(
90-
startsWith(github.event.pull_request.title, '[Bot] ') ||
91-
startsWith(github.event.pull_request.title, 'Bump ') ||
92-
startsWith(github.event.pull_request.title, 'New Crowdin updates') ||
93-
startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from')
94-
)
95-
)
96-
name: PR checklist OK
97-
runs-on: ubuntu-latest
98-
steps:
99-
- name: Checkout source
100-
uses: actions/checkout@v5
101-
with:
102-
submodules: 'false'
103-
show-progress: 'false'
104-
- name: Check for PR checklist
105-
id: check_changelog_modification
106-
run: |
107-
set -e
108-
109-
BODY=$(gh pr view "${{ github.event.number }}" --json body --template '{{.body}}' | grep -A5000 '### Mandatory checks')
110-
echo "Found body: $BODY"
111-
112-
# Ensure the section exists
113-
if ! printf '%s\n' "$BODY" | grep -q "### Mandatory checks"; then
114-
echo "❌ '### Mandatory checks' section is missing!"
115-
exit 1
116-
fi
117-
118-
BOXES=$(printf '%s\n' "$BODY" | grep "^- \[")
119-
echo "Found boxes: $BOXES"
120-
121-
while IFS= read -r line; do
122-
if ! printf '%s\n' "$line" | grep -Eq "^- \[(x|/| )\] "; then
123-
echo "❌ Found improperly formatted checkbox: '$line'"
124-
exit 1
125-
fi
126-
done <<< "$BOXES"
127-
128-
LINE_COUNT=$(echo "$BOXES" | wc -l)
129-
130-
if [ "$LINE_COUNT" -ne 6 ]; then
131-
echo "❌ Found $LINE_COUNT lines instead of 6 required lines"
132-
exit 1
133-
fi
134-
135-
echo "✅ All checkboxes are present and in the correct format."
136-
env:
137-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138-
139-
14025
changelog_modified:
14126
name: CHANGELOG.md needs to be modified
14227
if: github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name != 'JabRef/jabref'

build-logic/src/main/kotlin/org.jabref.gradle.base.dependency-rules.gradle.kts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.api.internal.artifacts.dsl.dependencies.DependenciesExtensionModule.module
2+
13
plugins {
24
id("org.gradlex.extra-java-module-info")
35
id("org.gradlex.jvm-dependency-conflict-resolution")
@@ -192,7 +194,21 @@ extraJavaModuleInfo {
192194
// requires("jackson.annotations")
193195
}
194196
module("dev.langchain4j:langchain4j", "langchain4j")
195-
module("dev.langchain4j:langchain4j-core", "langchain4j.core")
197+
module("dev.langchain4j:langchain4j-core", "langchain4j.core") {
198+
// workaround for https://github.com/langchain4j/langchain4j/issues/3668
199+
mergeJar("dev.langchain4j:langchain4j-http-client")
200+
mergeJar("dev.langchain4j:langchain4j-http-client-jdk")
201+
mergeJar("dev.langchain4j:langchain4j-hugging-face")
202+
mergeJar("dev.langchain4j:langchain4j-mistral-ai")
203+
mergeJar("dev.langchain4j:langchain4j-open-ai")
204+
mergeJar("dev.langchain4j:langchain4j-google-ai-gemini")
205+
requires("jtokkit")
206+
requires("java.net.http")
207+
uses("dev.langchain4j.http.client.HttpClientBuilderFactory")
208+
exportAllPackages()
209+
requireAllDefinedDependencies()
210+
patchRealModule()
211+
}
196212
module("dev.langchain4j:langchain4j-google-ai-gemini", "langchain4j.google.ai.gemini")
197213
module("dev.langchain4j:langchain4j-http-client", "langchain4j.http.client")
198214
module("dev.langchain4j:langchain4j-http-client-jdk", "langchain4j.http.client.jdk")

jablib/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ dependencies {
163163
implementation("dev.langchain4j:langchain4j-mistral-ai")
164164
implementation("dev.langchain4j:langchain4j-google-ai-gemini")
165165
implementation("dev.langchain4j:langchain4j-hugging-face")
166+
implementation("dev.langchain4j:langchain4j-http-client")
167+
implementation("dev.langchain4j:langchain4j-http-client-jdk")
166168

167169
implementation("org.apache.velocity:velocity-engine-core")
168170
implementation("ai.djl:api")

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@
217217
requires jvm.openai;
218218
requires langchain4j;
219219
requires langchain4j.core;
220-
requires langchain4j.google.ai.gemini;
221-
requires langchain4j.hugging.face;
222-
requires langchain4j.mistral.ai;
223-
requires langchain4j.open.ai;
224220
uses ai.djl.engine.EngineProvider;
225221
uses ai.djl.repository.RepositoryFactory;
226222
uses ai.djl.repository.zoo.ZooProvider;

versions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ val pdfbox = "3.0.5"
1212

1313
dependencies {
1414
api(platform("ai.djl:bom:0.34.0"))
15-
api(platform("dev.langchain4j:langchain4j-bom:1.3.0"))
15+
api(platform("dev.langchain4j:langchain4j-bom:1.4.0"))
1616
api("dev.langchain4j:langchain4j")
1717
api("dev.langchain4j:langchain4j-google-ai-gemini")
1818
api("dev.langchain4j:langchain4j-hugging-face")

0 commit comments

Comments
 (0)