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

Обновления #53

Merged
merged 1 commit into from
Jan 13, 2024
Merged

Обновления #53

merged 1 commit into from
Jan 13, 2024

Conversation

theshadowco
Copy link
Member

@theshadowco theshadowco commented Jan 13, 2024

Описание

  • обновлены зависимости
  • обновлен gradle
  • jdk17
  • публикация в сонатайп
  • minor fixes

Связанные задачи

Closes:

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Дополнительно

Summary by CodeRabbit

  • New Features

    • Introduced "Publish to Sonatype" workflow for automated publishing to the Sonatype repository.
    • Updated the application to support Java 17 and 20.
    • Enhanced versioning logic to determine snapshot versions more accurately.
  • Improvements

    • Updated various plugin versions to ensure compatibility and performance.
    • Increased Java source and target compatibility to Java 17.
    • Improved Gradle wrapper to version 8.5 for better build stability.
  • Refactor

    • Transitioned SupportConfiguration from a Lombok class to a Java record for cleaner and more concise code.
  • Bug Fixes

    • Fixed inconsistencies in compareTo method formatting within the SupportConfiguration record.

- обновлен gradle
- jdk17
- публикация в сонатайп
- minor fixes
Copy link

coderabbitai bot commented Jan 13, 2024

Walkthrough

The project has embraced more recent Java versions, discarding Java 11 in favor of Java 17 and 20, and updated various plugins and dependencies to newer versions. The build automation has been enhanced with workflows for Sonatype publishing and release management. Gradle itself has been upgraded to version 8.5. A Java record now replaces a Lombok annotated class, reflecting a shift towards native language features for immutability.

Changes

File Pattern Change Summary
.github/workflows/check.yml Removed Java 11, now using Java 17 and 20 in the test matrix.
.github/workflows/publish-to-... Added workflow for automating Sonatype repository publishing.
.github/workflows/release.yml Updated Java version from 11 to 17 in the workflow.
build.gradle.kts Updated plugins, dependencies, Java compatibility, and added logic for versioning and publication.
gradle/.../gradle-wrapper.properties Updated Gradle from version 8.4 to 8.5.
gradlew Modified script for improved JVM options and environment variable handling.
src/main/java/.../SupportConfiguration.java Transitioned from Lombok @Value class to Java record.

🐇✨
In the burrow of the code, where Java beans are sowed,
A hop to seventeen, and twixt the lines, the updates flowed.
With Gradle's latest sheen, and workflows set to mode,
The rabbit's work is done, and now it's time to hit the road. 🚀🌟

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

sonarcloud bot commented Jan 13, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@theshadowco theshadowco merged commit 139cf55 into develop Jan 13, 2024
14 checks passed
@theshadowco theshadowco deleted the feature/updates branch January 13, 2024 03:23
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cdf0a14 and 5b528f9.
Files ignored due to path filters (2)
  • gradle/wrapper/gradle-wrapper.jar is excluded by: !**/*.jar
  • src/main/resources/log4j.xml is excluded by: !**/*.xml
Files selected for processing (7)
  • .github/workflows/check.yml (1 hunks)
  • .github/workflows/publish-to-sonatype.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • build.gradle.kts (4 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • gradlew (3 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/supconf/SupportConfiguration.java (3 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/check.yml
  • gradle/wrapper/gradle-wrapper.properties
Additional comments: 12
.github/workflows/release.yml (1)
  • 17-17: The Java version has been updated to 17, which is consistent with the project's transition to JDK 17. Ensure that all other workflow steps and actions are compatible with Java 17.
.github/workflows/publish-to-sonatype.yml (1)
  • 19-20: The Java version has been updated to 17 with the distribution set to 'liberica'. Verify that the 'liberica' distribution is compatible with all steps in this workflow, especially the publishing process to Sonatype.
Verification successful

The output from the shell script indicates that the 'liberica' distribution is specified in the .github/workflows/publish-to-sonatype.yml file. However, to verify compatibility, we would need to check if there are any steps within the workflow that might not be compatible with the 'liberica' distribution. This could involve checking for any specific JDK distribution requirements in the steps that publish to Sonatype or any other JDK-dependent steps in the workflow.

Since the shell script only confirms the presence of 'liberica' in the workflow file and does not provide information on compatibility, further verification is needed.

This script will search for the steps in the publish-to-sonatype.yml workflow that use the actions/setup-java action, which is where the JDK distribution is set, and will provide some context around those steps to help determine if there's any indication of incompatibility with 'liberica'.


The output from the script shows that the 'liberica' distribution is set up for JDK 17 in the publish-to-sonatype.yml workflow file, and the next step is "Publish to Sonatype". There is no output indicating any specific requirements or potential incompatibilities with the 'liberica' distribution in the steps following the JDK setup.

Given this information, there is no evidence from the workflow file to suggest that the 'liberica' distribution is incompatible with the steps in the workflow, particularly the publishing process to Sonatype. Therefore, based on the available data, the review comment concerning the compatibility of the 'liberica' distribution with all steps in this workflow, especially the publishing process to Sonatype, has been verified and no issues have been found.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that 'liberica' distribution is available and compatible with the workflow
rg --files-with-matches "distribution: 'liberica'" .github/workflows/*.yml

Length of output: 225



Script:

#!/bin/bash
# Check for any steps that might require a specific JDK distribution or might not be compatible with 'liberica'
rg "steps:" -A 20 .github/workflows/publish-to-sonatype.yml | rg -B 1 -A 4 "uses: actions/setup-java"

Length of output: 272

src/main/java/com/github/_1c_syntax/bsl/supconf/SupportConfiguration.java (2)
  • 31-32: The class has been refactored to a Java record, which is a more concise and appropriate structure for immutable data carriers in Java 17. This change should simplify the code and reduce boilerplate.

  • 41-41: The compareTo method has been updated. Ensure that this change does not affect the ordering logic in any parts of the application where SupportConfiguration instances are compared.

Verification successful

The search for explicit usages of the compareTo method within the SupportConfiguration class did not yield any results, which suggests that there are no custom implementations of compareTo within that class other than the one defined in the SupportConfiguration itself.

The second script, however, found multiple references to the compareTo method within the SupportConfiguration.java file, indicating where the method is used within the class. It also found references in the SupportConfigurationTest.java and ParseSupportDataTest.java files, which likely contain tests that verify the behavior of the compareTo method.

Given these findings, it seems that the compareTo method is indeed used within the SupportConfiguration class and is also part of tests to ensure its correct behavior. Therefore, the review comment is valid in that any changes to the compareTo method should be carefully reviewed to ensure they do not affect the ordering logic where SupportConfiguration instances are compared.

The tests found in SupportConfigurationTest.java and ParseSupportDataTest.java should be sufficient to verify that the changes to the compareTo method have not broken the expected behavior, assuming these tests are comprehensive and correctly implemented.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usages of SupportConfiguration's compareTo method to ensure the logic is still valid.
ast-grep --lang java --pattern $'class $_ { $$$ compareTo($_, $_) { $$$ } $$$ }'

Length of output: 81



Script:

#!/bin/bash
# Search for explicit usages of the compareTo method within the SupportConfiguration class
ast-grep --lang java --pattern $'class SupportConfiguration { $$$ compareTo($_, $_) { $$$ } $$$ }'

Length of output: 99


Script:

#!/bin/bash
# Additionally, search for any potential references to the compareTo method in the entire codebase
rg "compareTo" --type java

Length of output: 996

build.gradle.kts (5)
  • 8-17: Plugin versions have been updated. Verify that these new versions are compatible with each other and with the project's Gradle version.

  • 36-36: The isSnapshot variable is set based on the Git reference type. Ensure that this logic correctly identifies snapshot versions, especially in CI/CD pipelines where versioning is critical.

Verification successful

The isSnapshot variable in build.gradle.kts is used to determine whether the current build is a snapshot or a release. The logic for setting isSnapshot is based on the Git reference type, and it is used to configure the repository URL for publishing and the version naming. The provided context shows that if the build is a snapshot, it is published to a snapshot repository, and the version name is suffixed with "-SNAPSHOT". This is consistent with standard Maven versioning practices. The usage of isSnapshot appears to be correct for the purposes of versioning and publishing in CI/CD pipelines.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for the usage of isSnapshot in the build script to ensure it's being used correctly.
rg "isSnapshot" build.gradle.kts

Length of output: 213



Script:

#!/bin/bash
# Extract the surrounding context for the second and third occurrences of `isSnapshot` to understand its usage.
rg -C 5 "isSnapshot" build.gradle.kts

Length of output: 1089

* 62-63: Java source and target compatibility have been set to version 17, which should be consistent with the project's transition to JDK 17. Confirm that all source code is compatible with Java 17.
  • 126-148: The maven publication's versioning logic has been updated. Verify that the new logic correctly sets the version for snapshots and releases, and that it aligns with the project's versioning strategy.

  • 199-202: A new nexusStaging block has been added with configuration details for Sonatype publishing. Ensure that the serverUrl and stagingProfileId are correct and that they correspond to the project's Sonatype repository settings.

gradlew (3)
  • 87-87: The handling of the APP_HOME variable has been modified to discard standard output. This is a minor change but verify that it does not affect the execution of the Gradle wrapper in any environments.

  • 148-156: The script disables specific shellcheck warnings. Confirm that these changes are intentional and that they do not introduce any issues with script execution on different platforms.

  • 205-209: The script has been modified to collect JVM options. Ensure that these changes do not affect the JVM options passed to Gradle in various environments, especially with regards to memory settings and other critical JVM arguments.

Verification successful

The review of the gradlew script and the context provided from the shell script outputs indicate that the DEFAULT_JVM_OPTS are explicitly defined and included in the Java command arguments. The script's comments and the eval command usage suggest that the handling of JVM options, including memory settings, is preserved with the addition of explicit escaping of shell fragments. There is no evidence from the provided context that the changes to the script would negatively affect the JVM options passed to Gradle in various environments.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the JVM options collection does not affect critical JVM arguments.
rg "DEFAULT_JVM_OPTS" gradlew

Length of output: 403



Script:

#!/bin/bash
# Check the previous behavior of DEFAULT_JVM_OPTS and how it was used in the script before the changes.
rg "DEFAULT_JVM_OPTS" gradlew -B 3 -A 3

Length of output: 1367

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