<p dir="auto"><strong>Apache Airflow version</strong>:<br>
1.10.11</p>
<p dir="auto"><strong>Kubernetes version (if you are using kubernetes)</strong> (use <code class="notranslate">kubectl version</code>):<br>
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-16T00:04:31Z", GoVersion:"go1.14.4", Compiler:"gc", Platform:"darwin/amd64"}<br>
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-13T06:39:58Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: Azure Kubernetes Service</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): Debian GNU/Linux 10 (buster)</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux airflow-web-65cb7d9cb8-qzcbv 4.15.0-1089-azure <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="92247084" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/99" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/99/hovercard" href="https://github.com/apache/airflow/pull/99">#99</a>~16.04.1-Ubuntu SMP Fri Jun 5 15:30:32 UTC 2020 x86_64 GNU/Linux</li>
<li><strong>Install tools</strong>: Helm chart "stable/airflow"</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">After upgrading from 1.10.10 to 1.10.11 (and also with new installs of 1.10.11) there are some permission warnings in the webserver logs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-08-14 22:19:30,022] {manager.py:545} WARNING - Refused to delete permission view, assoc with role exists XComModelView.can_add Admin
[2020-08-14 22:19:30,038] {manager.py:545} WARNING - Refused to delete permission view, assoc with role exists XComModelView.can_edit Admin"><pre class="notranslate"><code class="notranslate">[2020-08-14 22:19:30,022] {manager.py:545} WARNING - Refused to delete permission view, assoc with role exists XComModelView.can_add Admin
[2020-08-14 22:19:30,038] {manager.py:545} WARNING - Refused to delete permission view, assoc with role exists XComModelView.can_edit Admin
</code></pre></div>
<p dir="auto">It seems to be directly related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="649125466" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/9614" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/9614/hovercard" href="https://github.com/apache/airflow/pull/9614">#9614</a> that <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kaxil/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kaxil">@kaxil</a> introduced for 1.10.11 which removes the <code class="notranslate">can_add</code> and <code class="notranslate">can_edit</code> permissions from <code class="notranslate">XComModelView</code>, but Airflow can not delete the permissions from that view because relations to those permissions still exist on the "Admin" and "Op" roles.</p>
<p dir="auto">In more technical terms, the two permissions can't be deleted from <code class="notranslate">ab_permission_view</code> table because each have relations to both the Admin's and Op's role_ids in the <code class="notranslate">ab_permission_view_role</code> table.</p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
No warnings with Airflow 1.10.11</p>
<p dir="auto"><strong>How to reproduce it</strong>:</p>
<ol dir="auto">
<li>Install 1.10.11</li>
<li>Either:
<ol dir="auto">
<li>View the logs of the webserver</li>
<li>Run any airflow CLI command, such as <code class="notranslate">airflow list_users</code> and view the outputted log messages</li>
</ol>
</li>
<li>After a few lines of the log you will see the warnings</li>
</ol>
<p dir="auto"><strong>Anything else we need to know</strong>:</p>
<p dir="auto">If those 4 role permissions are removed from the <code class="notranslate">ab_permission_view_role</code> table the warnings should stop. I think a migration needs to be added, or some logic that cleans up these role permissions is failing to do its job.</p>
<h3 dir="auto">Description</h3>
<p dir="auto">I don't believe backfilling (of data) is not well handled in Airflow at the moment.</p>
<p dir="auto">I believe the current backfill CLI command should have a UI component on the webserver - not the least as many deployments of Airflow doesn't expose a CLI interface to the users - only to admins.</p>
<p dir="auto">I would  also like it to handle the following cases:</p>
<ol dir="auto">
<li>Backfill a DAG for execution dates where it has already run.</li>
</ol>
<ul dir="auto">
<li>This essentially is the same as clearing all DAG-runs between those dates. The current UI forces me to manually clear the runs, I can toggle "Future" or "Past", but nothing like a "Range Between".</li>
</ul>
<ol start="2" dir="auto">
<li>Backfill a TASK for execution dates where it has already run</li>
</ol>
<ul dir="auto">
<li>This is essentially the same as above, except instead of clearing the whole DAG, it would clear a task, and potentially all downstreams from that task. A common use case here is when a new task is added to an existing DAG and you want to re-trigger it for historical dates. Currently the new task will have no execution, but the DAG it was created into will have successful runs for those dates.</li>
</ul>
<ol start="3" dir="auto">
<li>The above, including execution dates where it has not run</li>
</ol>
<ul dir="auto">
<li>In both the above examples, specifying a start_date before pre-existing DAG runs should insert those DAG runs and execute them. It should also insert any missing dag-runs between the dates where it has already run, in case those have gone missing.</li>
</ul>
<p dir="auto">I'd be happy to provide some of the functionality in a PR, but I am not a skilled frontend developer.</p>
<h3 dir="auto">Use case/motivation</h3>
<p dir="auto">Altering a DAG or task is a common use-case, for instance if an improvement to some business logic has been made - or a bug has been found and fixed. Restoring the status of those produced datasets easily is then important.</p>
<p dir="auto">Here's both the case where you want to re-run DAG executions, and insert new DAG executions for historical dates that may have been cleaned up to save space in the DB.</p>
<h3 dir="auto">Related issues</h3>
<p dir="auto">I am certain this has been raised and discussed in the past. It is the number one feature I miss from working with Luigi - where I could easily re-trigger historical task-runs.</p>
<h3 dir="auto">Are you willing to submit a PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>