Skip to content

Conversation

@bbovenzi
Copy link
Contributor

@bbovenzi bbovenzi commented Aug 19, 2021

Adds info on the next run from next_dagrun in the hoem page list of all dags and on the individual dag pages.

#17726

Unfortunately, next_dagrun only existed on DagModel and not Dag so I had to manually add it to every relevant endpoint in views.py. I also had to do some weird js logic to format the dates in line with the rest of the UI.

Also, I tried to update the copy on execution date. Open to suggestions. (Updating use of execution_date throughout the UI will be a different PR)

Screen Shot 2021-08-19 at 4 15 18 PM

Screen Shot 2021-08-19 at 4 14 59 PM

Closes #2460


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
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.

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Aug 19, 2021
@bbovenzi bbovenzi requested a review from uranusjr August 19, 2021 14:15
@uranusjr uranusjr added the AIP-39 Timetables label Aug 19, 2021
@potiuk
Copy link
Member

potiuk commented Aug 19, 2021

Thrlilled ! That's one of those great features that look like small ones but can totally change your experience.

@ashb ashb linked an issue Aug 19, 2021 that may be closed by this pull request
@kaxil kaxil added this to the Airflow 2.2 milestone Aug 20, 2021
@github-actions
Copy link

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.

@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 26, 2021
@uranusjr
Copy link
Member

Since there are many execution_date usages to change, this will be done in a follow-up PR instead.

</a>
{% if dag_model is defined and dag_model.next_dagrun_create_after is defined %}
<p class="label label-default" style="margin-left: 5px">
Next Run: <span id="next-run">{{ dag_model.next_dagrun_create_after }}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By making this a <time> element it will automatically get converted by the timezone selector (not to mention that just semantically this is a time 😁)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I forgot that we select elements by <time> in datetime_utils.js. Fixed.

Use `<time>` to use our existing `datetime_utils` to format and handle timezone changes
@uranusjr
Copy link
Member

I just noticed something. We are using next_dagrun_create_after for Next Run, but is still using execution_date for Last Run. So for example_bash_operator (see screenshot in the top message), the runs are two hours apart even though the schedule is one hour. I think we should change Last Run to use start_date instead, does that sound righ @ashb?

@bbovenzi
Copy link
Contributor Author

I updated Next Run to use the execution date to be consistent with Last Run. I also added a tooltip for the next run to show the create after and data interval. For Last Run, I decided to extend the use of the tiTooltip we use in the tree view. All of these dates will also update whenever the app's timezone changes.

Screen Shot 2021-08-30 at 11 56 22 PM

Screen Shot 2021-08-30 at 11 56 34 PM

Screen Shot 2021-08-30 at 11 56 37 PM

@bbovenzi bbovenzi requested a review from uranusjr August 30, 2021 22:00
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t really understand the js code, but the end result looks awesome

@uranusjr
Copy link
Member

Hmm a lot of tests failing, many seem to be related to the new dag_model addition to templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-39 Timetables area:UI Related to UI/UX. For Frontend Developers. 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.

Make the DAG's upcoming scheduled run visible in UI

6 participants