-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
build: try to speed up Github workflows #12090
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12090 +/- ##
==========================================
- Coverage 67.14% 59.22% -7.93%
==========================================
Files 1002 951 -51
Lines 49300 46658 -2642
Branches 5010 4312 -698
==========================================
- Hits 33103 27633 -5470
- Misses 16072 19025 +2953
+ Partials 125 0 -125
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
16a2754
to
c6ddbbf
Compare
03494b0
to
1c4aba0
Compare
1c4aba0
to
3ca6ea6
Compare
e8faa48
to
98e3922
Compare
35c8d68
to
29df9f4
Compare
Add a script to cancel previous GitHub workflows and optimize the workflows in hope to speed up CI. - Skip dependabot for python jobs - Merge Prefer TypeScript and License Check - Cancel all tests in one workflow
29df9f4
to
85993fd
Compare
continue-on-error: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is essentially useless since the comments will never work for PRs coming from forks (due to the GITHUB_TOKEN access). This would be a good candidate to port over to the workflow_run
approach mentioned in https://securitylab.github.com/research/github-actions-preventing-pwn-requests. Obviously, out of scope for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few non-blocking comments, LGTM.
from typing import Iterable, List, Optional, Union | ||
|
||
import click | ||
import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever possible, we should probably try to use urllib3
over requests
to avoid licensing issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it using Apache 2.0 License as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, they've apparently relicensed. There was a refactor effort some time ago to remove explicit dependency on requests
as it wasn't Apache compatible back then (see #7643). Good to know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I can't find any reference of it ever having been anything but Apache 2.0. Apparently I'm misremembering something or this has been a major misunderstanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't let this one go.. 😄 I read old mailing list archives and turned up this: https://lists.apache.org/thread.html/49c4d03d3aadab5c2d1c20ccf1cb7ca02edbc94961e6429dbf6a082b%40%3Cdev.superset.apache.org%3E Turns out requests
was pulling in chardet
which is LGPL, which was the problem. Turns out chardet
was dropped as of 09/2020: encode/httpx#1269 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it means it's OK to use requests again, I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhh, I went down a link in this issue without noticing that it was pointing to another project: psf/requests#4848 Apparently requests still uses chardet, and there are no plans to remove it. As long as this is the case we're not allowed to reference requests as a required dependency, but it's ok to be had as an optional dependency. As long as we restrict the usage to development scripts we're fine, but we shouldn't use it in the core code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks for the clarification and investigation!
@@ -0,0 +1,141 @@ | |||
# Python MySQL unit tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm mostly indifferent to having these split up versus all in one file, but I'd like to avoid shuffling these around unnecessarily to avoid losing the git history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a hypothesis that there are overheads involved in scheduling multiple workflows vs running them in one. Not sure how much it helps but I still think it makes sense to combine these three considering they are very similar in nature and not particularly expensive to run.
SUMMARY
CI has been slow recently. This PR is the latest effort in trying to mitigate:
Update the Cancel Previous Run job added in build: cancel previous github action runs #11940 to cancel future jobs as well.
Skip dependabot branches when possible (e.g. don't run Python jobs for npm updates).
Merge lighter actions (Prefer Typescript and License Check) into one workflow (there are overheads in starting a job).
Add a script to allow committers to manually cancel CI jobs in queue. This is useful on a busy day when the CI pipeline got clogged by continuous new commits to open PRs. Users have to configure
GITHUB_TOKEN
in their env variables in order to use this.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
Test locally and CI
ADDITIONAL INFORMATION