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

Try to implement coverage action instead of using codecov. #1756

Merged
merged 4 commits into from
May 7, 2024

Conversation

Carreau
Copy link
Collaborator

@Carreau Carreau commented Apr 5, 2024

See #1753

@Carreau
Copy link
Collaborator Author

Carreau commented Apr 5, 2024

cc @trallard

See Carreau#1 for the type of comments it posts.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.sphinx-version }}
path: .coverage.${{ matrix.python-version }}.${{ matrix.os }}.${{ matrix.sphinx-version }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to the names to be unique for collection of all the results.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right now are only really looking at the coverage for Python 3.12 but I prefer collecting across this.

runs-on: ubuntu-latest
needs: run-pytest
# run both on previous step success and failure
if: "!cancelled()"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm assuming we want coverage even if tests are failing, but not if workflow is cancelled.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes absolute sense as we have the concurrency setting enabled

@trallard
Copy link
Collaborator

trallard commented Apr 5, 2024

Thanks @Carreau I will check later today
Aside I have a CI refactor (you can see a run here https://github.com/trallard/pydata-sphinx-theme/actions/runs/8559269974) that uploads the coverage so we can sync on how to proceed

@trallard trallard self-requested a review April 5, 2024 17:26
Copy link
Collaborator

@trallard trallard left a comment

Choose a reason for hiding this comment

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

I quite like this PR and the addition of a coverage comment to our PRs.
This still keeps the upload to codecov step but if #1759 gets merged then that completely removes this and would make a nice pairing of this PR comment + uploading to GH artefacts.

I will approve on my end and leave it to the rest of the maintainers to raise any potential objections/hesitations to get this merged.

.github/workflows/coverage.yml Outdated Show resolved Hide resolved
runs-on: ubuntu-latest
needs: run-pytest
# run both on previous step success and failure
if: "!cancelled()"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes absolute sense as we have the concurrency setting enabled

uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.sphinx-version }}
path: .coverage.${{ matrix.python-version }}.${{ matrix.os }}.${{ matrix.sphinx-version }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Right now are only really looking at the coverage for Python 3.12 but I prefer collecting across this.

@trallard trallard added kind: enhancement New feature or request tag: CI Pull requests that update GitHub Actions code labels Apr 10, 2024
@12rambau
Copy link
Collaborator

12rambau commented Apr 12, 2024

Small question here, is this tool still generating a dashboard ? to me that's the main functionality of codecov, the interactivity is great and it's super easy to spot what is wrong. If we really want to drop codecov (which seems to be the consensus) I'm using this for creating dashboard artifact in Azure pipelines I guess that could be used here as well: https://github.com/danielpalme/ReportGenerator

@trallard
Copy link
Collaborator

No this does not cover the report this only adds the pr comment.
The report generation and codecov replacement is to be covered in a separate pr.

@12rambau
Copy link
Collaborator

Any specific reason why you want to add this information in PRs then ? because the only instruction we are giving to codecov currently is to not send report to PR: https://github.com/pydata/pydata-sphinx-theme/blob/main/codecov.yml

@drammock
Copy link
Collaborator

for me at least, seeing coverage info in the PR comment tells me whether or not I should pester the contributor to add/modify a test (or add one myself). So it's useful.

@Carreau
Copy link
Collaborator Author

Carreau commented Apr 15, 2024

I can look into not having a comment but having a status check that is red only of coverage decreases. Maybe that would lower the notification noise, but without removing the notification of needing more coverage ?

@trallard
Copy link
Collaborator

I am +1 with @drammock having coverage info is useful on PRs.

I am not sure if one of the reasons why we do not have codecov PR messages right now has to do with the flakiness we are experiencing, but also I am not too worried about this PR adding too much noise as is.

@12rambau
Copy link
Collaborator

I just wanted to point out the current status, if you are fine receiving notification I'm fine as well (I never silence them myself)

@trallard
Copy link
Collaborator

trallard commented May 7, 2024

Since we all seem to be +1 on trying this codec implementation, the PR has been reviewed. I suggest we merge, see how this goes and make changes/tweaks as needed.

Co-authored-by: Tania Allard <taniar.allard@gmail.com>
@drammock drammock merged commit 1b0aec2 into pydata:main May 7, 2024
20 checks passed
@drammock drammock mentioned this pull request May 10, 2024
ivanov pushed a commit to ivanov/pydata-sphinx-theme that referenced this pull request Jun 5, 2024
* Try to implement coverage action instead of using codecov.

See pydata#1753

* Update .github/workflows/tests.yml

* Apply suggestions from code review

Co-authored-by: Tania Allard <taniar.allard@gmail.com>

---------

Co-authored-by: Tania Allard <taniar.allard@gmail.com>
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement New feature or request tag: CI Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants