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

Add badges and a workflow for coverage #7

Merged
merged 1 commit into from
May 4, 2024
Merged

Add badges and a workflow for coverage #7

merged 1 commit into from
May 4, 2024

Conversation

JustinKuli
Copy link
Owner

Copy link

github-actions bot commented May 4, 2024

PR Review

⏱️ Estimated effort to review [1-5]

2, because the PR involves straightforward changes including the addition of badges in the README and a new step in the GitHub Actions workflow for updating the coverage report. The changes are clear and well-defined, making the review process relatively simple.

🏅 Score

85

🧪 Relevant tests

No

🔍 Possible issues

Possible Dependency Issue: The action ncruces/go-coverage-report@v0 is used at version v0, which might be unstable or lack long-term support. It's recommended to specify a more stable version if available.

🔒 Security concerns

No


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

  • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
[pr_reviewer]
some_config1=...
some_config2=...

See the review usage page for a comprehensive guide on using this tool.

@@ -37,3 +37,13 @@ jobs:

- run: |
make test

- name: Update coverage report
uses: ncruces/go-coverage-report@v0
Copy link

Choose a reason for hiding this comment

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

Suggestion: It's recommended to use a specific version of the GitHub Action rather than the default branch or a zero major version. This practice ensures that your workflows are not broken by changes made in newer versions of the Action. [best practice]

Suggested change
uses: ncruces/go-coverage-report@v0
uses: ncruces/go-coverage-report@v1.0.0 # Replace with the latest stable version

Comment on lines +43 to +48
with:
coverage-file: cover.out
report: true
chart: false
amend: false
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
Copy link

Choose a reason for hiding this comment

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

Suggestion: The condition for running the coverage report step seems to be intended only for pushes to the main branch. However, the syntax used in the 'if' condition might not work as expected because it's inside the 'with' block. It should be moved outside to the step level. [bug]

Suggested change
with:
coverage-file: cover.out
report: true
chart: false
amend: false
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
coverage-file: cover.out
report: true
chart: false
amend: false

chart: false
amend: false
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
continue-on-error: true
Copy link

Choose a reason for hiding this comment

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

Suggestion: Consider setting 'continue-on-error' to false for critical steps such as coverage reporting unless it's explicitly acceptable for these steps to fail without failing the entire workflow. This ensures that any issues with the coverage reporting are addressed promptly. [best practice]

Suggested change
continue-on-error: true
continue-on-error: false

@JustinKuli
Copy link
Owner Author

AI Suggestions Score

Category Count Comment
Great 0
Good 1 versioning actions is usually good advice
Bad 1 I'm explicitly setting continue-on-error: true for a reason, which should be clear in context
Terrible 1 The if is absolutely not nested in the with

@JustinKuli JustinKuli merged commit cd7317f into main May 4, 2024
9 checks passed
@JustinKuli JustinKuli deleted the more-badges branch May 4, 2024 19:46
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