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

chore(testing): Switch coverage reporting from Codecov to SonarCloud #34

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

hckhanh
Copy link
Owner

@hckhanh hckhanh commented Dec 2, 2024

Replace Codecov integrations with SonarCloud for coverage reporting and static code analysis. Add sonar-project.properties to configure SonarCloud reporting paths. Update GitHub Actions workflow to execute SonarCloud scans, removing Codecov steps.

Summary by Sourcery

Replace Codecov with SonarCloud for coverage reporting and static code analysis, updating GitHub Actions workflow and configuration files accordingly.

CI:

  • Switch from Codecov to SonarCloud for coverage reporting and static code analysis in GitHub Actions workflow.

Documentation:

  • Remove Codecov badge from README.md.

Chores:

  • Add sonar-project.properties file to configure SonarCloud reporting paths.

Replace Codecov integrations with SonarCloud for coverage reporting and static code analysis. Add `sonar-project.properties` to configure SonarCloud reporting paths. Update GitHub Actions workflow to execute SonarCloud scans, removing Codecov steps.
This commit introduces a new step to run ESLint checks in the GitHub Actions workflow. Running ESLint ensures code quality by identifying and fixing problems in the JavaScript codebase before tests and scans are executed.
@hckhanh hckhanh self-assigned this Dec 2, 2024
Copy link

sourcery-ai bot commented Dec 2, 2024

Reviewer's Guide by Sourcery

This PR transitions the project's code coverage and analysis tooling from Codecov to SonarCloud. The implementation involves removing Codecov-related GitHub Actions steps, configuring SonarCloud properties, and adjusting the test reporting formats to match SonarCloud's requirements. The changes also include adding ESLint JSON reporting to integrate with SonarCloud's static analysis capabilities.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Replace Codecov with SonarCloud in GitHub Actions workflow
  • Remove Codecov coverage upload action
  • Remove Codecov test results upload action
  • Add SonarCloud scan action
  • Add ESLint execution step
.github/workflows/tests.yml
Update test configuration for SonarCloud compatibility
  • Change coverage reporter from 'clover' to 'lcovonly'
  • Simplify CI reporters configuration
  • Remove TEST_ANALYTICS environment variable handling
vitest.config.ts
Add SonarCloud configuration file
  • Configure project key and organization
  • Set LCOV report path
  • Set ESLint report path
sonar-project.properties
Update project configuration and documentation
  • Add ESLint JSON report script
  • Remove Codecov badge from README
  • Retain SonarCloud quality gate badge
package.json
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @hckhanh - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Corrected the token environment variable name from 'SONARCLOUD_TOKEN' to 'SONAR_TOKEN' to ensure proper authentication for the SonarCloud Scan step. This change addresses an issue with the token assignment, enabling successful scanning in the CI workflow.
The job previously named 'coverage' has been renamed to 'analytics' for clearer representation of its function in the CI workflow. This change aims to better align the job's name with its role in processing and reporting data. No functional changes to the workflow steps are involved.
This change modifies the checkout step to include a fetch-depth of 0, ensuring that the full commit history is available for the workflow. This adjustment is necessary for operations that require access to complete commit data, such as calculating versioning information or generating changelogs.
Removed unnecessary "./" prefix from file path configurations in sonar-project.properties. This change streamlines path references and ensures consistency across project settings.
@hckhanh hckhanh enabled auto-merge (squash) December 2, 2024 06:22
Copy link

sonarqubecloud bot commented Dec 2, 2024

@hckhanh hckhanh disabled auto-merge December 2, 2024 06:29
@hckhanh hckhanh merged commit 690975f into main Dec 2, 2024
12 checks passed
@hckhanh hckhanh deleted the sonarcloud branch December 2, 2024 06:29
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.

1 participant