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

GUI: Improve scheduling section (was: Adding execution time restriction) #1196

Closed
wants to merge 4 commits into from

Conversation

makoehr
Copy link

@makoehr makoehr commented Nov 21, 2021

This allows to execute cron jobs only within specified hours during a day.

@buhtz
Copy link
Member

buhtz commented Aug 22, 2022

This is a big and nice PR. Thank's a lot for that.

Please be aware of the discussion in #1232 especially #1232 (comment) .

@emtiu emtiu added the Feature requests a new feature label Sep 8, 2022
@buhtz buhtz changed the base branch from main to dev January 16, 2023 09:07
@buhtz
Copy link
Member

buhtz commented Jun 14, 2023

Dear @makoehr ,
can you please add a screenshot of the modified SettingsDialog please.

Can you also please describe your use case. Why do you need such a restriction? What scheduling options do you use?

Note to me:

  • Remove the po-file modifications. Need to be done in a separate PR.
  • Remove the config-manpage modifications because this manpage will be autogenerated based on the docstrings in config.py.
  • Update the docstrings in config.py based on the config-manpage modifications.

I converted that into a Draft because it is IMHO a workaround and not a solution. The PR just adding a text field to the GUI.

But this PR can be a good start to re-design the Scheduling section of the GUI. There are some cron-related GUI applications around that could stand as a good example about how to represent the cron-concept in a GUI. But to my quick research I don't like most of them because they just move the crontab syntax in a GUI.

@buhtz buhtz marked this pull request as draft June 14, 2023 07:22
@buhtz buhtz self-assigned this Jun 14, 2023
@buhtz buhtz added Scheduling cron, anacron etc. Discussion decision or consensus needed Feedback needs user response, may be closed after timeout without a response Cosmetics appearance, icons, themes labels Jun 14, 2023
@buhtz buhtz changed the title Adding execution time restriction GUI: Improve scheduling section (was: Adding execution time restriction) Jun 14, 2023
@makoehr
Copy link
Author

makoehr commented Jun 14, 2023

Dear @makoehr , can you please add a screenshot of the modified SettingsDialog please.

Please find the screenshot attached.

Can you also please describe your use case. Why do you need such a restriction? What scheduling options do you use?

I use e.g. a time period between 6am and 9pm.

Screenshot

@aryoda
Copy link
Contributor

aryoda commented Jun 14, 2023

@makoehr Thanks a lot for your really valuable contribution!

I suggest

  • to rename Execution time restrictions to something like cron jobs time restrictions (HOURS) to make it more clear what it is
  • add logic to check if the cron HOURS expression is valid (see https://crontab.guru/ for details).
    This logic should not sit in the GUI but in the profile processing class recognize invalid expressions in hand-crafted profile files too

@buhtz
Copy link
Member

buhtz commented Jun 15, 2023

Thanks for your feedback.

Can you also please describe your use case. Why do you need such a restriction? What scheduling options do you use?

I use e.g. a time period between 6am and 9pm.

But what is your schedule setting? What have you selected in the schedule dropdown menu on the first tab?

Aryoda: I'm interested in a re-design of the scheduling section. So I take this PR as an inspiration. I have some things in mind.

@buhtz
Copy link
Member

buhtz commented Jun 15, 2023

Let me add a further question about my approach. In short: I vote to remove the cron part from the GUI (but not from BIT itself).

Cron & Anacron

I assume most of the readers here do know the difference. But I want to break it down again.

The BIT user can say Every 4 Hours resulting in the crontab line 0 */4 * * *.
image

The BIT user can also say Repeatedly Every 4 Hours resulting in an anacron job. I wasn't able to find the file location where this job goes.
image

The first using cron do run only at specific time points. In our case it is 0:00, 4:00, 8:00, ... every day. If the machine isn't running the jobs are missing and won't made up.
The second using anacron results in timespans of minimum 4 hours. The job do run after 4 hours have passed. If the machine isn't running after 4 hours, it is no problem because anacron will notice at next time the machine boots up that more than 4 hours have passed and the job is run.

In short: cron focus on specific time points and anacron on timespans.

Represent that in a GUI to the user

My point is that not all users may know or understand the difference between cron and anacron. Even if they understand they shouldn't need to think about it. It is the job of a GUI to abstract that and make it easy to them.

Cron & Anacron in the GUI

If we would represent both concepts in a GUI I would modify the terms like his:

  • Cron: Run each 4th Hour or more generally Run each n-th Minute/Hour/Day/Week/Month
  • Anacron: Run after 4 Hours or Run after n Hour/Day/Week/Month

I looked up at the difference between "every" and "each". To my understanding "each" do fit better here for the cron part.
We also could add some info labels or tooltips to make it more clear to the user what the results of the settings are.

Anacron only in the GUI

It is IMHO not easy to understand the GUI if cron and anacron are in there. For some users it may result in headaches to figuring out the difference between "each n hour" and "after n hours".

To make it easier for the users I would vote to remove (or kind of hide) the cron part of that GUI.

Additional settings

Because of backwards compatibility the cron functionality shouldn't be removed in BIT itself; only in the GUI.
I would like to add the ability for the users to write their own cron line. This would be like an expert option.

I will try to draw a Mockup with QtCreator soon.

EDIT

I learn on bit-dev mailing list that BIT do not use anacron but simulates the anacron behavior. BIT do start itself every 15 minutes and then check the last snapshot execution like anacron would do. This is an important info but do not interfer with my question if we could remove the cron-like scheduling options from the GUI.

@buhtz
Copy link
Member

buhtz commented Jun 19, 2023

Dear @makoehr ,
we would be glad if you could join our discussion at #1449 , where we have mockup for a new scheduling dialog. What do you think about it? How could your restricted-hours use-case could be realized in such a dialog.

@buhtz
Copy link
Member

buhtz commented Jun 27, 2023

Dear Mathias,
again, thank you very much for your contribution.

I will close this PR because your idea and your input go lives on in #1449 and won't be lost. We plan to completely redesign the schedule section in the GUI.

@buhtz buhtz closed this Jun 27, 2023
@buhtz buhtz removed the Feedback needs user response, may be closed after timeout without a response label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cosmetics appearance, icons, themes Discussion decision or consensus needed Feature requests a new feature Scheduling cron, anacron etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants