Skip to content

Conversation

@Cerebrovinny
Copy link
Collaborator

@Cerebrovinny Cerebrovinny commented Mar 1, 2025

what

  • add codecov GitHub action

why

  • goal is to progressively increase test coverage by requiring 80% test coverage on new code

references

Summary by CodeRabbit

  • Tests

    • Enhanced testing commands to run with coverage enabled, including the generation of HTML reports.
    • Integrated automated coverage reporting into the CI pipeline for improved analysis.
  • Chores

    • Updated the version control ignore rules to exclude generated coverage files.
    • Added configuration settings to enforce minimum coverage thresholds and quality standards.

Cerebrovinny and others added 6 commits February 28, 2025 18:28
* added PR size labeler

* fix permissions

* fix permissions

* Apply suggestions from code review

---------

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
* fix comment and line breaks

* comment test

* test changes

* this should not trigger another one

* fix multiple msg

* fix multiple msg

* remove test file

* Update .github/workflows/codeql.yml

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>

* add test file

* delete test file

---------

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
@github-actions github-actions bot added the size/s label Mar 1, 2025
@mergify mergify bot added the wip Work in Progress: Not ready for final review or merge label Mar 1, 2025
@mergify
Copy link

mergify bot commented Mar 1, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Mar 1, 2025
@github-actions github-actions bot added size/xl and removed size/s labels Mar 1, 2025
@mergify
Copy link

mergify bot commented Mar 1, 2025

Warning

This PR exceeds the recommended limit of 1,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

@github-actions github-actions bot removed the size/xl label Mar 1, 2025
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@Cerebrovinny Cerebrovinny changed the title WIP - Codecov Codecov Implementation Mar 2, 2025
@mergify mergify bot removed the wip Work in Progress: Not ready for final review or merge label Mar 2, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2025

📝 Walkthrough

Walkthrough

This pull request modifies the continuous integration pipeline and build configuration to integrate code coverage metrics. It updates the acceptance test command in the GitHub Actions workflow, adds a conditional step to upload coverage reports using Codecov on Linux, and enhances Makefile targets to run tests with coverage flags and generate HTML reports. Additionally, it introduces a new codecov.yml configuration file to enforce minimum coverage thresholds and updates the .gitignore file to exclude generated coverage files.

Changes

Files Change Summary
.github/workflows/test.yml, codecov.yml Updated CI workflow: changed acceptance test command from make testacc to make testacc-cover, added a conditional Codecov upload step, and introduced a new Codecov configuration enforcing 80% coverage on new/changed lines.
Makefile Added new targets testacc-cover (runs tests with coverage) and testacc-coverage (generates HTML report), and updated the .PHONY declaration accordingly.
.gitignore Appended entries for coverage.out and coverage.html under a new comment section to ignore generated coverage files.

Sequence Diagram(s)

sequenceDiagram
    participant CI as GitHub Actions
    participant Make as Makefile Targets
    participant Test as Acceptance Tests
    participant Codecov as Codecov Action

    CI->>Make: Execute `make testacc-cover`
    Make->>Test: Run acceptance tests with coverage flag (-coverprofile=coverage.out)
    Test-->>Make: Return test results
    CI->>Make: Execute `make testacc-coverage`
    Make->>Test: Generate HTML coverage report (coverage.html)
    alt Linux Environment Detected
        CI->>Codecov: Upload coverage.out with Codecov action
    end
Loading

Suggested labels

minor

Suggested reviewers

  • aknysh

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67c5823 and 2fcbd6a.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Summary

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title anywhere in the PR title to generate the title automatically.

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

🧹 Nitpick comments (1)
codecov.yml (1)

18-21: Resolve YAML Formatting Issues
There are formatting issues reported by YAMLlint—specifically, trailing spaces on line 21 and lack of a newline at the end of the file. Please remove the trailing spaces and ensure the file ends with a newline to improve file quality and adhere to linting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 21-21: no new line character at the end of file

(new-line-at-end-of-file)


[error] 21-21: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9586061 and 67c5823.

📒 Files selected for processing (4)
  • .github/workflows/test.yml (1 hunks)
  • .gitignore (1 hunks)
  • Makefile (1 hunks)
  • codecov.yml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/test.yml

164-164: the runner of "codecov/codecov-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.35.1)
codecov.yml

[error] 21-21: no new line character at the end of file

(new-line-at-end-of-file)


[error] 21-21: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Build (ubuntu-latest, linux)
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
🔇 Additional comments (6)
.github/workflows/test.yml (1)

160-161: Updated Test Command for Coverage Integration
The acceptance tests step now runs using make testacc-cover, which ensures that coverage data is generated during the acceptance tests. This change aligns with the goal of integrating Codecov into the pipeline.

codecov.yml (2)

1-10: Good Codecov Coverage Configuration
This section clearly defines the coverage requirements, mandating at least 80% coverage on new or changed lines with a permissible drop of 2%, and automatically detects the base coverage. This well-structured setup should help maintain high test quality.


12-17: Clear PR Comment Configuration
The comment block is concise and specifies a useful layout for PR comments, ensuring that coverage changes are only posted when relevant and compared against the base branch.

Makefile (3)

62-64: Add Test Coverage Target
The new testacc-cover target is a great addition that runs the tests with coverage enabled using the -coverprofile=coverage.out flag. This change improves the CI pipeline by generating a coverage report without affecting the existing behavior.


66-68: Generate HTML Coverage Report
The testacc-coverage target, which depends on testacc-cover, neatly generates an HTML report via go tool cover. This provides additional flexibility for reviewing test coverage metrics.


70-70: PHONY Declaration Updated
Updating the .PHONY declaration to include testacc-cover and testacc-coverage ensures that these targets are always executed, preventing any conflicts with files of the same name. This is a solid adherence to make best practices.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@osterman osterman changed the title Codecov Implementation Add Codecov to Report Test Coverage Mar 2, 2025
@osterman osterman merged commit 843c3ad into main Mar 2, 2025
12 of 13 checks passed
@osterman osterman deleted the DEV-3070 branch March 2, 2025 22:23
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Mar 2, 2025
@github-actions
Copy link

github-actions bot commented Mar 5, 2025

These changes were released in v1.165.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants