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

CI code coverage fails on external PR #25

Closed
BenediktBurger opened this issue Jan 29, 2024 · 8 comments · Fixed by #26 or #32
Closed

CI code coverage fails on external PR #25

BenediktBurger opened this issue Jan 29, 2024 · 8 comments · Fixed by #26 or #32
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@BenediktBurger
Copy link
Member

In PR #24 , CI code coverage fails on the step creating a code coverage comment: https://github.com/pymeasure/pyleco/actions/runs/7687429088/job/20947438797?pr=24
It's job execution "#124"

Run MishaKav/pytest-coverage-comment@main
File read successfully "/home/runner/work/pyleco/pyleco/./pytest-coverage.txt"
Generating coverage report
File read successfully "/home/runner/work/pyleco/pyleco/./pytest.xml"
File read successfully "/home/runner/work/pyleco/pyleco/./pytest-coverage.txt"
Generating coverage report
File read successfully "/home/runner/work/pyleco/pyleco/./pytest.xml"
errors: 0
failures: 0
skipped: 5
tests: 577
time: 14.545
File read successfully "/home/runner/work/pyleco/pyleco/./pytest.xml"
./pytest-coverage.txt
  coverage: 85%
  color: green
  warnings: 5483
No previous comment found, creating a new one
Error: HttpError: Resource not accessible by integration
Error: Resource not accessible by integration

A stop gap measure could be to make the "code coverage comment" optional, such that the other steps (badge creation) are still executed.

@BenediktBurger BenediktBurger added bug Something isn't working help wanted Extra attention is needed labels Jan 29, 2024
@BenediktBurger
Copy link
Member Author

Maybe it is a permissions issue, see the example https://github.com/MishaKav/pytest-coverage-comment/blob/main/.github/workflows/live-test.yml

@BenediktBurger
Copy link
Member Author

@bklebel would you mind to open a PR with any change in order to test, whether the code coverage comment is generated as expected?
My PRs worked previously, but your PR did not, so maybe it was that permissions issue.

@bklebel
Copy link
Collaborator

bklebel commented Jan 29, 2024

sure, I now opened #27, with small changes to the README.md

@BenediktBurger
Copy link
Member Author

Thanks.
It still fails.
According to https://github.com/peter-evans/create-or-update-comment#action-inputs it will always fail for pull requests from forks.
Funnily enough, it did not fail with my pull request (which is not in the fork) but failed after the merge.

@BenediktBurger
Copy link
Member Author

BenediktBurger commented Jan 29, 2024

Here's the main issue: MishaKav/pytest-coverage-comment#68

Notes:

  • Read and write permissions in the settings are allowed: allows after merge
  • github token as env or argument: ci setup failure

This was referenced Jan 29, 2024
@BenediktBurger
Copy link
Member Author

In order to run the coverage after a merge, it is necessary to allow to write to contents (#29).

We have to find a way to allow these comments to prs from foreign forks.

@bklebel
Copy link
Collaborator

bklebel commented Jan 29, 2024

seems like you tracked it down. Do you want me to make another PR? Or is there something still unresolved?

@BenediktBurger
Copy link
Member Author

I could reproduce it myself doing a PR from a branch in my personal fork (instead of from a branch in the pyleco repo).
I fixed only the failing run after a merge.

We have to find a way to allow these comments to prs from foreign forks.

That is still open and I do not know the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants