-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-4757] Selectively disable missing docstrings for tests #5400
[AIRFLOW-4757] Selectively disable missing docstrings for tests #5400
Conversation
d9489d8
to
9efca0a
Compare
9efca0a
to
5646ab1
Compare
@BasPH @ashb - I also added a few minor changes to make the bash script more "resilient" - now you can run it from any directory and it will work fine, I also added the usual -uo pipefail (I usually add set -euo pipefail for all bash scripts). I also disabled -x by default and replaced it with more informative messages (still left commented set -x so that you can uncomment it if needed) |
5646ab1
to
de335e2
Compare
# Uncomment to see the commands executed | ||
# set -x | ||
|
||
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
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 thought BASH_SOURCE
was only for when you did source myscript
not ./myscript
- am I mis-remembering?
(BTW git
has git rev-parse --show-toplevel
which will print the abs-path to the root of the repo.)
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.
Not only - BASH_SOURCE array contains all bash scripts that were used. I always use this construct in all the bash scripts I run - this way I get them independent from where they are run.
See here for example: https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
The problem with git is that not everywhere you have .git directory. For example we've learned that Dockerhub does not have the whole .git repo while building image. It's very similar in case of cloud build - there is no guarantee you have .git repo around. Of course in our case we know we have the repo in Travis, but not relying on it if we can is a better strategy IMHO.
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.
Just to backup my statement on cloud build: GoogleCloudPlatform/cloud-builders#236
|
||
find . -name "*.py" \ | ||
-not -path "./.eggs/*" \ | ||
-not -path "./airflow/www/node_modules/*" \ | ||
-not -path "./airflow/_vendor/*" \ | ||
-not -path "./build/*" \ | ||
-not -path "./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.
git ls-files airflow/ | grep '.py'
?
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 like this, but again I have concerns that in some cases we might not have .git around. Do you think it is worth it to rely on .git dir @ashb ?
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 can't see a case we'd want to run Pylint without a checkout as it's very much a CI-only thing. (I'm guessing we will volume mount in a checkout under the docker-based CI you will be working on?)
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.
Here is the case explained: GoogleCloudPlatform/cloud-builders#236 - the more "modern" CIs (such as cloud buid) work exclusively as Docker-first and usually they will ignore .git repo because otherwise it has to be passed as context to within Docker. That might slow-down the process a lot for big repositories as context is often sent to remote Docker server.
I am not saying we are going to do this, but I think building in a dependency on .git might not be future-proof as we know some CIs are already going in this direction.
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 is exactly what happens in Dockerhub, so this is not an isolated cloud-build case only.
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 use airflow-breeze to run Airflow, but I do small modification in my environment. I use a git worktree to eliminate the need to have multiple copies of the same repository in multiple workspace. In this case, the git does not work properly. Not relying on git is a very good idea.
de335e2
to
1905c9e
Compare
@ashb -> are you ok (at least for now) with not adding git to the picture? I'd love to merge that one. That can make developer's live a bit easier ;). |
Oh yeah more than happy with this as it is. |
Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation
Code Quality
flake8