Skip to content

Commit 18800b9

Browse files
committed
Merge remote-tracking branch 'upstream/master' into allowReordering
* upstream/master: Fix image path Check for secrets being present at GitHub workflows (#5973) Add "JabRef and Software Engineering" Make Java code acceptable for GitBook - and fix link to JUnit antipatterns Let "Contributing" be displayed Merge the reviewing steops of "Code Quality" to "Development Strategy" Try to include CONTRIBUTING.md in devdocs.jabref.org Minor improvments in CONTRIBUTING.md Update Codecov yaml with proper indentation (#6156) Complete refactor of LibraryProperties to mvvm (#6107) Try comment:false Remove duplicated line Fix: Only if `.sav` file has changes a recovery dialog is shown (#6116) Fix formatting for GitBook Add hint to scroll down
2 parents 4a2737f + 25765d5 commit 18800b9

File tree

60 files changed

+1871
-808
lines changed

Some content is hidden

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

60 files changed

+1871
-808
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Check dependencies
22

3-
on:
3+
on:
44
schedule:
55
- cron: '0 0 * * TUE' # Run every Tuesday (after dependabot, which runs Monday)
66

@@ -9,21 +9,18 @@ jobs:
99
name: Check dependencies
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout source
13-
uses: actions/checkout@v1
14-
with:
15-
depth: 1
16-
submodules: false
17-
- name: Set up JDK
18-
uses: actions/setup-java@v1
19-
with:
20-
java-version: 14
21-
- name: Look for outdated dependencies
22-
run: ./gradlew -q checkOutdatedDependencies
23-
- name: Report issues
24-
if: failure()
25-
uses: JasonEtco/create-an-issue@master
26-
env:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
with:
29-
filename: .github/outdatedDependencies.md
12+
- name: Checkout source
13+
uses: actions/checkout@v2
14+
- name: Set up JDK
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 14
18+
- name: Look for outdated dependencies
19+
run: ./gradlew -q checkOutdatedDependencies
20+
- name: Report issues
21+
if: failure()
22+
uses: JasonEtco/create-an-issue@master
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
filename: .github/outdatedDependencies.md

.github/workflows/cleanup_pr.yml

+25-12
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- name: Extract branch name
13-
id: extract_branch
14-
run: |
15-
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
16-
- name: Delete folder on builds.jabref.org
17-
uses: appleboy/ssh-action@v0.0.6
18-
with:
19-
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }}
20-
host: build-upload.jabref.org
21-
port: 9922
22-
username: jrrsync
23-
key: ${{ secrets.buildJabRefPrivateKey }}
12+
- name: Check secrets presence
13+
id: checksecrets
14+
shell: bash
15+
run: |
16+
if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
17+
echo ::set-output name=secretspresent::false
18+
else
19+
echo ::set-output name=secretspresent::true
20+
fi
21+
env:
22+
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
23+
- name: Extract branch name
24+
id: extract_branch
25+
if: ${{ steps.checksecrets.outputs.secretspresent }}
26+
run: |
27+
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
28+
- name: Delete folder on builds.jabref.org
29+
if: ${{ steps.checksecrets.outputs.secretspresent }}
30+
uses: appleboy/ssh-action@v0.0.6
31+
with:
32+
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }}
33+
host: build-upload.jabref.org
34+
port: 9922
35+
username: jrrsync
36+
key: ${{ secrets.buildJabRefPrivateKey }}

.github/workflows/deployment.yml

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ jobs:
9393
runs-on: ubuntu-latest
9494
needs: [build]
9595
steps:
96+
- name: Check secrets presence
97+
id: checksecrets
98+
shell: bash
99+
run: |
100+
if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
101+
echo ::set-output name=secretspresent::false
102+
else
103+
echo ::set-output name=secretspresent::true
104+
fi
105+
env:
106+
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
96107
- name: Checkout source
97108
uses: actions/checkout@v2
98109
- name: Fetch all history for all tags and branches
@@ -121,6 +132,7 @@ jobs:
121132
path: build/distribution/
122133
- name: Deploy to builds.jabref.org
123134
id: deploy
135+
if: ${{ steps.checksecrets.outputs.secretspresent }}
124136
uses: Pendect/action-rsyncer@v1.1.0
125137
env:
126138
DEPLOY_KEY: ${{ secrets.buildJabRefPrivateKey }}

.github/workflows/snap.yml

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ jobs:
1111
name: Create snapcraft image
1212

1313
steps:
14+
- name: Check secrets presence
15+
id: checksecrets
16+
shell: bash
17+
run: |
18+
if [ "SNAPCRAFT_LOGIN_FILE" == "" ]; then
19+
echo ::set-output name=secretspresent::false
20+
else
21+
echo ::set-output name=secretspresent::true
22+
fi
23+
env:
24+
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
1425
- name: Checkout source
1526
uses: actions/checkout@v2
1627
# The image relies on https://builds.jabref.org/master/JabRef-5.0-portable_linux.tar.gz^
@@ -19,6 +30,7 @@ jobs:
1930
uses: jhenstridge/snapcraft-build-action@v1
2031
id: snapcraft
2132
- name: Build snap (2) Upload snap
33+
if: ${{ steps.checksecrets.outputs.secretspresent }}
2234
uses: jhenstridge/snapcraft-publish-action@v1
2335
with:
2436
store_login: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}

.github/workflows/tests-fetchers.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Checkout source
33-
uses: actions/checkout@v1
34-
with:
35-
depth: 1
36-
submodules: false
33+
uses: actions/checkout@v2
3734
- name: Set up JDK
3835
uses: actions/setup-java@v1
3936
with:

.github/workflows/tests-oracle.yml

+21-8
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,42 @@ jobs:
2626
name: Oracle tests
2727
runs-on: ubuntu-latest
2828
steps:
29+
- name: Check secrets presence
30+
id: checksecrets
31+
shell: bash
32+
run: |
33+
if [ "CCRYPT" == "" ]; then
34+
echo ::set-output name=secretspresent::false
35+
else
36+
echo ::set-output name=secretspresent::true
37+
fi
38+
env:
39+
SNAPCRAFT_LOGIN_FILE: ${{ secrets.CCRYPT }}
2940
- name: Checkout source
30-
uses: actions/checkout@v1
31-
with:
32-
depth: 1
33-
submodules: false
41+
uses: actions/checkout@v2
3442
- name: Set up JDK
43+
if: ${{ steps.checksecrets.outputs.secretspresent }}
3544
uses: actions/setup-java@v1
3645
with:
3746
java-version: 14
38-
- uses: actions/cache@v1
39-
name: Restore gradle chache
47+
- name: Restore gradle chache
48+
if: ${{ steps.checksecrets.outputs.secretspresent }}
49+
uses: actions/cache@v1
4050
with:
4151
path: ~/.gradle/caches
4252
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
4353
restore-keys: |
4454
${{ runner.OS }}-gradle-${{ env.cache-name }}-
4555
${{ runner.OS }}-gradle-
4656
${{ runner.OS }}-
47-
- uses: actions/cache@v1
48-
name: Restore gradle wrapper
57+
- name: Restore gradle wrapper
58+
if: ${{ steps.checksecrets.outputs.secretspresent }}
59+
uses: actions/cache@v1
4960
with:
5061
path: ~/.gradle/wrapper
5162
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
5263
- name: Start Oracle XE
64+
if: ${{ steps.checksecrets.outputs.secretspresent }}
5365
run: |
5466
mkdir ~/oracle-xe || true
5567
cd ~/oracle-xe
@@ -71,6 +83,7 @@ jobs:
7183
env:
7284
CCRYPT: ${{ secrets.CCRYPT }}
7385
- name: Run database test
86+
if: ${{ steps.checksecrets.outputs.secretspresent }}
7487
run: ./gradlew databaseTest --rerun-tasks
7588
env:
7689
DBMS: "oracle"

.github/workflows/tests.yml

+12
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ jobs:
170170
# needed because the postgres container does not provide a healthcheck
171171
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
172172
steps:
173+
- name: Check secrets presence
174+
id: checksecrets
175+
shell: bash
176+
run: |
177+
if [ "CODECOV_TOKEN" == "" ]; then
178+
echo ::set-output name=secretspresent::false
179+
else
180+
echo ::set-output name=secretspresent::true
181+
fi
182+
env:
183+
SNAPCRAFT_LOGIN_FILE: ${{ secrets.CODECOV_TOKEN }}
173184
- name: Checkout source
174185
uses: actions/checkout@v2
175186
- name: Set up JDK
@@ -191,6 +202,7 @@ jobs:
191202
path: ~/.gradle/wrapper
192203
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
193204
- name: Update test coverage metrics
205+
if: ${{ steps.checksecrets.outputs.secretspresent }}
194206
run: xvfb-run --auto-servernum ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash);
195207
env:
196208
CI: "false" # we pretend to run locally - even if tests fail on the CI, they count towards test coverage

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ src/main/generated/
55
# private data
66
/buildres/jabref-cert-2016.p12
77

8+
# GitBook assets
9+
docs/book.pdf
10+
docs/_book/
11+
812
# ignore the generated markdown file if the user forgets to delete it
913
status.md
1014

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
1616

1717
- We improved the arXiv fetcher. Now it should find entries even more reliably and does no longer include the version (e.g `v1`) in the `eprint` field. [forum#1941](https://discourse.jabref.org/t/remove-version-in-arxiv-import/1941)
1818
- We moved the group search bar and the button "New group" from bottom to top position to make it more prominent. [#6112](https://github.com/JabRef/jabref/pull/6112)
19+
- When JabRef finds a `.sav` file without changes, there is no dialog asking for acceptance of changes anymore.
1920
- We changed the buttons for import/export/show all/reset of preferences to smaller icon buttons in the preferences dialog. [#6130](https://github.com/JabRef/jabref/pull/6130)
2021
- We moved the functionality "Manage field names & content" from the "Library" menu to the "Edit" menu, because it affects the selected entries and not the whole library
2122

@@ -41,7 +42,6 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
4142
- Filenames of external files can no longer contain curly braces. [#5926](https://github.com/JabRef/jabref/pull/5926)
4243
- We made the filters more easily accessible in the integrity check dialog. [#5955](https://github.com/JabRef/jabref/pull/5955)
4344
- We reimplemented and improved the dialog "Customize entry types". [#4719](https://github.com/JabRef/jabref/issues/4719)
44-
- We reimplemented and improved the dialog "Customize entry types" [#4719](https://github.com/JabRef/jabref/issues/4719)
4545
- We added an [American Physical Society](https://journals.aps.org/) fetcher. [#818](https://github.com/JabRef/jabref/issues/818)
4646

4747
### Fixed

CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ We should also be online at [gitter](https://gitter.im/JabRef/jabref).
2121

2222
The main goal of the formal requirements is to provide credit to you and to be able to understand the patch.
2323

24-
### Add your change to CHANGELOG.md
24+
### Add your change to `CHANGELOG.md`
2525

2626
You should edit the [CHANGELOG.md](CHANGELOG.md) located in the root directory of the JabRef source.
2727
Add a line with your changes in the appropriate section.
2828

2929
If you did internal refactorings or improvements not visible to the user (e.g., UI, .bib file), then you don't need to put an entry there.
3030

31-
#### Key format
31+
#### Format of keyboard shortcuts
3232

3333
Example: `<kbd>Ctrl</kbd> + <kbd>Enter</kbd>`
3434

@@ -95,7 +95,7 @@ accepting <downside / undesired consequences>,
9595
because <additional rationale>.
9696
```
9797

98-
### When adding a new Localization.lang entry
98+
### When adding a new `Localization.lang` entry
9999

100100
Add new `Localization.lang("KEY")` to a Java file.
101101
The tests will fail. In the test output a snippet is generated, which must be added to the English translation file.
@@ -119,9 +119,9 @@ You can also directly run the specific test in your IDE.
119119
The test "LocalizationConsistencyTest" is placed under `src/test/java/net.sf.jabref.logic.l10n/LocalizationConsistencyTest.java`
120120
Find more information in the [JabRef Wiki](https://github.com/JabRef/jabref/wiki/Code-Howtos#using-localization-correctly).
121121

122-
### Create a pull request
122+
## Create a pull request
123123

124-
Create a pull request on GitHub.
124+
Create a pull request on GitHub following GitHub's guide "[Creating a pull request from a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)".
125125
For text inspirations, consider [How to write the perfect pull request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request).
126126

127127
If you want to indicate that a pull request is not yet complete **before** creating the pull request, you may consider creating a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/).

codecov.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ coverage:
33
- src/gen/.*
44
status:
55
patch: false
6-
project:
7-
default:
8-
threshold: 0.005
9-
comment:
10-
branches:
11-
- "do-not-add-comment-to-any-branch-please"
6+
project:
7+
default:
8+
threshold: 0.01
9+
comment: false

docs/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
This page presents all development informatation around JabRef. For users documentation see [https://docs.jabref.org](https://docs.jabref.org).
44

5-
## Excersises
5+
## Teaching Excersises
66

7-
Uni Basel offers a German \(🇩🇪\) Software Engineering course which uses JabRef as one example. Look at [Exercise 5](https://github.com/unibas-marcelluethi/software-engineering/blob/master/docs/week5/exercises/practical-exercises.md) for an exercise where some important points of JabRef are touched.
7+
We are very happy that JabRef is part of [Software Engineering](https://en.wikipedia.org/wiki/Software_engineering) trainings.
8+
Please head to [Teaching](teaching.md) for more information on using JabRef as teaching object and on previous courses where JabRef was used.
89

910
## How tos
1011

@@ -17,7 +18,7 @@ The package `org.jabref.cli` is responsible for handling the command line option
1718

1819
During development, one can configure IntelliJ to pass command line paramters:
1920

20-
![IntelliJ-run-configuration](.gitbook/assets/intellij-run-configuration-command-line%20%282%29.png)
21+
![IntelliJ-run-configuration](images/intellij-run-configuration-command-line.png)
2122

2223
Passing command line arguments using gradle is currently not possible as all arguments \(such as `-Dfile.encoding=windows-1252`\) are passed to the application.
2324

docs/SUMMARY.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Table of contents
22

33
* [Overview on Developing](README.md)
4+
* [Contributing](contributing.md)
45
* [Architectural Decisions](adr/README.md)
56
* Getting into the code
67
* [Set up a local workspace](guidelines-for-setting-up-a-local-workspace.md)
@@ -13,6 +14,7 @@
1314
* [Recommendations for UI design](ui-recommendations.md)
1415
* [Custom SVG icons](custom-svg-icons.md)
1516
* [Creating a binary and debug it](jpackage.md)
17+
* [JabRef and Software Engineering](teaching.md)
1618
* Readings on Coding
1719
* [Readings on JavaFX](javafx.md)
1820
* [Useful development tooling](tools.md)

docs/code-howtos.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,11 @@ Imagine you want to test the method `format(String value)` in the class `BracesF
227227
testFormat() {
228228
assertEqual("test", format("test"));
229229
assertEqual("{test", format("{test"));
230-
assertEqual("test", format("{{test"));
231230
assertEqual("test", format("test}}"));
232-
assertEqual("test", format("{{test}}"));
233231
}
234232
```
235233

236-
we would have five tests containing a single `assert` statement and named accordingly \(`formatDoesNotChangeStringWithoutBraces`, `formatDoesNotRemoveSingleBrace`, `formatRemovesDoubleBracesAtBeginning`, etc.\). See [JUnit AntiPattern](http://www.exubero.com/junit/antipatterns.html#Multiple_Assertions) for background.
234+
we would have five tests containing a single `assert` statement and named accordingly \(`formatDoesNotChangeStringWithoutBraces`, `formatDoesNotRemoveSingleBrace`, , etc.\). See [JUnit AntiPattern](https://exubero.com/junit/anti-patterns/#Multiple_Assertions) for background.
237235

238236
* Do _not just test happy paths_, but also wrong/weird input.
239237
* It is recommend to write tests _before_ you actually implement the functionality \(test driven development\).

docs/code-quality.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,4 @@ We strongly recommend to read following two books on code quality:
1111
* [Java by Comparison](https://github.com/JabRef/jabref/tree/c81740b3818c7f9311a6d7ff063243e672c821b4/docs/java.by-comparison.com) is a book by three JabRef developers which focuses on code improvements close to single statements. It is fast to read and one gains much information from each recommendation discussed in the book.
1212
* [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/) is the standard book for advanced Java programming. Did you know that `enum` is the [recommended way to enforce a singleton instance of a class](https://learning.oreilly.com/library/view/effective-java-3rd/9780134686097/ch2.xhtml#lev3)? Did you know that one should [refer to objects by their interfaces](https://learning.oreilly.com/library/view/effective-java-3rd/9780134686097/ch9.xhtml#lev64)?
1313

14-
This is how we ensure code quality in JabRef:
15-
16-
* we review each external pull request by at least two [JabRef Core Developers](https://github.com/JabRef/jabref/blob/master/DEVELOPERS).
17-
* we document our design decisions using the lightweight architectural decision records [MADR](https://adr.github.io/madr/).
18-
* we follow the principles of [Java by Comparison](https://java.by-comparison.com/).
19-
* we follow the principles of [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/).
20-
* we use [Design Pattners](https://java-design-patterns.com/patterns/) when applicable.
14+
The principles we follow to ensure high code quality in JabRef is stated at our [Development Strategy](development-strategy.md).

docs/contributing.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "git+https://github.com/JabRef/jabref.git/CONTRIBUTING.md#master" %}

docs/development-strategy.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ We aim to keep up to high-quality code standards and use code quality tools wher
44

55
To ensure high code-quality,
66

7-
* we follow the principles of [Java by Comparison](https://java.by-comparison.com/).
8-
* we follow the principles of [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/).
9-
* we use [Design Patterns](https://java-design-patterns.com/patterns/) when applicable.
10-
* we document our design decisions using the lightweight architectural decision records [MADR](https://adr.github.io/madr/).
11-
* we review each external pull request by at least two [JabRef Core Developers](https://github.com/JabRef/jabref/blob/master/DEVELOPERS).
7+
* We follow the principles of [Java by Comparison](https://java.by-comparison.com/).
8+
* We follow the principles of [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/).
9+
* We use [Design Patterns](https://java-design-patterns.com/patterns/) when applicable.
10+
* We document our design decisions using the lightweight architectural decision records [MADR](https://adr.github.io/madr/).
11+
* We review each external pull request by at least two [JabRef Core Developers](https://github.com/JabRef/jabref/blob/master/DEVELOPERS).
1212

1313
Read on about our automated quality checks at [Code Quality](code-quality.md).
1414

0 commit comments

Comments
 (0)