Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Apr 24, 2024
2 parents 4dbe693 + b8b451d commit 3d70693
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 61 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,21 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
- name: Ensure to use tagged version
if: startsWith(github.ref, 'refs/tags/')
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
run: mvn -B versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
- name: Build and Test
id: buildAndTest
run: mvn -B clean install jacoco:report -Pcoverage,dependency-check
- name: Upload code coverage report
id: codacyCoverageReporter
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
continue-on-error: true
- uses: actions/upload-artifact@v3
run: mvn -B clean install jacoco:report -Pcoverage
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: target/*.jar
- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
fetch-depth: 2
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: java
- name: Build
run: mvn -B compile
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
20 changes: 20 additions & 0 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: OWASP Maven Dependency Check
on:
schedule:
- cron: '0 9 * * 0'
push:
branches:
- 'release/**'
workflow_dispatch:


jobs:
check-dependencies:
uses: skymatic/workflows/.github/workflows/run-dependency-check.yml@v1
with:
runner-os: 'ubuntu-latest'
java-distribution: 'zulu'
java-version: 22
secrets:
nvd-api-key: ${{ secrets.NVD_API_KEY }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'zulu'
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Mirror.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 34 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>fuse-nio-adapter</artifactId>
<version>4.0.0</version>
<version>5.0.0</version>
<name>FUSE-NIO-Adapter</name>
<description>Access resources at a given NIO path via FUSE.</description>
<url>https://github.com/cryptomator/fuse-nio-adapter</url>
Expand All @@ -17,23 +17,23 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.jdk>21</project.build.jdk>
<project.build.jdk>22</project.build.jdk>

<!-- dependencies -->
<integrations-api.version>1.3.0</integrations-api.version>
<jfuse.version>0.6.3</jfuse.version>
<slf4j.version>2.0.9</slf4j.version>
<integrations-api.version>1.3.1</integrations-api.version>
<jfuse.version>0.7.0</jfuse.version>
<slf4j.version>2.0.13</slf4j.version>
<caffeine.version>3.1.8</caffeine.version>

<!-- test dependencies -->
<junit.jupiter.version>5.10.0</junit.jupiter.version>
<mockito.version>5.6.0</mockito.version>
<cryptofs.version>2.6.7</cryptofs.version>
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<mockito.version>5.11.0</mockito.version>
<cryptofs.version>2.6.9</cryptofs.version>

<!-- build dependencies -->
<dependency-check.version>8.4.2</dependency-check.version>
<dependency-check.version>9.1.0</dependency-check.version>
<maven.deploy.version>3.1.1</maven.deploy.version>
<jacoco.version>0.8.11</jacoco.version>
<jacoco.version>0.8.12</jacoco.version>
</properties>

<licenses>
Expand Down Expand Up @@ -152,15 +152,25 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<showWarnings>true</showWarnings>
<release>${project.build.jdk}</release>
<compilerArgs>
<compilerArg>--enable-preview</compilerArg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>jar-paths-to-properties</id>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand All @@ -179,19 +189,19 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.5</version>
<configuration>
<argLine>@{surefire.jacoco.args} --enable-preview --enable-native-access=ALL-UNNAMED</argLine>
<argLine>@{surefire.jacoco.args} -javaagent:${net.bytebuddy:byte-buddy-agent:jar}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -203,7 +213,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down Expand Up @@ -236,19 +246,19 @@
<artifactId>dependency-check-maven</artifactId>
<version>${dependency-check.version}</version>
<configuration>
<cveValidForHours>24</cveValidForHours>
<nvdValidForHours>24</nvdValidForHours>
<failBuildOnCVSS>0</failBuildOnCVSS>
<skipTestScope>true</skipTestScope>
<detail>true</detail>
<suppressionFiles>
<suppressionFile>suppression.xml</suppressionFile>
</suppressionFiles>
<suppressionFile>suppression.xml</suppressionFile>
<nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -282,7 +292,7 @@
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected int checkAccess(Path path, Set<AccessMode> requiredAccessModes, Set<Ac
@Override
public int readlink(String path, ByteBuffer buf, long size) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
Path node = resolvePath(fileNameTranscoder.fuseToNio(path));
return linkHandler.readlink(node, buf, size);
} catch (NotLinkException | NoSuchFileException e) {
Expand All @@ -197,7 +197,7 @@ public int readlink(String path, ByteBuffer buf, long size) {
@Override
public int getattr(String path, Stat stat, FileInfo fi) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
Path node = resolvePath(fileNameTranscoder.fuseToNio(path));
BasicFileAttributes attrs;
if (fileStore.supportsFileAttributeView(PosixFileAttributeView.class)) {
Expand Down Expand Up @@ -230,7 +230,7 @@ public int getattr(String path, Stat stat, FileInfo fi) {
@Override
public int getxattr(String path, String name, ByteBuffer value) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
Path node = resolvePath(path);
LOG.trace("getxattr {} {}", path, name);
var xattr = Files.getFileAttributeView(node, UserDefinedFileAttributeView.class, LinkOption.NOFOLLOW_LINKS);
Expand Down Expand Up @@ -263,7 +263,7 @@ public int getxattr(String path, String name, ByteBuffer value) {
@Override
public int listxattr(String path, ByteBuffer list) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
Path node = resolvePath(path);
LOG.trace("listxattr {}", path);
var xattr = Files.getFileAttributeView(node, UserDefinedFileAttributeView.class, LinkOption.NOFOLLOW_LINKS);
Expand Down Expand Up @@ -299,7 +299,7 @@ public int opendir(String path, FileInfo fi) {
@Override
public int readdir(String path, DirFiller filler, long offset, FileInfo fi, int flags) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
Path node = resolvePath(fileNameTranscoder.fuseToNio(path));
LOG.trace("readdir {}", path);
return dirHandler.readdir(node, filler, offset, fi);
Expand All @@ -320,7 +320,7 @@ public int releasedir(String path, FileInfo fi) {
@Override
public int open(String path, FileInfo fi) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
Path node = resolvePath(fileNameTranscoder.fuseToNio(path));
LOG.trace("open {} ({})", path, fi.getFh());
fileHandler.open(node, fi);
Expand All @@ -340,7 +340,7 @@ public int open(String path, FileInfo fi) {
@Override
public int read(String path, ByteBuffer buf, long size, long offset, FileInfo fi) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
LOG.trace("read {} bytes from file {} starting at {}...", size, path, offset);
int read = fileHandler.read(buf, size, offset, fi);
LOG.trace("read {} bytes from file {}", read, path);
Expand All @@ -357,7 +357,7 @@ public int read(String path, ByteBuffer buf, long size, long offset, FileInfo fi
@Override
public int release(String path, FileInfo fi) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock dataLock = pathLock.lockDataForReading()) {
DataLock _ = pathLock.lockDataForReading()) {
LOG.trace("release {} ({})", path, fi.getFh());
fileHandler.release(fi);
return 0;
Expand Down
Loading

0 comments on commit 3d70693

Please sign in to comment.