-
Notifications
You must be signed in to change notification settings - Fork 7
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
coveralls crashes when there is GITHUB_{ACTIONS,TOKEN} but no GITHUB_REF in the environment (e.g. with tox) #1607
Comments
@hartwork thank you. Can I ask for a clarification?: Are you using one of the community-created python integrations for coveralls, or are you creating your own integration to be used via Github Actions? I'm not seeing any references in your source code, so I'm curious how to best contextualize this. TIA. |
Hi @afinetooth , happy to clarify. The integration is hand-made and part of a pull request — https://github.com/asyncee/django-easy-select2/pull/96/files — that has not been merged to |
Ok, @hartwork, got it. Thanks. One thing might be worth mentioning if you want to continue building upon your integration: All integrations except one use the Coveralls repo token (env var: Given that you are creating this integration to use Github Actions, but may want to extend it to other CI services, it might be worth changing the value you're sending for The first such example being that, when the API receives A more generic implementation that would play with all CI services would be to change the Let me know if I can clarify that further or if you have any further questions. |
Hi @afinetooth, thanks for your explanation. I'm only starting to understand why you suggest avoiding I looked at migrating to mentioned GitHub Action That additional logic for magic service name Best, Sebastian |
@hartwork i can give your access to coveralls of you need to tune django-easy-select2 configuration. |
@asyncee it will allow me to experiment with the above. Thank you! |
@hartwork unfortunately i found no way to give you access to coveralls via it's UI. So I added project's token |
@asyncee thanks! Looks like the transition worked, see asyncee/django-easy-select2#97 . |
@hartwork (Cc: @asyncee), it looks like you've got this worked out, but let me answer some open questions for future reference: @asyncee in the future, you can add a github user as a collaborator to your project, or to its org so it has access, and, at that point, the user will have access to the repo at Coveralls.io and be able to see the repo token. If you, additionally, give that user Admin access to the repo, they will have the ability to modify the repo's settings at coveralls.io, including changing its repo token. @hartwork to answer your questions / comments:
I understand, and given that constraint, you could have implemented your solution with If @asyncee had not supplied the repo token, those would have been your options.
That is true, the Coveralls Github Action currently requires coverage reports in LCOV format. FWIW, the user from this comment reports success using coveragepy-lcov with the Coveralls Github Action.
It's in your favor / doesn't break anything, if you're only using Github Actions for CI. The rest of the "magic" is small and mostly limited to the API being able to render a correct link back to your Github Actions workflow next to the job on your build page. Let me check out the status of your pull request comments to see if there's an issue I can help resolve. BRB here. Update: Order: DATE DESC:
So it looks like PR Comments are working. There was no comment sent for Build 1616664368 (PR 96): But that's because we can't find a base build for that pull_request build. Which is why the top of your coverage table reads: That just means we did not receive a coverage report for the commit on the branch that PR was meant to be merged into (likely master). But again, it looks like PR Comments are working, the issue is just limited to that build. If I can help you fix that, lmk. |
@afinetooth coveragepy-lcov is an interesting pointer. Thanks for elaborating 🙏 |
@hartwork you bet. Just replied re: PR Comments above. :) |
@afinetooth we have moved away from CC @asyncee |
Hi @hartwork. From the PR you shared, I think the issue might be that you're not declaring any value for That would explain why the integration complains, "Running on Github Actions but GITHUB_TOKEN is not set." I'm hoping you can just pass a different explicit value for In other words, change this line:
To:
Let me know if that doesn't fix it. |
Hi @afinetooth thanks for your reply! I had a look at the causing code in coveralls-python now. Because it's detection centers around variable What I don't get is how that code that was introduced in this coveralls-pyrthon commit for release 3.0.0 in 2021-01 did not break PR asyncee/django-easy-select2#97 back in 2021-12 but broke PRs yesterday with supposedly the exact same code. Weird 🤔 Any ideas? |
Hi, @hartwork. I would have to see the PR associated with this build log, but I suspect the difference relates to the order of configuration precedence the author changed in that commit. That is to say that, declaring the service in an env var in your GHA config yaml is not the same as declaring it as a flag in your command line command. I don't know exactly what the order of precedence is for that integration, but I suspect that declaring it in your command line is the last word and that, if you don't declare it there, some other value---an env var you're passing, or a default in the code---is getting used instead. |
@afinetooth I think you're arguing for |
@hartwork I'm actually agnostic. I think you could also use an environment variable (suggested variable names: But |
…ased on COVERALLS_REPO_TOKEN, based on response to issue #1607 of lemurheavy owner coveralls-public repository (lemurheavy/coveralls-public#1607).
…oping for an alternative error message) to the arguments for execution of coveralls based on lemurheavy/coveralls-public/issues/1607.
This issue has been automatically marked for closure because it has not had recent activity. It will be closed if no further activity occurs. If your issue is still active please add a comment and we’ll review as soon as we can. Thank you for your contributions. |
This is…
GITHUB_ACTIONS=true
andGITHUB_TOKEN
set butGITHUB_REF
:Seen live today at https://github.com/asyncee/django-easy-select2/runs/4619646186?check_suite_focus=true#step:5:254 .
For a workaround in context of tox inside GitHub Actions:
passenv
to the related environment intox.ini
:--service=github
to workaround issue Coveralls fails to upload with HTTP 422 "Unprocessable Entity" on retried builds #1435The text was updated successfully, but these errors were encountered: