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-6733] Extend not replace template #7366

Merged
merged 2 commits into from
Feb 6, 2020

Conversation

ashb
Copy link
Member

@ashb ashb commented Feb 5, 2020

We had copied whole-sale the baselayout.html from FAB and customized it, but pre-existing mechanism in flask/jinja of template inheritance means we don't have to do this.

We can instead extend the template from FAB and change the few blocks we need to.

I have written this PR as two commits -- one to move the file without any changes (we can't extend appbuilder/baselayout.html from FAB while our file exists, as that is "earlier" in the template search path) and then a second commit that keeps just the blocks we have extended/changed.


Issue link: AIRFLOW-6733

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Commit message/PR title starts with [AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID*
  • Unit tests coverage for changes (not needed for documentation changes)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

* For document-only changes commit message can start with [AIRFLOW-XXXX].


In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

This commit just moves the existing template to airflow/master.html
(without further changes)
This makes is easier to see which parts of the template we have changed.
@ashb ashb requested a review from mik-laj February 5, 2020 12:38
@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Feb 5, 2020
@codecov-io
Copy link

Codecov Report

Merging #7366 into master will increase coverage by 52.6%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7366      +/-   ##
==========================================
+ Coverage   32.84%   85.44%   +52.6%     
==========================================
  Files         871      871              
  Lines       40627    40627              
==========================================
+ Hits        13343    34714   +21371     
+ Misses      27284     5913   -21371
Impacted Files Coverage Δ
airflow/www/app.py 94.24% <ø> (+11.51%) ⬆️
...flow/providers/apache/cassandra/hooks/cassandra.py 21.51% <0%> (-72.16%) ⬇️
airflow/kubernetes/volume_mount.py 44.44% <0%> (-55.56%) ⬇️
airflow/api/auth/backend/kerberos_auth.py 28.16% <0%> (-54.93%) ⬇️
airflow/providers/redis/operators/redis_publish.py 50% <0%> (-50%) ⬇️
airflow/kubernetes/volume.py 52.94% <0%> (-47.06%) ⬇️
airflow/providers/mongo/sensors/mongo.py 53.33% <0%> (-46.67%) ⬇️
airflow/kubernetes/pod_launcher.py 47.18% <0%> (-39.44%) ⬇️
airflow/providers/redis/sensors/redis_key.py 61.53% <0%> (-38.47%) ⬇️
airflow/executors/celery_executor.py 50.67% <0%> (-34.46%) ⬇️
... and 741 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 ea93bb6...4ba0dde. Read the comment docs.

@ashb ashb requested review from dimberman and potiuk February 5, 2020 17:03
@feluelle
Copy link
Member

feluelle commented Feb 6, 2020

Thanks for the good explanation. I was about to ask why you put this in two commits - now I get it 👍

@ashb ashb merged commit 220bc0e into apache:master Feb 6, 2020
@ashb ashb deleted the extend-not-replace-template branch February 6, 2020 13:19
ashb added a commit to astronomer/airflow that referenced this pull request Feb 6, 2020
* [AIRFLOW-6733] Extend, rather than replace, the base_template

This commit just moves the existing template to airflow/master.html
(without further changes)

* [AIRFLOW-6733] Only change blocks we have customized

This makes is easier to see which parts of the template we have changed.

(cherry picked from commit 220bc0e)
galuszkak pushed a commit to FlyrInc/apache-airflow that referenced this pull request Mar 5, 2020
* [AIRFLOW-6733] Extend, rather than replace, the base_template

This commit just moves the existing template to airflow/master.html
(without further changes)

* [AIRFLOW-6733] Only change blocks we have customized

This makes is easier to see which parts of the template we have changed.
kaxil added a commit that referenced this pull request Mar 23, 2020
kaxil added a commit that referenced this pull request Mar 30, 2020
kaxil added a commit to astronomer/airflow that referenced this pull request Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants