Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into allowReordering
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Siedlerchr committed Mar 23, 2020
2 parents 4a2737f + 25765d5 commit 18800b9
Show file tree
Hide file tree
Showing 60 changed files with 1,871 additions and 808 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/check-outdated-dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check dependencies

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

Expand All @@ -9,21 +9,18 @@ jobs:
name: Check dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v1
with:
depth: 1
submodules: false
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 14
- name: Look for outdated dependencies
run: ./gradlew -q checkOutdatedDependencies
- name: Report issues
if: failure()
uses: JasonEtco/create-an-issue@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/outdatedDependencies.md
- name: Checkout source
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 14
- name: Look for outdated dependencies
run: ./gradlew -q checkOutdatedDependencies
- name: Report issues
if: failure()
uses: JasonEtco/create-an-issue@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/outdatedDependencies.md
37 changes: 25 additions & 12 deletions .github/workflows/cleanup_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Extract branch name
id: extract_branch
run: |
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
- name: Delete folder on builds.jabref.org
uses: appleboy/[email protected]
with:
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }}
host: build-upload.jabref.org
port: 9922
username: jrrsync
key: ${{ secrets.buildJabRefPrivateKey }}
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
echo ::set-output name=secretspresent::false
else
echo ::set-output name=secretspresent::true
fi
env:
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
- name: Extract branch name
id: extract_branch
if: ${{ steps.checksecrets.outputs.secretspresent }}
run: |
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
- name: Delete folder on builds.jabref.org
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: appleboy/[email protected]
with:
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }}
host: build-upload.jabref.org
port: 9922
username: jrrsync
key: ${{ secrets.buildJabRefPrivateKey }}
12 changes: 12 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
echo ::set-output name=secretspresent::false
else
echo ::set-output name=secretspresent::true
fi
env:
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
- name: Checkout source
uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
Expand Down Expand Up @@ -121,6 +132,7 @@ jobs:
path: build/distribution/
- name: Deploy to builds.jabref.org
id: deploy
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: Pendect/[email protected]
env:
DEPLOY_KEY: ${{ secrets.buildJabRefPrivateKey }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ jobs:
name: Create snapcraft image

steps:
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "SNAPCRAFT_LOGIN_FILE" == "" ]; then
echo ::set-output name=secretspresent::false
else
echo ::set-output name=secretspresent::true
fi
env:
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
- name: Checkout source
uses: actions/checkout@v2
# The image relies on https://builds.jabref.org/master/JabRef-5.0-portable_linux.tar.gz^
Expand All @@ -19,6 +30,7 @@ jobs:
uses: jhenstridge/snapcraft-build-action@v1
id: snapcraft
- name: Build snap (2) Upload snap
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: jhenstridge/snapcraft-publish-action@v1
with:
store_login: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/tests-fetchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v1
with:
depth: 1
submodules: false
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/tests-oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,42 @@ jobs:
name: Oracle tests
runs-on: ubuntu-latest
steps:
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "CCRYPT" == "" ]; then
echo ::set-output name=secretspresent::false
else
echo ::set-output name=secretspresent::true
fi
env:
SNAPCRAFT_LOGIN_FILE: ${{ secrets.CCRYPT }}
- name: Checkout source
uses: actions/checkout@v1
with:
depth: 1
submodules: false
uses: actions/checkout@v2
- name: Set up JDK
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: actions/setup-java@v1
with:
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
- name: Restore gradle chache
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.OS }}-gradle-${{ env.cache-name }}-
${{ runner.OS }}-gradle-
${{ runner.OS }}-
- uses: actions/cache@v1
name: Restore gradle wrapper
- name: Restore gradle wrapper
if: ${{ steps.checksecrets.outputs.secretspresent }}
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Start Oracle XE
if: ${{ steps.checksecrets.outputs.secretspresent }}
run: |
mkdir ~/oracle-xe || true
cd ~/oracle-xe
Expand All @@ -71,6 +83,7 @@ jobs:
env:
CCRYPT: ${{ secrets.CCRYPT }}
- name: Run database test
if: ${{ steps.checksecrets.outputs.secretspresent }}
run: ./gradlew databaseTest --rerun-tasks
env:
DBMS: "oracle"
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ jobs:
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "CODECOV_TOKEN" == "" ]; then
echo ::set-output name=secretspresent::false
else
echo ::set-output name=secretspresent::true
fi
env:
SNAPCRAFT_LOGIN_FILE: ${{ secrets.CODECOV_TOKEN }}
- name: Checkout source
uses: actions/checkout@v2
- name: Set up JDK
Expand All @@ -191,6 +202,7 @@ jobs:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Update test coverage metrics
if: ${{ steps.checksecrets.outputs.secretspresent }}
run: xvfb-run --auto-servernum ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash);
env:
CI: "false" # we pretend to run locally - even if tests fail on the CI, they count towards test coverage
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ src/main/generated/
# private data
/buildres/jabref-cert-2016.p12

# GitBook assets
docs/book.pdf
docs/_book/

# ignore the generated markdown file if the user forgets to delete it
status.md

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

- 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)
- 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)
- When JabRef finds a `.sav` file without changes, there is no dialog asking for acceptance of changes anymore.
- 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)
- 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

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

### Fixed
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ We should also be online at [gitter](https://gitter.im/JabRef/jabref).

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

### Add your change to CHANGELOG.md
### Add your change to `CHANGELOG.md`

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

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.

#### Key format
#### Format of keyboard shortcuts

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

Expand Down Expand Up @@ -95,7 +95,7 @@ accepting <downside / undesired consequences>,
because <additional rationale>.
```

### When adding a new Localization.lang entry
### When adding a new `Localization.lang` entry

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

### Create a pull request
## Create a pull request

Create a pull request on GitHub.
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)".
For text inspirations, consider [How to write the perfect pull request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request).

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/).
Expand Down
10 changes: 4 additions & 6 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ coverage:
- src/gen/.*
status:
patch: false
project:
default:
threshold: 0.005
comment:
branches:
- "do-not-add-comment-to-any-branch-please"
project:
default:
threshold: 0.01
comment: false
7 changes: 4 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

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

## Excersises
## Teaching Excersises

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.
We are very happy that JabRef is part of [Software Engineering](https://en.wikipedia.org/wiki/Software_engineering) trainings.
Please head to [Teaching](teaching.md) for more information on using JabRef as teaching object and on previous courses where JabRef was used.

## How tos

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

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

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

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

Expand Down
2 changes: 2 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Table of contents

* [Overview on Developing](README.md)
* [Contributing](contributing.md)
* [Architectural Decisions](adr/README.md)
* Getting into the code
* [Set up a local workspace](guidelines-for-setting-up-a-local-workspace.md)
Expand All @@ -13,6 +14,7 @@
* [Recommendations for UI design](ui-recommendations.md)
* [Custom SVG icons](custom-svg-icons.md)
* [Creating a binary and debug it](jpackage.md)
* [JabRef and Software Engineering](teaching.md)
* Readings on Coding
* [Readings on JavaFX](javafx.md)
* [Useful development tooling](tools.md)
4 changes: 1 addition & 3 deletions docs/code-howtos.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,11 @@ Imagine you want to test the method `format(String value)` in the class `BracesF
testFormat() {
assertEqual("test", format("test"));
assertEqual("{test", format("{test"));
assertEqual("test", format("{{test"));
assertEqual("test", format("test}}"));
assertEqual("test", format("{{test}}"));
}
```

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.
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.

* Do _not just test happy paths_, but also wrong/weird input.
* It is recommend to write tests _before_ you actually implement the functionality \(test driven development\).
Expand Down
8 changes: 1 addition & 7 deletions docs/code-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,4 @@ We strongly recommend to read following two books on code quality:
* [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.
* [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)?

This is how we ensure code quality in JabRef:

* we review each external pull request by at least two [JabRef Core Developers](https://github.com/JabRef/jabref/blob/master/DEVELOPERS).
* we document our design decisions using the lightweight architectural decision records [MADR](https://adr.github.io/madr/).
* we follow the principles of [Java by Comparison](https://java.by-comparison.com/).
* we follow the principles of [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/).
* we use [Design Pattners](https://java-design-patterns.com/patterns/) when applicable.
The principles we follow to ensure high code quality in JabRef is stated at our [Development Strategy](development-strategy.md).
1 change: 1 addition & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include "git+https://github.com/JabRef/jabref.git/CONTRIBUTING.md#master" %}
10 changes: 5 additions & 5 deletions docs/development-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ We aim to keep up to high-quality code standards and use code quality tools wher

To ensure high code-quality,

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

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

Expand Down
Loading

0 comments on commit 18800b9

Please sign in to comment.