feedback icon indicating copy to clipboard operation
feedback copied to clipboard

GHA v4 does not work well when run from workflow_run instead of pull_request

Open rohan-at-sentry opened this issue 1 year ago • 10 comments

https://github.com/codecov/feedback/issues/126#issuecomment-1931862637

### Related issues
- [ ] https://github.com/codecov/codecov-action/issues/1292#issuecomment-1942100350

rohan-at-sentry avatar Feb 13 '24 16:02 rohan-at-sentry

@thomasrockhu-codecov can you take a look at this once you're back in?

rohan-at-sentry avatar Feb 13 '24 17:02 rohan-at-sentry

Ok, I did a run on a workflow_run event and it seems to be working fine. See this run.

This leads me to believe there is something else happening. @kdarkhan @adamjstewart @melink14 @JoshuaKGoldberg, if you have any logs or a link that you could point me to, I'd be happy to look in and see why the action@v4 is not working

thomasrockhu-codecov avatar Feb 21 '24 22:02 thomasrockhu-codecov

Thanks for asking! All of my repos that use the Codecov action should be open source. https://github.com/JoshuaKGoldberg/create-typescript-app/pull/1289 -> https://github.com/JoshuaKGoldberg/create-typescript-app/issues/1303 -> https://github.com/JoshuaKGoldberg/create-typescript-app/pull/1304 should be the main references for that repository in particular. If there's any logstuffs you don't have access to, I'd be happy to provide them.

That repo also is a GitHub repo template you can use to make a new repo to test for yourself. LMK if that's not clear how to use here either 🙂

JoshuaKGoldberg avatar Feb 21 '24 22:02 JoshuaKGoldberg

@JoshuaKGoldberg

You need to add the token as a secret and as an argument to the codecov-action step from the message on this log

thomasrockhu-codecov avatar Feb 23 '24 15:02 thomasrockhu-codecov

Ok, I did a run on a workflow_run event and it seems to be working fine. See this run.

Uh, from what I can tell, this was triggered by https://github.com/thomasrockhu-codecov/example-python/pull/1, which is not from a fork. Also, the "Download coverage artifacts" step failed to find and download anything. Therefore I would be pretty surprised if the "Upload coverage to codecov" step was doing anything useful. In my testing, I was able to get both of those steps working correctly. The issue I encountered was that workflow_run never reported back to the original PR that triggered it, so PRs like https://github.com/microsoft/torchgeo/pull/1868 never received any coverage information.

adamjstewart avatar Feb 26 '24 11:02 adamjstewart

@adamjstewart got it, is this specifically in PRs from forks only then?

thomasrockhu-codecov avatar Feb 27 '24 18:02 thomasrockhu-codecov

I guess I've never tried a PR from upstream since we don't usually get any out those for open source repos.

adamjstewart avatar Feb 27 '24 18:02 adamjstewart

got it, @adamjstewart I'm not sure this is a specific workflow_run thing, but I'll dig into the logs to see what happened, and why you didn't get a status check or comment. To be clear, I'm going to use this PR as #1868 doesn't seem to have been run at all. Let me know if I misunderstood something.

thomasrockhu-codecov avatar Feb 27 '24 18:02 thomasrockhu-codecov

@adamjstewart I see the problem, the issue was due to rate limiting. Have you installed the Codecov app on your fork?

thomasrockhu-codecov avatar Feb 27 '24 23:02 thomasrockhu-codecov

@thomasrockhu-codecov the rate limiting issue was the reason for opening #126. The reason we're using workflow_run is to try to get around the rate limiting issue. We can't expect all of our contributors to first install the Codecov app in order to get their PRs to pass the tests.

adamjstewart avatar Feb 28 '24 09:02 adamjstewart

@adamjstewart I'm going to close this as I believe it's been fixed. However, if you feel that isn't true, please feel free to create a new issue and tag me.

thomasrockhu-codecov avatar Oct 29 '24 16:10 thomasrockhu-codecov