pierrejeambrun commented on PR #27805: URL: https://github.com/apache/airflow/pull/27805#issuecomment-1328221584
Hello @jh242, Thank you for the update. Here you are loading the grid_data info (which has a lot of extra stuff on task instances etc.), just to retrieve the 'configs'. As you said you could end up with less than 10 confs (because of duplicate), or even with no conf at all if the last 10 run were scheduled. Here we statically render a template, there is usually no need to go through an API call. What you could do is, inside the view that renders the `trigger.html`, make your custom request to the db to retrieve the conf you like. (Filter on confs that are not of type json, deduplicate them with a distrinc(), fetch only the last runs that were 'manually triggered', with a conf `not None`) etc. When you have your configurations, you can pass this as an extra variable to the `trigger.html` template. Then update the template so it can use this variable to render extra options in the drop down. You can check the `def index` (/home) view and check how we directly pass variable to the template for rendering. (dags, tags etc). Maybe I missed something, but this should make the code even cleaner and simple :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
