Skip to content

Conversation

@infeo
Copy link
Member

@infeo infeo commented Aug 9, 2024

This PR updates the project to JDK 21.

Notable adjustments:

  • update of mockito to version 5.12.0 and adjusting tests

@infeo infeo added this to the next milestone Aug 9, 2024
@infeo infeo self-assigned this Aug 9, 2024
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 9, 2024

Walkthrough

The recent updates involve a comprehensive upgrade of the Java version from 17 to 21 across various GitHub Actions workflow files and project configurations. This transition enhances the development environment, enabling the use of new features and performance improvements. Additionally, the pom.xml file has been updated to include a newer version of the Mockito library, which aims to bolster testing capabilities. Test files have also been refined for better mock handling and more specific exception management.

Changes

Files Change Summary
.github/workflows/*.yml Java version updated from 17 to 21 for build, CodeQL analysis, dependency checks, and publishing workflows.
.idea/misc.xml Updated languageLevel and project-jdk-name from 17 to 21, indicating a shift to JDK 21.
pom.xml Java compiler version upgraded from 17 to 21; Mockito version updated from 5.2.0 to 5.12.0; artifact ID changed from mockito-inline to mockito-core.
src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java Enhanced mocking for physicalFsProv and ciphertextParent; refined exception handling for testing directory creation scenarios.
src/test/java/org/cryptomator/cryptofs/CryptoPathMapperTest.java Improved mock behavior for underlyingFileSystemProvider with additional exists method calls in test cases.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant CI/CD
    participant Java_21
    participant Test_Environment
    
    Developer->>CI/CD: Push changes
    CI/CD->>Java_21: Setup Java 21
    Java_21->>CI/CD: Java environment ready
    CI/CD->>Test_Environment: Run tests with updated mocks
    Test_Environment-->>CI/CD: Tests completed
    CI/CD->>Developer: Build successful with Java 21
Loading

Poem

In fields of code where rabbits play,
We've hopped to Java twenty-one today!
With mocks that dance and tests that shine,
Our projects leap, all things align.
So raise your ears and give a cheer,
For improved builds and joy this year! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b8316e0 and 0f1e068.

Files selected for processing (9)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/codeql-analysis.yml (1 hunks)
  • .github/workflows/dependency-check.yml (1 hunks)
  • .github/workflows/publish-central.yml (1 hunks)
  • .github/workflows/publish-github.yml (1 hunks)
  • .idea/misc.xml (1 hunks)
  • pom.xml (3 hunks)
  • src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java (16 hunks)
  • src/test/java/org/cryptomator/cryptofs/CryptoPathMapperTest.java (3 hunks)
Additional comments not posted (21)
.github/workflows/dependency-check.yml (1)

17-17: Java version updated to 21.

The Java version has been successfully updated from 17 to 21. This change aligns with the project's goal to leverage JDK 21 features. Ensure that all dependencies are compatible with this version.

.idea/misc.xml (1)

11-11: Project JDK updated to 21.

The language level and project JDK have been updated to JDK 21. This change is consistent with the project's upgrade strategy. Ensure that all project configurations and dependencies are compatible with JDK 21.

.github/workflows/codeql-analysis.yml (1)

25-25: Java version updated to 21 for CodeQL analysis.

The Java version has been updated from 17 to 21 in the CodeQL analysis workflow. This change supports the project's transition to JDK 21. Ensure that CodeQL and any related tools are compatible with this Java version.

.github/workflows/publish-github.yml (1)

15-15: Verify compatibility with Java 21.

The Java version has been updated to 21. Ensure that all dependencies and the build process are compatible with this version.

.github/workflows/publish-central.yml (1)

19-19: Verify compatibility with Java 21.

The Java version has been updated to 21. Ensure that all dependencies and the build process are compatible with this version.

.github/workflows/build.yml (1)

17-17: Verify compatibility with Java 21.

The Java version has been updated to 21. Ensure that all dependencies and the build process are compatible with this version.

pom.xml (3)

117-117: Switch to Mockito-Core

The artifact ID has changed from mockito-inline to mockito-core. This change might affect how mocks are handled, especially if inline mocking was used. Ensure that all tests function correctly with this change.


30-30: Upgrade Mockito Version

The Mockito version has been updated from 5.2.0 to 5.12.0. Verify that the tests are compatible with the new version and leverage any new features or improvements.


18-18: Upgrade Java Compiler Version

The Java compiler version has been upgraded from 17 to 21. Ensure that all dependencies and code are compatible with JDK 21 features and changes.

src/test/java/org/cryptomator/cryptofs/CryptoPathMapperTest.java (3)

293-293: Enhance Directory Existence Check

The exists method is now mocked to return true for dirFilePath. This change ensures that the test accurately simulates the existence of the directory, improving test robustness.


309-309: Enhance Symlink Existence Check

The exists method is now mocked to return true for symlinkFilePath. This change ensures that the test accurately simulates the existence of the symlink, improving test robustness.


327-327: Enhance Shortened File Existence Check

The exists method is now mocked to return true for contentsFilePath. This change ensures that the test accurately simulates the existence of the shortened file, improving test robustness.

src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java (9)

961-961: Enhance Parent Directory Existence Check

The exists method is now mocked to return true for ciphertextTargetParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for the copy operation.


1010-1010: Enhance Parent Directory Existence Check for Attribute Copy

The exists method is now mocked to return true for ciphertextTargetParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for copying attributes.


1031-1031: Enhance Parent Directory Existence Check for Owner Attributes

The exists method is now mocked to return true for ciphertextTargetParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for copying owner attributes.


1055-1055: Enhance Parent Directory Existence Check for POSIX Attributes

The exists method is now mocked to return true for ciphertextTargetParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for copying POSIX attributes.


1079-1079: Enhance Parent Directory Existence Check for DOS Attributes

The exists method is now mocked to return true for ciphertextTargetParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for copying DOS attributes.


1175-1175: Enhance Parent Directory Existence Check for Directory Creation

The exists method is now mocked to return true for ciphertextParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for directory creation.


1205-1205: Enhance Parent Directory Existence Check for Successful Directory Creation

The exists method is now mocked to return true for ciphertextParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for successful directory creation.


1235-1235: Enhance Parent Directory Existence Check for Directory Creation Failure

The exists method is now mocked to return true for ciphertextParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for handling directory creation failures.


1276-1276: Enhance Parent Directory Existence Check for Directory ID Backup

The exists method is now mocked to return true for ciphertextParent. This change ensures that the test accurately simulates the existence of the parent directory, which is crucial for backing up the directory ID.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
README.md (1)

102-102: Consider changing unordered list style.

Markdownlint suggests using a dash instead of an asterisk for unordered lists. While this is a stylistic choice, it may improve consistency.

- * Java 21
+ - Java 21
Tools
Markdownlint

102-102: Expected: dash; Actual: asterisk
Unordered list style

(MD004, ul-style)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0f1e068 and c30bccc.

Files selected for processing (1)
  • README.md (2 hunks)
Additional context used
Markdownlint
README.md

102-102: Expected: dash; Actual: asterisk
Unordered list style

(MD004, ul-style)

Additional comments not posted (2)
README.md (2)

9-9: Good addition of documentation link.

The link to the encryption scheme documentation is a valuable addition, enhancing the informational content of the README.


102-102: Update to Java 21 is appropriate.

The update to Java 21 reflects the project's transition to a newer JDK version, which aligns with the PR objectives.

Ensure all project dependencies are compatible with Java 21.

Verification successful

Update to Java 21 is appropriate and consistent.

The update to Java 21 in the README.md file is consistent with the codebase. There are no explicit mentions of Java 17 that would indicate compatibility issues.

  • README.md: Java version updated to 21.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility of all project dependencies with Java 21.

# Test: Check for any dependencies that are incompatible with Java 21.
mvn dependency:tree | grep -i "java 17"

Length of output: 112


Script:

#!/bin/bash
# Search for any explicit mentions of Java 17 or Java 21 in the codebase to check for compatibility issues.
rg "Java 17|Java 21" --context 3

Length of output: 158

Tools
Markdownlint

102-102: Expected: dash; Actual: asterisk
Unordered list style

(MD004, ul-style)

@infeo infeo merged commit 674bdab into develop Aug 9, 2024
@infeo infeo deleted the feature/jdk21 branch August 9, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants