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

Remove /dagrun/create and disable /dagrun/edit generated by F.A.B #17376

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Aug 2, 2021

This came up during a conversaion with @ashb. Currently we are exposing the ability to directly create and edit a DagRun instance via F.A.B.’s CRUD view generation (the plus and edit icons on the DagRun list view). But these views don’t really make a lot of sense; creating a DagRun requires doing more than just adding a DagRun instance to the database (which is why triggering a DAG run in the home view uses /trigger instead). The /dagrun/add view provides essentially a way to manually modify Airflow’s internal state. So this view is removed.

The story with /dagrun/edit is similar. The only thing on a DagRun that can be reasonably edited is the state (running, failed, skipped, etc.), but that should also do more things than just setting the state, which is why we have Mark Failed, Mark Success, and Clear action buttons. Unfortunately, we can’t remove the field since we need the can_edit permission for those state-setting action methods, so instead all fields in the edit form is disabled so the user can’t modify anything on the DagRun.

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Aug 2, 2021
@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Aug 2, 2021
@github-actions
Copy link

github-actions bot commented Aug 2, 2021

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@uranusjr
Copy link
Member Author

uranusjr commented Aug 2, 2021

Grr, so it seems F.A.B. does not allow disabling the edit form as long as there is an action that uses the edit permission (wtf). So we need to jump through some hoops for this. One workaround I can think of is to keep the edit view, but make all fields readonly.

@uranusjr uranusjr marked this pull request as draft August 2, 2021 15:17
@uranusjr
Copy link
Member Author

uranusjr commented Aug 2, 2021

OK, maybe this is good enough.

@uranusjr uranusjr marked this pull request as ready for review August 2, 2021 16:28
@uranusjr uranusjr changed the title Remove /dagrun/create and /dagrun/edit generated by F.A.B Remove /dagrun/create and disable /dagrun/edit generated by F.A.B Aug 3, 2021
@uranusjr uranusjr merged commit ac92b17 into apache:main Aug 3, 2021
@uranusjr uranusjr deleted the remove-dagrun-create-view branch August 3, 2021 10:02
jedcunningham pushed a commit to astronomer/airflow that referenced this pull request Jan 13, 2022
jedcunningham pushed a commit to astronomer/airflow that referenced this pull request Jan 13, 2022
jedcunningham pushed a commit to astronomer/airflow that referenced this pull request Jan 13, 2022
jedcunningham pushed a commit to astronomer/airflow that referenced this pull request Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants