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-5226] Consistent licences for all jinja templates #5828

Merged
merged 2 commits into from
Aug 27, 2019

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Aug 15, 2019

Make sure you have checked all steps below.

Jira

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

@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 potiuk force-pushed the licence-jinja-templates branch 2 times, most recently from d69701a to ae203ae Compare August 18, 2019 13:24
@potiuk
Copy link
Member Author

potiuk commented Aug 20, 2019

Bumping up . It's rather small change but adds too our lineup of static checks

@potiuk
Copy link
Member Author

potiuk commented Aug 23, 2019

Should be good to go @ashb :)\

@potiuk
Copy link
Member Author

potiuk commented Aug 23, 2019

Ping here.

@potiuk
Copy link
Member Author

potiuk commented Aug 23, 2019

Geee. It's far too easy to make those duplicate licences.

I think we should fork the licence plugin and make it so that it will try to find if there is an imperfect match and fail the build rather than add licence in this case (with some helpful comment added like "Please delete the licence so that we can add it properly). WDYT @mik-laj @ashb ? . It's mostly a transition problem (because people will start creating new files and copy licences from existing files) but in case there are other means of adding licences (for example plugins in their IDEs) we might end up with a lot of duplicated licences.

@potiuk
Copy link
Member Author

potiuk commented Aug 23, 2019

All should be fixed now.

@mik-laj
Copy link
Member

mik-laj commented Aug 23, 2019

I don't think this is a big problem. The duplicate license is very large and easy to see in new files. I think, it is over engineering, but let's wait what time shows.

@potiuk potiuk force-pushed the licence-jinja-templates branch 2 times, most recently from 3de5e82 to 39d00b6 Compare August 24, 2019 05:09
@potiuk
Copy link
Member Author

potiuk commented Aug 24, 2019

I actually thought it's not that difficult, and it was not. Along the way I fixed a few annoyances with the pre-commit insert-licences. (fuzzy matching, inserting after shebang/ possibility to disable license inserting via comment in the file). I added all tests/documentation and opened PR to Lucas-C's repository (Lucas-C/pre-commit-hooks#12) - hopefully it will make it into 1.1.7 release of his plugin. For now I switched the licence plugins to my fork.

@potiuk potiuk force-pushed the licence-jinja-templates branch 2 times, most recently from 4e6a0d7 to ad6c81c Compare August 24, 2019 23:27
@potiuk
Copy link
Member Author

potiuk commented Aug 26, 2019

Are you OK to merge @mik-laj @ashb. I solved the problem of duplicate licences now - the modified version of the insert-license plugin is now taken from my repo and it's much smarter now + it informs which files were modified + you can disable license insertion for files via appropriate comment. Lots of tests added . I tested it on the parent of this commit and it correctly added new licenses and TODOs where licences were inconsistent with this comment:

--- a/airflow/www/templates/appbuilder/flash.html
+++ b/airflow/www/templates/appbuilder/flash.html
@@ -1,4 +1,6 @@
 {#
+ TODO: This license is not consistent with license used in the project.
+       Delete the inconsistent license and above line and rerun pre-commit to insert good license.
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.

It will prevent committing until you delete all offending licenses and re-insert licenses.

Copy link
Contributor

@milton0825 milton0825 left a comment

Choose a reason for hiding this comment

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

LGTM

@potiuk potiuk merged commit afa7180 into apache:master Aug 27, 2019
potiuk added a commit that referenced this pull request Aug 27, 2019
potiuk added a commit that referenced this pull request Aug 27, 2019
kaxil pushed a commit to kaxil/airflow that referenced this pull request Aug 28, 2019
kaxil pushed a commit that referenced this pull request Aug 30, 2019
Jerryguo pushed a commit to Jerryguo/airflow that referenced this pull request Sep 2, 2019
@potiuk potiuk deleted the licence-jinja-templates branch September 20, 2019 08:03
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.

4 participants