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

Coverage: Upload as separate step #199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pllim
Copy link
Contributor

@pllim pllim commented May 8, 2024

Upload to Codecov as separate step so it can be restarted without re-running the whole test suite because sometimes Codecov rate limits.

We need this to fix astropy/astropy#16379

This PR is tested downstream at astropy/astropy#16419

Also see spacetelescope/jdaviz#2865

You will see deprecation warning from actions/download-artifact#283 but it won't fail the upload.

cc @ConorMacBride @bsipocz

@pllim
Copy link
Contributor Author

pllim commented May 9, 2024

The test-conda OSX failure is unrelated (#197)

@pllim
Copy link
Contributor Author

pllim commented May 9, 2024

I guess it is quite impossible to test coverage here. I will undo the test changes and try to test this over at astropy instead (astropy/astropy#16419).

But with this patch, you will notice new jobs called Upload Coverage (pull_request) in the checks below. They attempt to download coverage files but skipped uploading because no coverage was done.

@pllim

This comment was marked as outdated.

@pllim
Copy link
Contributor Author

pllim commented May 9, 2024

Okay... autofix didn't do anything and I failed to see how my diff would trigger any such failures.

isort....................................................................Failed
- hook id: isort
- files were modified by this hook
encode scripts in workflows..............................................Failed
- hook id: encode-scripts
- files were modified by this hook

@pllim pllim marked this pull request as ready for review May 9, 2024 01:02
@Cadair Cadair requested a review from ConorMacBride May 16, 2024 08:31
@Cadair
Copy link
Member

Cadair commented May 16, 2024

I see the advantage of this, but it does cause you to loose some fidelity in the codecov reports, as you only get one CI job and you loose all the information about what OS / job it was (I think?).

Can you elaborate on the motivation for this a bit more, is it just codecov being flakey?

@pllim
Copy link
Contributor Author

pllim commented May 16, 2024

cause you to loose some fidelity in the codecov reports

Can you please elaborate on this? Each report would be uniquely named when uploaded as artifacts. They will all be downloaded by artifacts, and then re-uploaded to codecov all together. I don't see it being different from what workflow is already doing except the upload to codecov is a separate step.

motivation

@bsipocz asked for a solution to astropy/astropy#16379

@pllim
Copy link
Contributor Author

pllim commented May 16, 2024

Also it is painful to rerun test suite when only the upload fails.

@Cadair
Copy link
Member

Cadair commented May 17, 2024

I don't see it being different from what workflow is already doing except the upload to codecov is a separate step.

I think the difference (and it's not really a deal breaker) is that codecov looses the GHA metadata about which report was from which run?

Anyway, I am happy to merge it, but from the astropy test PR I am unconvinced it actually works?

@pllim
Copy link
Contributor Author

pllim commented May 17, 2024

Alternate solution is welcome. We have been using this over at

https://github.com/spacetelescope/jdaviz/blob/main/.github/workflows/ci_workflows.yml

and

https://github.com/astropy/specutils/blob/main/.github/workflows/ci_workflows.yml

but both workflows only have one coverage job each.

pllim added a commit to pllim/astropy that referenced this pull request May 17, 2024
@pllim
Copy link
Contributor Author

pllim commented May 17, 2024

@Cadair , what is this pre-commit silliness?

pllim added a commit to pllim/astropy that referenced this pull request May 17, 2024
so it can be restarted without re-running the whole test suite
because sometimes Codecov rate limits.
pllim added a commit to pllim/astropy that referenced this pull request May 17, 2024
@pllim
Copy link
Contributor Author

pllim commented May 17, 2024

I think it works as intended now. Please re-review, @Cadair . Thanks!

@Cadair
Copy link
Member

Cadair commented May 17, 2024

What was causing the trouble?

@pllim
Copy link
Contributor Author

pllim commented May 17, 2024

Initially, I didn't realize both artifact names actually contains the same coverage.yml filenames, and the artifact name does not really reflect the actual filenames at download time, so they were clobbering each other. But I fixed that.

@pllim
Copy link
Contributor Author

pllim commented May 22, 2024

@Cadair , are you convinced yet? Anything else I need to do here? Thanks!

@pllim
Copy link
Contributor Author

pllim commented May 29, 2024

@Cadair ? @astrofrog ? @ConorMacBride ? 🙏

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.

CI: failure of coverage upload doesn't change job status
2 participants