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-5180] Added static checks (yamllint) + auto-licences for yaml #5790

Merged
merged 1 commit into from Aug 22, 2019

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Aug 13, 2019

Make sure you have checked all steps below.

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title. For example, "[AIRFLOW-XXX] My Airflow PR"
    • https://issues.apache.org/jira/browse/AIRFLOW-5180
    • In case you are fixing a typo in the documentation you can prepend your commit with [AIRFLOW-XXX], code changes always need a Jira issue.
    • In case you are proposing a fundamental code change, you need to create an Airflow Improvement Proposal (AIP).
    • In case you are adding a dependency, check if the license complies with the ASF 3rd Party License Policy.

Description

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

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

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

Code Quality

  • Passes flake8

@potiuk potiuk force-pushed the yamllint-plus-licences branch 3 times, most recently from 99ee8a0 to 4d0be20 Compare August 13, 2019 11:29
@potiuk potiuk changed the title [AIRFLOW-5180] Added static checks (yamllint) + auto-licences for yaml (depends on AIRFLOW-5161, AIRFLOW-5170) [AIRFLOW-5180] Added static checks (yamllint) + auto-licences for yaml Aug 15, 2019
@potiuk
Copy link
Member Author

potiuk commented Aug 15, 2019

Part of static checks dealing with yaml (yamllint + consistent licenses). Removed the chaing of depnding commits.

@potiuk potiuk requested review from dimberman and ashb August 15, 2019 04:58
@mik-laj mik-laj added the area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code label Aug 16, 2019
@potiuk
Copy link
Member Author

potiuk commented Aug 20, 2019

Rather small consistency change for all yaml files :). Would be nice to merge it.

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

One minor change, otherwise looks good to me.

Do we need to add yamllint-config.yaml to the safelist in .dockerignore?

@potiuk potiuk force-pushed the yamllint-plus-licences branch 3 times, most recently from d12b807 to 92f11cd Compare August 22, 2019 03:24
@potiuk
Copy link
Member Author

potiuk commented Aug 22, 2019

@ashb - no, we do not need to add it. yamllint static check is not run in Docker.

But we should add it as pre-requisite (just did)

      - id: yamllint
        name: Check yaml files with yamllint
        entry: yamllint -c yamllint-config.yml
        language: python
        types: [yaml]
        exclude: ^.*init_git_sync\.template\.yaml$|^.*airflow\.template\.yaml$

It would work out-of-the-box if we did not have [devel] extra.

The key is 'language: python' here. In this case Yamllint is run via yamlint python pre-commit plugin. Those plugins (which are python-based) manage their dependencies and virtualenvs on their own. Basically those built-in plugins create their own small virtualenv where they install needed dependencies (yamllint in this case) using pip install . and run the plugin within that virtualenv. It's all done automagically by the pre-commit framework - without docker. This works for simple stand-alone plugins like yamllint where you have just one or two dependencies that are system-independent and can rely on virtualenv. In our case yamllint is only installed with [devel] extra so we need to add it as pre-requisite to be installed locally (it will complain if yamllint is not installed)

@potiuk potiuk merged commit e1cb8ce into apache:master Aug 22, 2019
potiuk added a commit that referenced this pull request Aug 22, 2019
Jerryguo pushed a commit to Jerryguo/airflow that referenced this pull request Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-env CI, pre-commit, pylint and other changes that do not change the behavior of the final code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants