Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to gradle 8.3, AnyEscapableString hierarchy #36

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

vinjana
Copy link
Contributor

@vinjana vinjana commented Apr 5, 2024

  • ... mostly to fulfill requirement for GitHub CodeQL security scanning.

… security scanning.

Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
@vinjana vinjana self-assigned this Apr 5, 2024
Copy link

coderabbitai bot commented Apr 5, 2024

Walkthrough

The project has undergone a significant transformation to enhance its build system and testing environment. Major changes include the adoption of the CycloneDX BOM plugin and maven-publish plugin, updates in dependency management, and the Gradle version upgrade. The build scripts now offer improved readability and compliance, with enhanced environment handling. Testing has been elevated with fixed time zones for consistency.

Changes

File(s) Change Summary
build.gradle Plugin updates, dependency management changes, Java version compatibility set to 1.8, task enhancements, and JAR manifest adjustments.
gradle/wrapper/gradle-wrapper.properties Gradle version updated to 8.3, added properties for networkTimeout and validateDistributionUrl.
gradlew, gradlew.bat Scripts improved with comments, licensing details, POSIX compliance, refined variable assignments, and updated JVM options.
src/main/groovy/...DateTimeHelper.groovy, src/test/groovy/...DateTimeHelperTest.groovy Constructor and test cases updated for consistent date parsing with specific time zones.
README.md Addition of tasks for generating JSON CycloneDX SBOMs in specific directories for Gradle configurations.
.circleci/config.yml Inclusion of additional tasks in CircleCI job configuration, expansion of artifact paths, and a new step for creating and uploading test report tarballs and CycloneDX SBOMs.
src/main/groovy/...StringConstants.java Added declarations for PAREN_LEFT and PAREN_RIGHT strings representing parentheses.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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

@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 Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2785d68 and 9e6bfd1.
Files ignored due to path filters (1)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar, !**/*.jar
Files selected for processing (5)
  • build.gradle (2 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • gradlew (2 hunks)
  • gradlew.bat (4 hunks)
  • src/test/groovy/de/dkfz/roddy/tools/DateTimeHelperTest.groovy (2 hunks)
Additional comments not posted (10)
gradle/wrapper/gradle-wrapper.properties (1)

3-5: Ensure compatibility of Gradle 8.3 with the project's existing setup and dependencies.

build.gradle (3)

9-10: Verify the correct configuration and usage of the newly added plugins, especially the CycloneDX BOM plugin, to ensure they meet the project's requirements.


35-39: The shift to implementation and testImplementation scopes for dependencies is a good practice that enhances build performance and module encapsulation. Ensure all dependencies are correctly categorized.


51-65: Review the Maven publication configuration to ensure it aligns with the project's distribution goals, especially the updated JAR manifest attributes and artifact management settings.

gradlew.bat (3)

1-14: The addition of licensing information enhances compliance and clarity. Ensure that the license is appropriate for the project's distribution terms.


37-37: Review the default JVM options to ensure they are appropriate for the project's build requirements, especially the memory limits.


28-29: The minor script adjustments, such as clearer variable assignments, enhance the script's readability and maintainability. Good job on these improvements.

src/test/groovy/de/dkfz/roddy/tools/DateTimeHelperTest.groovy (1)

27-28: Review the impact of changing the expected time zones to "Europe/Berlin" on the project's global user base and test coverage to ensure it does not introduce biases or limitations.

gradlew (2)

1-16: The addition of licensing information and detailed comments enhances compliance, clarity, and maintainability of the gradlew script. Ensure that the license is appropriate for the project's distribution terms.


25-39: Test the gradlew script on various operating systems to ensure its reliability and compatibility, especially in light of the adjustments for POSIX compliance.

Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Copy link

@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 Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9e6bfd1 and 1332df4.
Files selected for processing (1)
  • build.gradle (2 hunks)
Additional comments not posted (5)
build.gradle (5)

9-10: Ensure CI/CD and local development setups are tested with the new plugin additions and changes.


18-24: Consider upgrading to a newer Java version for performance and security improvements, while ensuring compatibility with your project's requirements.


43-47: LGTM! The update to use implementation and testImplementation for dependencies aligns with Gradle's recommendations.


50-70: Ensure that the URL and license information in the Maven publication setup are accurate and up-to-date.


78-83: LGTM! Including implementation details and the POM file in the JAR manifest is a good practice for artifact identification.

Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Copy link

@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: 2

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1332df4 and 89a715a.
Files selected for processing (3)
  • build.gradle (2 hunks)
  • src/main/groovy/de/dkfz/roddy/tools/DateTimeHelper.groovy (1 hunks)
  • src/test/groovy/de/dkfz/roddy/tools/DateTimeHelperTest.groovy (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/test/groovy/de/dkfz/roddy/tools/DateTimeHelperTest.groovy
Additional comments not posted (4)
build.gradle (4)

8-10: The plugin version updates are appropriate and follow best practices for maintaining up-to-date dependencies.


43-47: The updates to dependency configurations are appropriate, ensuring compatibility and enhancing testing capabilities.


50-70: The enhancements to the Maven publication setup, including the addition of licensing information, are beneficial for project distribution and compliance.


78-83: Adding 'Implementation-Title' and 'Implementation-Version' attributes to the JAR manifest is a good practice for providing metadata about the implementation.

build.gradle Outdated Show resolved Hide resolved
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Copy link

@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: 2

README.md Show resolved Hide resolved
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
…branch

Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
@vinjana vinjana changed the title Update to gradle 8.3 Update to gradle 8.3, AnyEscapableString hierarchy Apr 25, 2024
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
Copy link

@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: 1

Outside diff range and nitpick comments (2)
src/main/groovy/de/dkfz/roddy/tools/RoddyIOHelperMethods.groovy (2)

42-42: Ensure consistent logging format.

Consider including more context in the log message, such as the method name or parameters, to make debugging easier.


51-51: Ensure consistent logging format.

Similar to the previous comment, consider enhancing the log message with additional context for better traceability.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 435e50e and df6d8f3.
Files selected for processing (8)
  • README.md (2 hunks)
  • build.gradle (3 hunks)
  • src/main/groovy/de/dkfz/roddy/core/InfoObject.java (1 hunks)
  • src/main/groovy/de/dkfz/roddy/execution/io/LocalExecutionHelper.groovy (2 hunks)
  • src/main/groovy/de/dkfz/roddy/tools/EscapableString.groovy (1 hunks)
  • src/main/groovy/de/dkfz/roddy/tools/RoddyIOHelperMethods.groovy (4 hunks)
  • src/test/groovy/de/dkfz/roddy/RoddyIOHelperMethodsTest.groovy (1 hunks)
  • src/test/groovy/de/dkfz/roddy/tools/EscapableStringSpec.groovy (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/groovy/de/dkfz/roddy/core/InfoObject.java
Additional Context Used
LanguageTool (1)
README.md (1)

Near line 46: This word is normally spelled as one.
Context: ...chronousExecutionResult` - Patch: Use Circle-CI instead of Travis-CI * 2.3.0 - Mino...

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

32-32: Ensure consistency in list item markers.


32-32: Add a space after the colon for better readability.

build.gradle (5)

10-12: Updated plugin versions to support newer features and compatibility.


19-23: Configured Java toolchain to specify language version, enhancing compatibility and ensuring consistent builds across environments.


42-51: Updated dependencies to newer versions and switched to implementation and testImplementation for better dependency management.


60-74: Enhanced Maven publication settings to include more metadata and licensing information, improving project documentation and compliance.


107-120: Introduced tasks for listing configurations and generating CycloneDX SBOMs, improving reporting and compliance with security standards.

src/test/groovy/de/dkfz/roddy/tools/EscapableStringSpec.groovy (7)

13-23: Test cases for basic string operations without escaping are well-covered, ensuring correct behavior of the EscapableString functionalities.


25-39: Comprehensive tests for string escaping and concatenation, including complex scenarios with nested concatenations.


41-49: Tests for string representation ensure that the toString methods in EscapableString classes behave as expected.


51-74: Equality tests are thorough, covering various cases and ensuring that the equality operations are correctly implemented across different types of EscapableString.


76-86: Tests for stacking escapes validate that multiple levels of escaping are handled correctly, an important feature for complex string manipulations.


88-104: Tests for simplifying nested concatenated strings are crucial for performance and correctness, ensuring that unnecessary nesting is efficiently reduced.


107-124: Tests for joining lists of escapable strings with different separators ensure flexibility and correctness in string manipulations.

src/main/groovy/de/dkfz/roddy/execution/io/LocalExecutionHelper.groovy (1)

61-62: Improved error handling in executeSingleCommand by providing detailed error messages, which is crucial for debugging and user feedback.

src/test/groovy/de/dkfz/roddy/RoddyIOHelperMethodsTest.groovy (1)

189-206: Added tests for converting symbolic to integer access rights, enhancing the test coverage for file permission handling.

src/main/groovy/de/dkfz/roddy/tools/EscapableString.groovy (1)

14-242: Implemented a robust design using the Composite pattern for handling complex string operations, which enhances modularity and maintainability.

Comment on lines +152 to +153
else
return ""
Copy link

Choose a reason for hiding this comment

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

Handle exceptions more gracefully.

Currently, the method returns an empty string if no stack trace is available, which might mask the underlying issue. Consider throwing a custom exception or logging a warning to indicate the absence of a stack trace.

-            else
-                return ""
+            else {
+                logger.warning("Stack trace is unavailable for the exception.")
+                throw new IllegalStateException("Stack trace is unavailable.")
+            }

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
else
return ""
else {
logger.warning("Stack trace is unavailable for the exception.")
throw new IllegalStateException("Stack trace is unavailable.")
}

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.

None yet

1 participant