-
Notifications
You must be signed in to change notification settings - Fork 159
Clean up GitHub actions #880
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
=======================================
Coverage 91.50% 91.50%
=======================================
Files 2 2
Lines 506 506
Branches 100 100
=======================================
Hits 463 463
Misses 25 25
Partials 18 18 ☔ View full report in Codecov by Sentry. |
It's usually good to keep a duplicate run because then, it's possible to tie that into a single branch protection check and execute some checks that the external service is unable to run. |
This change will effectively allow merging PRs with broken linting. |
Also, this completely removes the integration of showing some linting-related messages as annotations. |
This also breaks the ability to collect MyPy coverage (though, it's not configured now but would be good to have). |
Thanks for the comments! :)
I'm sorry, but I cannot follow. Keeping a duplicate run of what?
My understanding is that the newly added pre-commit.ci check will block the PR if the linting fails. What am I missing?
Which annotations are you referring to? |
I mean the pre-commit.com CLI tool. The pre-commit.ci web service has limitations. It's good in general, and has built-in formatting support. Though, some things will never work in that environment. They aren't currently used, but one example would be things accessing network or needing an externally managed environment (e.g. Though, to be fair, I prefer running linters in a separate jobs, not stuffed into one like they are now. It gives a lot move flexibility.
The only check marked as required right now is the one reported by the GHA job that uses my alls-green action. Nothing else influences people's ability to merge (including auto-merge). Having one check is simpler, so one doesn't have to re-enter the matrix-generated check names all the time. But it doesn't work with checks and statuses reported by things outside GHA. So to work, it needs to be added to the branch protection additionally (which should be done for all the external checks anyway). So it's extra maintenance and possible limitations. It'd be nice to enable coverage collection in MyPy, as another example, but you can only retrieve that coverage and send it to Codecov or display elsewhere if it's in GHA. See https://github.com/aio-libs/yarl/actions/runs/9934585463/job/27439204697#step:8:65.
That |
c80c4be
to
fc6e5d6
Compare
Thanks for the explanations! I mainly added pre-commit.ci to get automatic version updates for the pre-commit hooks. I wasn't aware of its limitations and the branch protection configuration requirement. I'll revert the removal of pre-commit in the linting step as you suggested. Same goes for removal of coverage during the linting step. The problem matchers are also new to me! However, it looks like the specific matcher that's deleted here is specifically matching the output of actionlint which is no longer executed in the pre-commit hooks. So it should be safe to delete? |
@seifertm ah, I didn't realize. Yes, you can delete that one. Though, maybe it's worth resurrecting it and skipping it locally. If the linting invocations are properly wrapped with tox, having tox as an entry-point would give us more control. Then, it'd be as simple as integating On top of that, I suggest plugging the jsonschema check into pre-commit — it is useful for a similar purpose and includes ready-to-use schemas for GHA workflows as well as just GHAs. Additionally, it enables you to check things against your own custom schemas, which is really useful for preventing commonly seen mistakes: https://github.com/sphinx-contrib/sphinxcontrib-towncrier/blob/750485e/.pre-commit-config.yaml#L99-L116. |
It isn't used during the build job. Signed-off-by: Michael Seifert <[email protected]>
This reverts commit b735e8a.
Compared to running the hook in the default stage, this doesn't require a working Docker installation to make changes.
fc6e5d6
to
40fb737
Compare
I'm convinced these are good ideas, but I'm reluctant to implement all of them. I followed your suggestion and resurrected the actionlint hook in the manual stage of pre-commit. This way, we don't require Docker for contributing devs, but it's still possible to lint GH actions. |
Removes pre-commit steps from the GitHub actions workflow, because the hooks are now executed by pre-commit.ci.