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

Fix regression on trigger form error display on form validation #37672

Conversation

jscheffl
Copy link
Contributor

During release tests of 2.8.2rc2 I realized a small regression on Trigger form UI in special conditions:

If the trigger form is submitted with invalid values, the rendering of the re-display of the form generates a stack trace display with "UndefinedError" - "jinja2.exceptions.UndefinedError: 'form' is undefined".

This can be caused by the user by:

  1. Open a trigger form and adjust the generated JSON manually to be invalid (e.g. use example_params_ui_tutorial, set required_field: null) and try to submit
  2. If the user tries to trigger a form w/o config and the option AIRFLOW__WEBSERVER__SHOW_TRIGGER_FORM_IF_NO_PARAMS=True is set, the DAG has required fields which are generating an invalid DAG run.

Root cause is missing to supply the "form" value from a rework in PR #37497 where 1 line was deleted accidentially:

https://github.com/apache/airflow/pull/37497/files#diff-917b70d2661fae8322c538a4f60b9d4ba755556036fe0c527eb0411a6ac60f2eL2155

This PR adds the line such that the form can be rendered again.
Double checked and this is the only path where the form parameter was missing for rendering.

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Feb 24, 2024
@jscheffl jscheffl added the area:UI Related to UI/UX. For Frontend Developers. label Feb 24, 2024
@jscheffl jscheffl merged commit 8f5d7d2 into apache:main Feb 24, 2024
57 checks passed
ephraimbuddy pushed a commit that referenced this pull request Feb 24, 2024
@ephraimbuddy ephraimbuddy added this to the Airflow 2.8.2 milestone Feb 24, 2024
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 24, 2024
abhishekbhakat pushed a commit to abhishekbhakat/my_airflow that referenced this pull request Mar 5, 2024
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants