Skip to content
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-6089] Reorder setup.py dependencies and add ci #6681

Merged
merged 1 commit into from
Nov 30, 2019

Conversation

zhongjiajie
Copy link
Member

@zhongjiajie zhongjiajie commented Nov 27, 2019

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:

reorder setup package in alphabetical and add unittest to ci

Tests

  • My PR adds the following unit tests :

Add test

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

@zhongjiajie zhongjiajie changed the title Order setup add ci [AIRFLOW-6089] Order setup add ci Nov 27, 2019
@codecov-io
Copy link

codecov-io commented Nov 27, 2019

Codecov Report

Merging #6681 into master will decrease coverage by 0.42%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6681      +/-   ##
==========================================
- Coverage   83.84%   83.41%   -0.43%     
==========================================
  Files         668      668              
  Lines       37547    37547              
==========================================
- Hits        31481    31320     -161     
- Misses       6066     6227     +161
Impacted Files Coverage Δ
airflow/kubernetes/volume_mount.py 44.44% <0%> (-55.56%) ⬇️
airflow/executors/sequential_executor.py 47.61% <0%> (-52.39%) ⬇️
airflow/kubernetes/volume.py 52.94% <0%> (-47.06%) ⬇️
airflow/kubernetes/pod_launcher.py 45.25% <0%> (-46.72%) ⬇️
airflow/kubernetes/refresh_config.py 50.98% <0%> (-23.53%) ⬇️
...rflow/contrib/operators/kubernetes_pod_operator.py 78.2% <0%> (-20.52%) ⬇️
airflow/utils/sqlalchemy.py 86.44% <0%> (-6.78%) ⬇️
airflow/executors/__init__.py 63.26% <0%> (-4.09%) ⬇️
airflow/configuration.py 89.13% <0%> (-3.63%) ⬇️
airflow/utils/dag_processing.py 55.84% <0%> (-2.64%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2f8d01...6b4561e. Read the comment docs.

@zhongjiajie
Copy link
Member Author

@zhongjiajie
Copy link
Member Author

I'm not sure if CI work , so I add a failed commit to test if static test work.

@zhongjiajie
Copy link
Member Author

I'm not sure if CI work , so I add a failed commit to test if static test work.

Seem Travis-CI pre-test stage don't catch the error, but test stage catch https://travis-ci.org/apache/airflow/builds/617989011?utm_source=github_status&utm_medium=notification

Have to more work on it

"--" "/opt/airflow/scripts/ci/in_container/run_check_licence.sh" \
"--" "/opt/airflow/scripts/ci/in_container/run_check_setup.sh" \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found out that wrong script name we call.

@zhongjiajie
Copy link
Member Author

Now, Travis-CI failed as we except in https://travis-ci.org/apache/airflow/builds/618058541?utm_source=github_status&utm_medium=notification
BUT NOT SHOW ERROR DETAIL

@potiuk
Copy link
Member

potiuk commented Nov 29, 2019

Hey @zhongjiajie -> It's super cool change. I have one suggestion though. Your test does not require full airflow set of dependencies to run - it's rather standalone, so you can run it as a "python" pre-commit check - similar to isort. Then you would not need all the scripts (they are only needed if you want to run stuff inside docker container).

something like that could work:

      - id: setup-order
        name: Checks for an order of dependencies in setup.py
        language: python
        files: ^setup.py$
        pass_filenames: false
        require_serial: true
        entry: tests/test_order_setup.py

It will automatically create a separate virtualenv for this check and run the test in this virtualenv.

@zhongjiajie
Copy link
Member Author

zhongjiajie commented Nov 29, 2019

@potiuk Thanks for your advices, actually I try to understand how Airflow Breeze work during those days.

@zhongjiajie
Copy link
Member Author

pre-commit configure work with

      - id: setup-order
        name: Checks for an order of dependencies in setup.py
        language: system
        files: ^setup.py$
        pass_filenames: false
        require_serial: true
        entry: "python ./tests/test_order_setup.py"

Will create a new commit tomorrow

@potiuk
Copy link
Member

potiuk commented Nov 29, 2019

You can also run chmod +x ./tests/test_order_setup.py and add shebang "#!/usr/bin/env python" at the beginning of the file to make it executable and get it back to 'entry: tests/test_order_setup.py'

@zhongjiajie -> good that you want to learn how breeze works :). BTW. make sure to take a look at the latest updates to the docs done with Technical Writer Elena: https://github.com/PolideaInternal/airflow/blob/more-gsod-improvements/CONTRIBUTING.rst

@zhongjiajie
Copy link
Member Author

@potiuk This PR is ready for review, PTAL

@zhongjiajie zhongjiajie marked this pull request as ready for review November 30, 2019 03:16
@zhongjiajie zhongjiajie changed the title [AIRFLOW-6089] Order setup add ci [AIRFLOW-6089] Reorder setup.py dependencies and add ci Nov 30, 2019
@@ -458,6 +458,8 @@ image built locally):
----------------------------------- ---------------------------------------------------------------- ------------
``rst-backticks`` Checks if RST files use double backticks for code.
----------------------------------- ---------------------------------------------------------------- ------------
``setup-order`` Checks for an order of dependencies in setup.py
----------------------------------- ---------------------------------------------------------------- ------------
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what Breeze field mean and not add * finally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's explained above (and we have a change in progress that it gets explained better). It's exactly the difference whether it uses Docker Breeze image underneath or not. Your test initially used it (with the scripts etc.) but then now with "python" it does not use those images. So it's ok as it is.

[ all all-but-pylint check-hooks-apply check-merge-conflict check-executables-have-shebangs check-xml debug-statements detect-private-key doctoc end-of-file-fixer flake8 forbid-tabs insert-license check-apache-license lint-dockerfile mixed-line-ending mypy pylint shellcheck].
[ all all-but-pylint check-apache-license check-executables-have-shebangs check-hooks-apply check-merge-conflict check-xml debug-statements doctoc detect-private-key end-of-file-fixer flake8 forbid-tabs insert-license lint-dockerfile mixed-line-ending mypy pylint setup-order shellcheck].
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I make this in alphabetical, same as others hint

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

* Reorder dependencies in setup.py
* Add static check in Airflow Breeze ci
[ all all-but-pylint check-hooks-apply check-merge-conflict check-executables-have-shebangs check-xml debug-statements detect-private-key doctoc end-of-file-fixer flake8 forbid-tabs insert-license check-apache-license lint-dockerfile mixed-line-ending mypy pylint shellcheck].
[ all all-but-pylint check-apache-license check-executables-have-shebangs check-hooks-apply check-merge-conflict check-xml debug-statements doctoc detect-private-key end-of-file-fixer flake8 forbid-tabs insert-license lint-dockerfile mixed-line-ending mypy pylint setup-order shellcheck].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@@ -458,6 +458,8 @@ image built locally):
----------------------------------- ---------------------------------------------------------------- ------------
``rst-backticks`` Checks if RST files use double backticks for code.
----------------------------------- ---------------------------------------------------------------- ------------
``setup-order`` Checks for an order of dependencies in setup.py
----------------------------------- ---------------------------------------------------------------- ------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's explained above (and we have a change in progress that it gets explained better). It's exactly the difference whether it uses Docker Breeze image underneath or not. Your test initially used it (with the scripts etc.) but then now with "python" it does not use those images. So it's ok as it is.

@potiuk
Copy link
Member

potiuk commented Nov 30, 2019

Cool! very nice. Thanks @zhongjiajie !

@potiuk potiuk merged commit fc2098f into apache:master Nov 30, 2019
@potiuk
Copy link
Member

potiuk commented Nov 30, 2019

I also cherry-picked it to v1-10-test :)

potiuk pushed a commit that referenced this pull request Nov 30, 2019
* Reorder dependencies in setup.py

(cherry picked from commit fc2098f)
potiuk pushed a commit that referenced this pull request Nov 30, 2019
* Reorder dependencies in setup.py

(cherry picked from commit fc2098f)
@zhongjiajie zhongjiajie deleted the order_setup_add_ci branch November 30, 2019 17:43
@zhongjiajie
Copy link
Member Author

Thanks Jarek's review and merge

eladkal pushed a commit to eladkal/airflow that referenced this pull request Dec 2, 2019
* Reorder dependencies in setup.py

(cherry picked from commit fc2098f)
kaxil pushed a commit that referenced this pull request Dec 12, 2019
* Reorder dependencies in setup.py

(cherry picked from commit fc2098f)
galuszkak pushed a commit to FlyrInc/apache-airflow that referenced this pull request Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants