-
Notifications
You must be signed in to change notification settings - Fork 341
BUG: Ensure git is properly configured for code coverage action #2228
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
Conversation
I realize this is a draft but I thought it might be helpful for me to weigh in now. I don't think this current draft (i.e., setting git config) is going to fix anything. I dug through the PCC action's source code. It's clear that the action does not support the Take a look at the find_activity() function. If you grep the codebase and follow how that function is used, it becomes clear that our configuration will not work. That's because the We should probably open an issue on their repo. I searched their issues for "workflow_call". Couldn't find anything. @trallard, I think it would be best if you create the issue because you can make the case from a CI security point of view better than I could. Part of what makes this bug tricky is that there are several different bugs all at once, which you can see a bit more clearly in a PR I opened on my fork:
For that last one, there's no point in correcting the variable interpolation. The job step simply isn't being used, so I deleted it in that PR. When I looked into its history, it looks like that "get-run" step was added for a subsequent step that was then later deleted (step name: "Check if the trigger was a PR event"). Now, about persisting credentials—I am almost certain that we need to persist credentials in CI.yml for the "check coverage" job. You can see this fairly clearly in the action logs for my fork. I made two different commits to the main branch. In one, I set
Reading the action source code also supports this hypothesis. It tries to Here's the sequence of relevant function calls:
Hope that helps! |
I am going to close this PR as I currently do not have the capacity right now to debug, iterate, and, more likely than not, follow up and contribute upstream. Bottom line, the effort to maintain the coverage comment action has significantly surpassed the value of having such an action in our repository.
All in all, I suggest removing the coverage comment action from our CI altogether. It wouldn't significantly impact our workflow or that of our contributors (we'd have a fully working CI/CD, so that'd be better). Footnotes
|
Totally agree. You make a strong case that the value the action provides outweighs its cost (whether in security or maintenance.
![]() I'm fairly certain that that coverage table is posted from this line in the CI.yml file, which does not depend on the Python code coverage comment action. pydata-sphinx-theme/.github/workflows/CI.yml Line 147 in 51af2a2
So another argument for removing the third-party action is that we are still generating coverage information, even for pushes to
And I agree that doesn't seem to make the action worth it. |
Correct that summary in GitHub actions is generated when we run the pytest tests. Aside from pushing the coverage files and adding the comments to PRs there is nothing else we are getting from the third party action. |
no arguments here; closing. I assume a PR to purge the action from the CI config will follow. |
After reviewing the logs for the failed actions and the
python-coverage
action, I noticed that the underlying problem is thatgit
configurations likeuser.name
for thegithub-actions[bot]
are not set automatically.The action passes these as environment variables when committing to the coverage branch. Still, they are not picked up in the workflow (so I might perform a bit more checking and possibly open an issue upstream).
I checked locally before pushing to the branch, and the
403
error is cleared after setting this configuration, so this will resolve our failing workflow. And this should supersede the WIP #2226 since that reverts to the action throughworkflow_run
which is recommended against due to security reasons (which is why this was changed in the first place).