Skip to content

Commit 8efa826

Browse files
committed
Merge branch 'main' of https://github.com/JabRef/jabref into fix-for-issue-JabRef#12272
2 parents 66ccb58 + b16fe62 commit 8efa826

32 files changed

+362
-39
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
YOU HAVE TO MODIFY THIS TEXT TO FIT YOUR PR. OTHERWISE, YOUR PR WILL BE CLOSED WITHOUT FURTHER COMMENT.
1+
<!-- YOU HAVE TO MODIFY THIS TEXT TO FIT YOUR PR. OTHERWISE, YOUR PR WILL BE CLOSED WITHOUT FURTHER COMMENT. -->
2+
23
Describe the changes you have made here: what, why, ...
3-
Closes #xyz. <!-- number of the issue that will be closed -->
4+
5+
<!-- LINK THE ISSUE WITH THE "Closes" KEYWORD -->
6+
<!-- Example: Closes (link) OR Closes #xyz -->
47

58
### Mandatory checks
69

.github/ghprcomment.yml

+32
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,35 @@
4949
Commits will be lost, comments on commits will loose their context.
5050
This makes it harder to review.
5151
In the end, all commits will be [squashed](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits) either way before being merged into the `main`` branch.
52+
- jobName: move_issue
53+
message: |
54+
Your pull request needs to link an issue.
55+
56+
To ease organizational workflows, please link this pull-request to the issue with syntax as described in <https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue>:
57+
58+
> <h2 id="linking-a-pull-request-to-an-issue-using-a-keyword">Linking a pull request to an issue using a keyword</h2>
59+
> <p>You can link a pull request to an issue by using a supported keyword
60+
> in the pull request's description or in a commit message. The pull
61+
> request <strong>must be</strong> on the default branch.</p>
62+
> <ul>
63+
> <li>close</li>
64+
> <li>closes</li>
65+
> <li>closed</li>
66+
> <li>fix</li>
67+
> <li>fixes</li>
68+
> <li>fixed</li>
69+
> <li>resolve</li>
70+
> <li>resolves</li>
71+
> <li>resolved</li>
72+
> </ul>
73+
> <p>If you use a keyword to reference a pull request comment in another
74+
> pull request, the pull requests will be linked. Merging the referencing
75+
> pull request also closes the referenced pull request.</p>
76+
> <p>The syntax for closing keywords depends on whether the issue is in the same repository as the pull request.</p>
77+
78+
### Examples
79+
80+
- ✅ `Fixes #xyz` links pull-request to issue. Merging the PR will close the issue.
81+
- ✅ `Fixes https://github.com/JabRef/jabref/issues/xyz` links pull-request to issue. Merging the PR will close the issue.
82+
- ✅ `Fixes https://github.com/Koppor/jabref/issues/xyz` links pull-request to issue. Merging the PR will close the issue.
83+
- ❌ `Fixes [#xyz](https://github.com/JabRef/jabref/issues/xyz)` links pull-request to issue. Merging the PR will **NOT** close the issue.

.github/workflows/assign-issue.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- name: Assign the user or unassign stale assignments
1818
id: assign
19-
uses: takanome-dev/assign-issue-action@beta
19+
uses: takanome-dev/assign-issue-action@edge
2020
with:
2121
github_token: '${{ secrets.GITHUB_TOKEN }}'
2222
days_until_unassign: 45
@@ -34,7 +34,7 @@ jobs:
3434
3535
⏳ Please note, you will be automatically unassigned if the issue isn't closed within **{{ total_days }} days** (by **{{ unassigned_date }}**). A maintainer can also add the "**{{ pin_label }}**"" label to prevent automatic unassignment.
3636
- name: Move Issue to "Assigned" Column in "Candidates for University Projects"
37-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
37+
uses: m7kvqbe1/github-action-move-issues@main
3838
# Action currently works for issues only - pre-condition: https://github.com/takanome-dev/assign-issue-action/issues/269 fixed
3939
if: github.event_name == 'issue_comment'
4040
with:
@@ -46,7 +46,7 @@ jobs:
4646
default-column: "Free to take"
4747
skip-if-not-in-project: true
4848
- name: Move Issue to "Assigned" Column in "Good First Issues"
49-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
49+
uses: m7kvqbe1/github-action-move-issues@main
5050
if: github.event_name == 'issue_comment'
5151
with:
5252
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}

.github/workflows/check-links.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- '.lycheeignore'
88
- 'lychee.toml'
99
- '**/*.md'
10+
paths-ignore:
11+
- 'CHANGELOG.md'
1012
schedule:
1113
# Run on the first of each month at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
1214
- cron: "0 9 1 * *"

.github/workflows/delete-old-runs.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Delete old workflow runs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
days:
6+
description: 'Days-worth of runs to keep for each workflow'
7+
required: true
8+
default: '30'
9+
minimum_runs:
10+
description: 'Minimum runs to keep for each workflow'
11+
required: true
12+
default: '6'
13+
delete_workflow_pattern:
14+
description: 'Name or filename of the workflow (if not set, all workflows are targeted)'
15+
required: false
16+
delete_workflow_by_state_pattern:
17+
description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually'
18+
required: true
19+
default: "ALL"
20+
type: choice
21+
options:
22+
- "ALL"
23+
- active
24+
- deleted
25+
- disabled_inactivity
26+
- disabled_manually
27+
delete_run_by_conclusion_pattern:
28+
description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success'
29+
required: true
30+
default: "ALL"
31+
type: choice
32+
options:
33+
- "ALL"
34+
- "Unsuccessful: action_required,cancelled,failure,skipped"
35+
- action_required
36+
- cancelled
37+
- failure
38+
- skipped
39+
- success
40+
dry_run:
41+
description: 'Logs simulated changes, no deletions are performed'
42+
required: false
43+
44+
jobs:
45+
del_runs:
46+
runs-on: ubuntu-latest
47+
permissions:
48+
actions: write
49+
contents: read
50+
steps:
51+
- name: Delete workflow runs
52+
uses: Mattraks/delete-workflow-runs@v2
53+
with:
54+
token: ${{ github.token }}
55+
repository: ${{ github.repository }}
56+
retain_days: ${{ github.event.inputs.days }}
57+
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
58+
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
59+
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }}
60+
delete_run_by_conclusion_pattern: >-
61+
${{
62+
startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:')
63+
&& 'action_required,cancelled,failure,skipped'
64+
|| github.event.inputs.delete_run_by_conclusion_pattern
65+
}}
66+
dry_run: ${{ github.event.inputs.dry_run }}

.github/workflows/on-issue-labeled.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
issues: write
1616
steps:
1717
- name: Move Issue to "Assigned" Column in "Candidates for University Projects"
18-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
18+
uses: m7kvqbe1/github-action-move-issues@main
1919
with:
2020
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
2121
project-url: "https://github.com/orgs/JabRef/projects/3"
@@ -25,7 +25,7 @@ jobs:
2525
default-column: "Free to take"
2626
skip-if-not-in-project: true
2727
- name: Move Issue to "Assigned" Column in "Good First Issues"
28-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
28+
uses: m7kvqbe1/github-action-move-issues@main
2929
with:
3030
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
3131
project-url: "https://github.com/orgs/JabRef/projects/5"
@@ -59,7 +59,7 @@ jobs:
5959
6060
Happy coding! 🚀
6161
- name: Move Issue to "Assigned" Column in "Candidates for University Projects"
62-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
62+
uses: m7kvqbe1/github-action-move-issues@main
6363
with:
6464
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
6565
project-url: "https://github.com/orgs/JabRef/projects/3"
@@ -69,7 +69,7 @@ jobs:
6969
default-column: "Free to take"
7070
skip-if-not-in-project: true
7171
- name: Move Issue to "Assigned" Column in "Good First Issues"
72-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
72+
uses: m7kvqbe1/github-action-move-issues@main
7373
with:
7474
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
7575
project-url: "https://github.com/orgs/JabRef/projects/5"

.github/workflows/on-issue-unlabeled.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
issues: write
1515
steps:
1616
- name: Move Issue to "Free to take" Column in "Candidates for University Projects"
17-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
17+
uses: m7kvqbe1/github-action-move-issues@main
1818
with:
1919
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
2020
project-url: "https://github.com/orgs/JabRef/projects/3"
@@ -24,7 +24,7 @@ jobs:
2424
default-column: "Free to take"
2525
skip-if-not-in-project: true
2626
- name: Move Issue to "Free to take" Column in "Good First Issues"
27-
uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag
27+
uses: m7kvqbe1/github-action-move-issues@main
2828
with:
2929
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
3030
project-url: "https://github.com/orgs/JabRef/projects/5"

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

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Mark issue as available
2+
3+
on:
4+
pull_request_target:
5+
types: [ closed ]
6+
7+
jobs:
8+
unassign_issue:
9+
runs-on: ubuntu-latest
10+
if: github.event.action == 'closed' && !github.event.pull_request.merged
11+
permissions:
12+
contents: read
13+
issues: write
14+
steps:
15+
- name: Determine issue number
16+
id: get_issue_number
17+
uses: koppor/ticket-check-action@add-output
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
ticketLink: 'https://github.com/:owner/:repo/issues/%ticketNumber%'
21+
ticketPrefix: '#'
22+
titleRegex: '^#(?<ticketNumber>\d+)'
23+
branchRegex: '^(?<ticketNumber>\d+)'
24+
bodyRegex: '#(?<ticketNumber>\d+)'
25+
bodyURLRegex: 'http(s?):\/\/(github.com)(\/:owner)(\/:repo)(\/issues)\/(?<ticketNumber>\d+)'
26+
outputOnly: true
27+
- name: Move issue to "Free to take" in "Good First Issues"
28+
uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
29+
with:
30+
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
31+
project-url: "https://github.com/orgs/JabRef/projects/5"
32+
target-labels: "📍 Assigned"
33+
target-column: "Free to take"
34+
ignored-columns: ""
35+
default-column: "Free to take"
36+
issue-number: ${{ steps.get_issue_number.outputs.ticketNumber }}
37+
skip-if-not-in-project: true
38+
- name: Move issue to "Free to take" in "Candidates for University Projects"
39+
uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
40+
with:
41+
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
42+
project-url: "https://github.com/orgs/JabRef/projects/3"
43+
target-labels: "📍 Assigned"
44+
target-column: "Free to take"
45+
ignored-columns: ""
46+
default-column: "Free to take"
47+
issue-number: ${{ steps.get_issue_number.outputs.ticketNumber }}
48+
skip-if-not-in-project: true
49+
- uses: actions/checkout@v4
50+
- name: Remove assigned status
51+
run : gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --remove-assignee ${{ github.event.pull_request.user.login }}
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
- name: Remove assigned label
55+
run : gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --remove-label "📍 Assigned"
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Mark issue as in progress
2+
3+
on:
4+
# _target is required
5+
pull_request_target:
6+
7+
jobs:
8+
move_issue:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Determine issue number
14+
id: get_issue_number
15+
uses: koppor/ticket-check-action@add-output
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
ticketLink: 'https://github.com/:owner/:repo/issues/%ticketNumber%'
19+
ticketPrefix: '#'
20+
titleRegex: '^#(?<ticketNumber>\d+)'
21+
branchRegex: '^(?<ticketNumber>\d+)'
22+
bodyRegex: '#(?<ticketNumber>\d+)'
23+
bodyURLRegex: 'http(s?):\/\/(github.com)(\/:owner)(\/:repo)(\/issues)\/(?<ticketNumber>\d+)'
24+
outputOnly: true
25+
- name: Move issue to "In Progress" in "Good First Issues"
26+
uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
27+
with:
28+
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
29+
project-url: "https://github.com/orgs/JabRef/projects/5"
30+
target-labels: "📍 Assigned"
31+
target-column: "In Progress"
32+
ignored-columns: ""
33+
default-column: "In Progress"
34+
issue-number: ${{ steps.get_issue_number.outputs.ticketNumber }}
35+
skip-if-not-in-project: true
36+
- name: Move issue to "In Progress" in "Candidates for University Projects"
37+
uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
38+
with:
39+
github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
40+
project-url: "https://github.com/orgs/JabRef/projects/7"
41+
target-labels: "📍 Assigned"
42+
target-column: "In Progress"
43+
ignored-columns: ""
44+
default-column: "In Progress"
45+
issue-number: ${{ steps.get_issue_number.outputs.ticketNumber }}
46+
skip-if-not-in-project: true
47+
upload-pr-number:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Create pr_number.txt
51+
run: echo "${{ github.event.number }}" > pr_number.txt
52+
- uses: actions/upload-artifact@v4
53+
with:
54+
name: pr_number
55+
path: pr_number.txt

.github/workflows/pr-comment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Comment on PR
77

88
on:
99
workflow_run:
10-
workflows: ["Tests"]
10+
workflows: ["Tests", "Mark issue as in progress"]
1111
types:
1212
- completed
1313

@@ -56,7 +56,7 @@ jobs:
5656
if: ${{ steps.read-pr_number.outputs.pr_number != '' && steps.isCrossRepository.outputs.isCrossRepository == 'true' }}
5757
uses: jbangdev/[email protected]
5858
with:
59-
script: ghprcomment@koppor/ghprcomment
59+
script: https://github.com/koppor/ghprcomment/blob/fix-4/ghprcomment.java
6060
scriptargs: "-r JabRef/jabref -p ${{ steps.read-pr_number.outputs.pr_number }} -w ${{ github.event.workflow_run.id }}"
6161
trust: https://github.com/koppor/ghprcomment/
6262
env:

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
4646
- The embedded PostgresSQL server for the search now supports Linux and macOS ARM based distributions natively [#12607](https://github.com/JabRef/jabref/pull/12607)
4747
- We disabled the search and group fields in the sidebar when no library is opened. [#12657](https://github.com/JabRef/jabref/issues/12657)
4848
- We removed the obsolete Twitter link and added Mastodon and LinkedIn links in Help -> JabRef resources. [#12660](https://github.com/JabRef/jabref/issues/12660)
49+
- We improved journal abbreviation lookup with fuzzy matching to handle minor input errors and variations. [#12467](https://github.com/JabRef/jabref/issues/12467)
4950

5051
### Fixed
5152

src/main/java/org/jabref/gui/journals/UndoableAbbreviator.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.jabref.gui.journals;
22

3+
import java.util.Optional;
4+
35
import javax.swing.undo.CompoundEdit;
46

57
import org.jabref.gui.undo.UndoableFieldChange;
@@ -44,11 +46,13 @@ public boolean abbreviate(BibDatabase database, BibEntry entry, Field fieldName,
4446
text = database.resolveForStrings(text);
4547
}
4648

47-
if (!journalAbbreviationRepository.isKnownName(text)) {
49+
Optional<Abbreviation> foundAbbreviation = journalAbbreviationRepository.get(text);
50+
51+
if (foundAbbreviation.isEmpty()) {
4852
return false; // Unknown, cannot abbreviate anything.
4953
}
5054

51-
Abbreviation abbreviation = journalAbbreviationRepository.get(text).get();
55+
Abbreviation abbreviation = foundAbbreviation.get();
5256
String newText = getAbbreviatedName(abbreviation);
5357

5458
if (newText.equals(origText)) {

src/main/java/org/jabref/logic/journals/Abbreviation.java

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import java.io.Serializable;
44
import java.util.Objects;
55

6+
/**
7+
* The class provides functionality for managing journal abbreviations.
8+
* <a href="https://docs.jabref.org/advanced/journalabbreviations">JabRef Journal Abbreviations Documentation</a>
9+
*/
610
public class Abbreviation implements Comparable<Abbreviation>, Serializable {
711

812
private static final long serialVersionUID = 1;

0 commit comments

Comments
 (0)