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

feat: overhaul codebase checks #635

Merged
merged 5 commits into from
Feb 15, 2024
Merged

feat: overhaul codebase checks #635

merged 5 commits into from
Feb 15, 2024

Conversation

sgammon
Copy link
Member

@sgammon sgammon commented Feb 15, 2024

Ready for review Powered by Pull Request Badge

Summary

Continued tooling cleanup and updates, this time focused on checks (locally and in CI).

  • Add convention support for Detekt
  • Add convention support for Sonar
  • Add Detekt baseline report
  • Fix coverage reporting
  • Fix caching for Sonar runs
  • Add early PMD/Checkstyle support
  • AI-based code review
  • Check avoidance

Still pending

  • Dedicated PR:
    • Spotless baseline
    • Run ktlint
    • Run Prettier
    • Run Detekt fixes
    • Run Qodana fixes
    • Apply license header where missing
    • Update license header company name
    • Update license header years
    • Optimize and cleanup imports

Changelog

  • feat: add convention plugin for detekt
  • fix: coverage with sonar
  • fix: coverage reporting with qodana
  • chore: establish detekt baselines
  • chore: refactor ci for efficient check execution
  • chore: add detekt report upload to ci
  • chore: update lockfiles

Summary by CodeRabbit

  • New Features

    • Introduced Detekt for static code analysis with custom configurations and report merging.
    • Updated SonarQube integration with additional coverage verification and analysis steps.
    • Added configurations for Nexus publishing, Detekt, and code coverage in build.gradle.kts files.
    • Implemented new Gradle plugins for Checkstyle, PMD, and Spotless to enforce coding conventions.
    • Simplified target setting in Kotlin configuration for Proto-Kotlinx.
  • Improvements

    • Enhanced Sonar analysis with SONAR_TOKEN as a required parameter and updated environment variables.
    • Refined runtime classpath declarations for dependencies across multiple packages.
    • Updated Kotlin standard library default dependency setting.
    • Simplified filtering logic for subproject modules in project groups.
    • Improved readability and configuration in Kotlin conventions by refactoring function signatures.
  • Bug Fixes

    • Fixed issues with dependencies' runtime classpath configurations across various packages.
  • Documentation

    • No visible changes to end-users.
  • Refactor

    • Removed unnecessary imports and configurations in several build.gradle.kts files.
    • Renamed and updated functions for better clarity and functionality in test conventions.
  • Style

    • No visible changes to end-users.
  • Tests

    • No visible changes to end-users.
  • Chores

    • Updated dependencies and their versions in gradle.lockfile for several packages.
  • Revert

    • No visible changes to end-users.

- feat: add convention plugin for detekt
- fix: coverage with sonar
- fix: coverage reporting with qodana
- chore: establish detekt baselines
- chore: refactor ci for efficient check execution
- chore: add detekt report upload to ci
- chore: update lockfiles

Signed-off-by: Sam Gammon <sam@elide.ventures>
@sgammon sgammon added 🚧 WIP Works-in-progress. Blocks merge dev Dev tools, CI/CD, and other devops topics labels Feb 15, 2024
@sgammon sgammon added this to the Release R4: Alpha 8 milestone Feb 15, 2024
@sgammon sgammon self-assigned this Feb 15, 2024
Copy link

coderabbitai bot commented Feb 15, 2024

Walkthrough

Walkthrough

The project underwent comprehensive updates to enhance code quality and maintainability. New workflows for Detekt and Sonar analysis were introduced, alongside adjustments in various gradle.kts files and gradle.lockfile updates to refine dependency management. The introduction of Detekt emphasizes static code analysis for Kotlin, while SonarQube integration ensures broader quality checks. Changes to the build system and linting configurations aim to streamline project builds, enforce coding standards, and improve overall project health.

Changes

File Pattern Change Summary
.github/workflows/checks.detekt.yml Introduced a new workflow for Detekt analysis.
.github/workflows/checks.sonar.yml Updated to include a "Build: Verify Coverage" step and enhanced "Analysis: Sonar" step with coverage verification arguments.
.github/workflows/job.test.yml Added SONAR_TOKEN environment variable and a new step for Sonar analysis.
.github/workflows/on.pr.yml Renamed job to "Checks with Detekt" and updated file references and secrets. Modified permissions for security events.
build.gradle.kts, packages/.../build.gradle.kts Configured Detekt, updated Sonar properties, dependencies for kover, and tasks related to detekt, reports, and publishing.
gradle.properties Changed kotlin.stdlib.default.dependency to true.
packages/.../gradle.lockfile Updated runtime classpath declarations and versions for various dependencies across multiple packages.
tools/elide-build/src/main/kotlin/... Introduced and updated various plugins (Detekt, Sonar, Checkstyle, PMD, Spotless) for linting and static analysis. Added new configurations in ElideBuildExtension and refactored KotlinConventions for better configuration encapsulation. Removed and simplified certain module listings in ProjectGroups.

🐇🎉

In the garden of code, where the bits softly tread,
A rabbit hopped in, with a mission ahead.
With Detekt and Sonar, in its toolbox so bright,
It cleaned up the code, making everything right.
"To the future," it cheered, with a leap and a bound,
Leaving trails of green tests, and quality found.
🌟🚀🐾

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

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

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0542da7 and 22434c4.
Files ignored due to path filters (12)
  • config/detekt/baseline.xml is excluded by: !**/*.xml
  • config/detekt/detekt.yml is excluded by: !**/*.yml
  • packages/cli/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/embedded/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/graalvm-java/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/graalvm-jvm/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/graalvm-kt/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/graalvm-py/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/graalvm-rb/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/graalvm/detekt-baseline.xml is excluded by: !**/*.xml
  • packages/server/detekt-baseline.xml is excluded by: !**/*.xml
  • tools/processor/detekt-baseline.xml is excluded by: !**/*.xml
Files selected for processing (31)
  • .github/workflows/checks.detekt.yml (1 hunks)
  • .github/workflows/checks.sonar.yml (1 hunks)
  • .github/workflows/job.test.yml (5 hunks)
  • .github/workflows/on.pr.yml (1 hunks)
  • build.gradle.kts (8 hunks)
  • gradle.properties (1 hunks)
  • packages/base/build.gradle.kts (1 hunks)
  • packages/base/gradle.lockfile (1 hunks)
  • packages/core/gradle.lockfile (1 hunks)
  • packages/graalvm-react/build.gradle.kts (1 hunks)
  • packages/http/gradle.lockfile (1 hunks)
  • packages/model/gradle.lockfile (3 hunks)
  • packages/proto/proto-capnp/build.gradle.kts (1 hunks)
  • packages/proto/proto-core/gradle.lockfile (1 hunks)
  • packages/proto/proto-kotlinx/build.gradle.kts (1 hunks)
  • packages/proto/proto-test/gradle.lockfile (5 hunks)
  • packages/rpc/gradle.lockfile (1 hunks)
  • packages/runtime/gradle.lockfile (1 hunks)
  • packages/ssr/gradle.lockfile (1 hunks)
  • packages/test/gradle.lockfile (2 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/Constants.kt (1 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/ElideBuildExtension.kt (4 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/ElideConventionPlugin.kt (7 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/kotlin/KotlinConventions.kt (8 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/CheckstyleConventionsPlugin.kt (1 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/DetektConventionsPlugin.kt (1 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/PmdConventionsPlugin.kt (1 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/SonarConventionsPlugin.kt (1 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/SpotlessConventionsPlugin.kt (1 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/project/ProjectGroups.kt (4 hunks)
  • tools/elide-build/src/main/kotlin/elide/internal/conventions/tests/TestConventions.kt (2 hunks)
Files not summarized due to errors (1)
  • packages/test/gradle.lockfile: Error: Message exceeds token limit
Files skipped from review due to trivial changes (4)
  • packages/proto/proto-capnp/build.gradle.kts
  • packages/proto/proto-core/gradle.lockfile
  • packages/proto/proto-kotlinx/build.gradle.kts
  • packages/rpc/gradle.lockfile
Additional comments: 41
tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/PmdConventionsPlugin.kt (1)
  • 19-22: LGTM!
tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/CheckstyleConventionsPlugin.kt (1)
  • 19-22: LGTM!
tools/elide-build/src/main/kotlin/elide/internal/conventions/project/ProjectGroups.kt (1)
  • 67-67: The removal of various project module lists simplifies project configuration. Ensure that the removal of these lists does not impact any project logic that depended on them.
tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/SpotlessConventionsPlugin.kt (1)
  • 1-55: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [22-64]

Ensure that the Spotless configurations align with the project's coding standards and that the specified license header and editorconfig paths exist and are correctly configured.

packages/graalvm-react/build.gradle.kts (1)
  • 12-17: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

Ensure the removal of the elide.internal.conventions.native.NativeTarget import does not impact the build configuration for native targets.

packages/base/build.gradle.kts (1)
  • 36-38: The addition of detekt checks configuration enhances code quality checks. Ensure that the Detekt rules align with the project's coding standards.
tools/elide-build/src/main/kotlin/elide/internal/conventions/tests/TestConventions.kt (1)
  • 35-52: The addition of logic to copy the Kover test report to a standard path for Gradle improves integration with CI tools. Verify that the specified paths for the Kover report and the destination path are correctly configured and accessible.
tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/DetektConventionsPlugin.kt (1)
  • 35-65: Ensure that the Detekt configurations, including parallel execution and report merging, align with the project's requirements and that the specified paths for configuration and reports are correctly set up.
.github/workflows/checks.detekt.yml (1)
  • 94-107: Ensure that the Detekt analysis step is correctly configured with the necessary arguments and that the specified paths for caching and reports align with the project's structure.
gradle.properties (1)
  • 90-90: The change to kotlin.stdlib.default.dependency impacts the default inclusion of the Kotlin standard library. Verify that this change aligns with the project's dependency management strategy.
.github/workflows/checks.sonar.yml (1)
  • 111-125: The addition of the "Build: Verify Coverage" step before Sonar analysis enhances the workflow by ensuring code coverage verification. Verify that the coverage verification step is correctly configured and that it aligns with the project's quality assurance goals.
packages/runtime/gradle.lockfile (2)
  • 39-40: The update to org.jetbrains.kotlin:kotlin-stdlib version and its scope adjustment in the lockfile should be verified to ensure compatibility and correct dependency resolution.
  • 40-40: The adjustment in the scope of org.jetbrains:annotations in the lockfile should be verified for correct dependency management and usage within the project.
packages/core/gradle.lockfile (1)
  • 37-45: The changes from compileClasspath to runtimeClasspath for Kotlin and atomicfu libraries, along with the version update for org.jetbrains:annotations, are appropriate for ensuring these dependencies are available at runtime without affecting the compile-time classpath. Ensure that this adjustment aligns with the project's dependency management strategy and does not inadvertently affect the build or runtime behavior.
tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/SonarConventionsPlugin.kt (1)
  • 78-134: The dynamic configuration of SonarQube properties based on project characteristics (multiplatform, JavaScript, JVM) is well-implemented. It ensures that SonarQube analysis is tailored to the specific needs of each project type. Verify that the hardcoded paths and properties used in the configuration align with both SonarQube's expectations and the project's directory layout to avoid potential misconfigurations.
packages/http/gradle.lockfile (1)
  • 23-79: The changes from compileClasspath to runtimeClasspath for various libraries, including commons-codec, micronaut, and kotlin libraries, are appropriate for ensuring these dependencies are available at runtime without affecting the compile-time classpath. Ensure that this adjustment aligns with the project's dependency management strategy and does not inadvertently affect the build or runtime behavior.
tools/elide-build/src/main/kotlin/elide/internal/conventions/Constants.kt (1)
  • 94-95: The addition of a constant for the pinned version of ktlint (1.1.1) in the Constants object is a good practice for centralizing the management of dependency versions. This approach facilitates easier updates and ensures consistency across the project. Verify that version 1.1.1 of ktlint meets the project's current requirements and coding standards.
packages/ssr/gradle.lockfile (1)
  • 23-84: The shift from compileClasspath to runtimeClasspath for various dependencies is consistent and aligns with best practices for dependency management in Gradle, optimizing the build process and artifact size.
packages/base/gradle.lockfile (1)
  • 23-75: The shift from compileClasspath to runtimeClasspath for various dependencies is consistent across packages and aligns with best practices for dependency management in Gradle, optimizing the build process and artifact size.
.github/workflows/on.pr.yml (1)
  • 247-259: Renaming the job to "Checks with Detekt" and updating file references and secrets are correctly implemented. The modification of permissions for security events in the "check-detekt" job is appropriate and aligns with the objectives of enhancing code quality checks.
tools/elide-build/src/main/kotlin/elide/internal/conventions/kotlin/KotlinConventions.kt (1)
  • 30-68: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [33-201]

Refactoring the configureKotlinBuild function to accept a conventions parameter of type ElideBuildExtension.Kotlin instead of multiple boolean parameters simplifies the function signature and improves code readability and maintainability. Ensure all configurations previously handled by individual parameters are now correctly handled by the conventions object.

packages/model/gradle.lockfile (1)
  • 63-102: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [6-100]

The shift of dependencies from compileClasspath to runtimeClasspath and updates to dependency versions are noted. Ensure that these changes do not introduce any runtime issues or conflicts with other dependencies. Testing the application thoroughly to verify that all dependencies are correctly resolved at runtime is recommended.

tools/elide-build/src/main/kotlin/elide/internal/conventions/ElideConventionPlugin.kt (9)
  • 19-19: Import of RedactedGradleSubplugin added. Verify that the plugin is utilized within the project and that its integration does not introduce any build or runtime issues.
  • 42-42: Imports for linting conventions added. Ensure that these linting tools are configured correctly and that their rules align with the project's coding standards.
  • 50-50: Imports for test conventions added. Confirm that the test configurations and conventions introduced do not negatively impact test execution or coverage reporting.
  • 54-54: Import for configureRedactedPlugin added. Ensure that the Redacted plugin is compatible with the project's Kotlin version and does not interfere with other plugins or build processes.
  • 83-83: Extension elide added to project extensions. Confirm that this extension is used appropriately throughout the project and does not conflict with existing extensions.
  • 102-108: Configuration for the Redacted plugin within Kotlin conventions. Verify that the plugin's integration is necessary and that it functions as expected without causing build issues.
  • 154-157: Kotlin build configuration with specific targets and conventions. Ensure that these configurations are optimal for the project's requirements and do not introduce unnecessary complexity.
  • 162-165: Integration of Kotlin linting tools. Confirm that these tools are configured with appropriate rules and do not produce false positives that could disrupt development workflows.
  • 226-227: Configuration for Kover within testing conventions. Verify that Kover is correctly configured for accurate coverage reporting and does not conflict with other testing tools.
tools/elide-build/src/main/kotlin/elide/internal/conventions/ElideBuildExtension.kt (2)
  • 84-95: New configuration options for Redacted, experimental JS objects, SAM-with-receiver, and power-assert plugins added to the Kotlin convention. Ensure that these options are necessary for the project and that their inclusion does not introduce build or runtime issues.
  • 137-155: Introduction of a Checks class with options for Detekt, Sonar, Checkstyle, PMD, linting failures, and baselines. Confirm that these checks are configured correctly and align with the project's quality standards.
.github/workflows/job.test.yml (1)
  • 240-240: Ensure that the SONAR_TOKEN is securely handled and not exposed in logs or error messages.
Verification successful

Given the script's execution and its lack of output, there's no direct evidence of SONAR_TOKEN being exposed through echo commands in the workflow logs. This suggests that, at least in the context of using echo, the token is not being accidentally exposed. However, it's important to note that this does not fully guarantee the secure handling of SONAR_TOKEN across all possible logging mechanisms or error messages. The verification focused on a specific potential exposure method and found no issues within that scope.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for accidental exposure of SONAR_TOKEN in workflow logs
rg 'SONAR_TOKEN' --files-with-matches | xargs grep -n 'echo'

Length of output: 58

build.gradle.kts (6)
  • 20-21: Imports for Detekt and ReportMergeTask are added. Verify that these imports are used effectively within the file and that the Detekt plugin is applied correctly.
Verification successful

Based on the provided output, the Detekt plugin and the imported classes (Detekt and ReportMergeTask) are referenced in the build.gradle.kts file and across multiple other files within the project. This indicates that the Detekt plugin is integrated into the project's build process, and the imports are likely used effectively within the build.gradle.kts file and potentially in related configurations. To confirm the specific usage and effectiveness of these imports, direct inspection of the build.gradle.kts file and related configurations would be necessary. However, the evidence suggests that the review comment is addressed by the project's current state.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify Detekt plugin application and usage of imported classes
rg 'apply.*detekt' --files-with-matches
rg 'Detekt|ReportMergeTask' --files-with-matches

Length of output: 842

* 282-290: The Detekt configuration uses a baseline file and builds upon the default config. Ensure that the baseline file (`config/detekt/baseline.xml`) exists and is up-to-date with the current codebase to avoid ignoring new issues.
Verification successful

The verification process confirms that the Detekt baseline file (config/detekt/baseline.xml) exists and has been recently updated on Feb 15, which aligns with the current date. This ensures the file is up-to-date with the current codebase, addressing the concern raised in the review comment.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for existence and recent update of Detekt baseline file
fd 'baseline.xml' --exec ls -l

Length of output: 882

* 298-321: > 📝 **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [292-310]

Sonar properties are updated to include paths for various reports. Ensure that the specified paths for reports like sonar.kotlin.detekt.reportPaths actually exist and are generated by the build process.

  • 318-318: Dependencies for Kover are updated. Confirm that all listed projects have Kover configured and that coverage reporting is correctly integrated into the CI process.
  • 362-373: The detekt tasks are finalized by detektMergeSarif and detektMergeXml. Ensure that these finalization tasks are defined and correctly merge Detekt reports into the specified formats.
Verification successful

The verification process confirms that the detektMergeSarif and detektMergeXml tasks are defined and correctly configured in both build.gradle.kts and DetektConventionsPlugin.kt. These tasks are registered with their output paths set appropriately, and they are finalized by the Detekt tasks, ensuring that the Detekt reports are merged into the specified SARIF and XML formats after analysis. The required reports are enabled, and the merge tasks are configured to use the Detekt tasks' output files as input, aligning with the intended functionality. Therefore, the review comment is verified as accurate.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify definition and correct configuration of detektMergeSarif and detektMergeXml tasks
rg 'detektMergeSarif|detektMergeXml' --files-with-matches

Length of output: 172



Script:

#!/bin/bash
# Extract and review the sections related to detektMergeSarif and detektMergeXml in build.gradle.kts
echo "Contents from build.gradle.kts:"
rg 'detektMergeSarif|detektMergeXml' build.gradle.kts --context 5

echo -e "\nContents from DetektConventionsPlugin.kt:"
rg 'detektMergeSarif|detektMergeXml' tools/elide-build/src/main/kotlin/elide/internal/conventions/linting/DetektConventionsPlugin.kt --context 5

Length of output: 2244

* 575-577: The `koverVerify` task is finalized by `copyCoverageReports`. Ensure that the `copyCoverageReports` task correctly copies coverage reports to the specified location for Qodana analysis.
Verification successful

The copyCoverageReports task is configured to copy coverage reports to the root project for Qodana analysis, as described. It depends on koverBinaryReport and koverXmlReport, and copies report.bin, report.xml, and verify.err from the reports/kover directory. This setup aligns with the intent to ensure that the copyCoverageReports task correctly supports Qodana analysis by providing necessary coverage reports.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check configuration of copyCoverageReports task
rg 'copyCoverageReports' --files-with-matches

Length of output: 62



Script:

#!/bin/bash
# Extract and display the configuration of the 'copyCoverageReports' task from 'build.gradle.kts'
rg 'copyCoverageReports' build.gradle.kts -A 10

Length of output: 606

packages/proto/proto-test/gradle.lockfile (1)
  • 274-324: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [4-330]

The changes in dependency classifications from compileClasspath to runtimeClasspath need justification. Ensure these changes do not affect the compile-time requirements and that the runtime dependencies are indeed necessary for execution. This adjustment can impact the build process and application performance.

packages/test/gradle.lockfile Show resolved Hide resolved
.github/workflows/job.test.yml Show resolved Hide resolved
.github/workflows/job.test.yml Show resolved Hide resolved
- feat: add convention plugin for detekt
- fix: coverage with sonar
- fix: coverage reporting with qodana
- chore: establish detekt baselines
- chore: refactor ci for efficient check execution
- chore: add detekt report upload to ci
- chore: update lockfiles

Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Copy link

socket-security bot commented Feb 15, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/core-js@3.36.0, npm/v8-profiler-next@1.10.0

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@sgammon
Copy link
Member Author

sgammon commented Feb 15, 2024

@SocketSecurity ignore npm/v8-profiler-next@1.10.0
@SocketSecurity ignore npm/core-js@3.36.0

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: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 22434c4 and c383e82.
Files ignored due to path filters (1)
  • kotlin-js-store/package-lock.json is excluded by: !**/*.json
Files selected for processing (5)
  • .github/workflows/job.test.yml (5 hunks)
  • build.gradle.kts (9 hunks)
  • gradle.properties (1 hunks)
  • npm (1 hunks)
  • packages/embedded/build.gradle.kts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/job.test.yml
  • gradle.properties
Additional comments: 11
npm (1)
  • 1-3: The changes to the script are correct and follow best practices.
build.gradle.kts (9)
  • 20-21: Ensure the newly added imports are used within the file to avoid unnecessary imports that can clutter the namespace.
  • 171-177: The configuration for Idea project settings is correctly updated to reflect the Java language version specified in project properties.
  • 179-186: The Nexus publishing configuration is correctly set up with the new Sonatype URLs. Ensure the credentials for Sonatype are securely managed and not hardcoded in the build scripts.
  • 264-272: The Detekt configuration is comprehensive, including parallel execution and compiler plugin enabling. Verify that the detekt.yml and baseline.xml files exist at the specified paths and are correctly configured.
Verification successful

The verification process confirmed that both detekt.yml and baseline.xml files exist at the specified paths. This aligns with the review comment's request to verify their existence. Without specific criteria for what constitutes correct configuration, the verification of their existence completes the task at hand.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check if Detekt configuration files exist
test -f config/detekt/detekt.yml && echo "Detekt config exists" || echo "Detekt config missing"
test -f config/detekt/baseline.xml && echo "Detekt baseline exists" || echo "Detekt baseline missing"

Length of output: 177

* 280-303: > 📝 **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [274-292]

The Sonar configuration correctly sets project key, organization, and coverage report paths. Ensure that the empty report paths for Checkstyle and ktlint are intentional and that these tools are either not used or their reports are generated elsewhere.

  • 375-381: The tasks for merging Detekt reports (detektMergeSarif and detektMergeXml) are correctly configured with their output paths. Ensure that these tasks are called as part of the CI pipeline or build process to aggregate Detekt findings.
  • 383-387: The configuration for Detekt tasks includes finalization by the merge tasks and requires both SARIF and XML reports. This setup ensures that Detekt findings are properly aggregated and available in both formats for further analysis.
  • 504-519: The copyCoverageReports task is correctly set up to copy Kover reports to a directory for Qodana analysis. Ensure that this task is integrated into the CI pipeline to facilitate code quality checks with Qodana.
  • 580-587: The Sonar task dependencies are correctly configured to ensure that all necessary reports and verifications are completed before Sonar analysis. This setup helps maintain the integrity and relevance of the Sonar analysis results.
packages/embedded/build.gradle.kts (1)
  • 1103-1108: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

The removal of outputs.upToDateWhen { false } from the test task configuration is not directly visible in the provided code. Ensure this change aligns with the project's goals for build performance and correctness.

packages/embedded/build.gradle.kts Show resolved Hide resolved
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3b164f4) 36.96% compared to head (f79e575) 36.96%.
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #635   +/-   ##
=======================================
  Coverage   36.96%   36.96%           
=======================================
  Files         469      469           
  Lines       13885    13885           
  Branches     1954     1954           
=======================================
  Hits         5133     5133           
  Misses       8403     8403           
  Partials      349      349           
Flag Coverage Δ
gradle 36.96% <ø> (ø)
jvm 36.96% <ø> (ø)
lib 36.96% <ø> (ø)
plugin 36.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b164f4...f79e575. Read the comment docs.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Signed-off-by: Sam Gammon <sam@elide.ventures>
coderabbitai[bot]

This comment was marked as resolved.

Copy link

sonarcloud bot commented Feb 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@sgammon sgammon added this pull request to the merge queue Feb 15, 2024
Merged via the queue into main with commit d28e199 Feb 15, 2024
20 checks passed
@sgammon sgammon deleted the feat/checks branch February 15, 2024 08:56
@sgammon sgammon mentioned this pull request Apr 18, 2024
13 tasks
@sgammon sgammon removed the 🚧 WIP Works-in-progress. Blocks merge label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Dev tools, CI/CD, and other devops topics
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant