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

Pull request across forks shows 0 of 0 changed or added relevant lines in 0 files are covered #1743

Open
thephantomthief opened this issue Jan 5, 2024 · 1 comment

Comments

@thephantomthief
Copy link

I am using the Coveralls Github Action in my repository https://github.com/thephantomthief/babelfish_extensions.

There is a PR across branches on my repo, and the coveralls comment on that PR shows the correct relevant lines added: thephantomthief/babelfish_extensions#18

However, if the PR is across forks, then the comment shows "0 of 0 changed or added relevant lines in 0 files are covered": thephantomthief/babelfish_extensions#19. When I follow the build link to the coveralls web UI, in the source changed, it correctly shows the number of lines added/removed in each source file but when I open the source file, there are no source code lines highlighted that have been added. Seems strange.

I have read through the https://docs.coveralls.io/ and have followed the recommend CI configuration mentioned here: https://docs.coveralls.io/build-types#recommended-ci-configurations where the push builds are happening on the default branch and the pull_request builds are happening on all PRs targeted towards the default branch.

Another difference I noticed is that in the PR raised from and to the same repo, the comment is made by "github-actions bot" but on the PR raised across forks, it is made by "Coveralls".

Any help on how to get the comment on PRs raised across forks, to mention the correct number of lines added/changed would be greatly appreciated!

@afinetooth
Copy link
Collaborator

@thephantomthief this is quite late, I'm sorry, but I came across this issue today after it was referenced from another issue, here.

I'm afraid I can't really account for the cause of your issue at this point, but I did notice some strange contextual clues, for instance:

  1. The repo is missing an owner - Which can cause issues making some requests to GitHub, even, occasionally, for a public repo, as we don't have any OAuth token to leverage in the request. This might not have been an issue back when this happened though, so it's not the one that bothers me as much as (2). (See screenshot below.)
  2. My admin view of the Coveralls build shows that it was not able to send a PR Comment - This suggests that the data in the PR Comment might have come from the second commit on that PR, which didn't have the relevant changes. This would still be a bug, because the PR Comment data should always be a comparison between the PR head and PR base commits at that point, and the current data looks like the stats for the second push build. This, on the other hand, makes me want to re-look at (1), give the repo an owner and re-run the build. (See screenshot below.)
Screenshot 2024-08-21 at 11 54 04 AM

Regarding the different posters I have asked for a review for confirmation, but I believe that same-repo action runs can leverage the GitHub App token in our action and thus github-actions will be the poster, but a cross-repo action run needs to leverage the Coveralls bot user. (This is the way our GitHub Action works only.) FYI, by next year we will phase out Coveralls bot based comments entirely as users migrate to our New GitHub Integration, available now in a very stable beta since May 2023, just with a long beta period.

The important point, though, is that this should have nothing to do with the calculation of coverage stats or any difference in source file annotations. While the cross-repo run could have something to do with those, it's not intended, so I've added it to a related ticket and we'll look into it further. Thanks for the report.

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

No branches or pull requests

2 participants