project Utilities / Gitlab Recurring Issue avatar

utilities/gitlab_recurring_issue#4: Implement Scheduling Support



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 08-Sep-24 13:38



Description

The script will be run once a day (by cron), but each ticket in the config needs to be able to specify how often it should be raised.

This is stateless (for the time being at least) so whilst it should be possible to say "Every Monday" it won't be possible to say "every 5 days".

Currently the configuration is provided in a schedule object. The example file contains the following mechanisms:

     # Run on the first day of every month
     schedule:
        day: 1
        month: "*"

     # Will not be supported for now
     schedule:
       every: 4 weeks

Need to build the logic which will read and check these schedules.

I'd like to support the following values for every:

  • Mon (tues.. etc)
  • run (do it every time the script is run)

Eventually I'd like it to support nth stuff too - every second Monday etc - but that's out of scope for now



Toggle State Changes

Activity


assigned to @btasker

verified

mentioned in commit 4c6cf8fc9527e1d27bf3c21b24a838cce03358a5

Commit: 4c6cf8fc9527e1d27bf3c21b24a838cce03358a5 
Author: B Tasker                            
                            
Date: 2024-09-08T15:07:15.000+01:00 

Message

feat: implement scheduling logic (utilities/gitlab_recurring_issue#4)

+64 -5 (69 lines changed)

OK we now support the following:

Specific Date:

schedule:
   day: 1
   month: sep

month can also be set to * to match every month. It can be a shortname or it can be numeric (i.e. 9 for September)

Periodic:

schedule:
  every: run

schedule:
  every: tue

Todo:

  • Allow month to be a list
  • Default day to *?
verified

mentioned in commit 608bb61603266e4f8586a52ff407e478420ad749

Commit: 608bb61603266e4f8586a52ff407e478420ad749 
Author: B Tasker                            
                            
Date: 2024-09-08T15:14:24.000+01:00 

Message

feat: allow multiple months to be provided in schedule (utilities/gitlab_recurring_issue#4)

+19 -2 (21 lines changed)

It's now possible to specify multiple months:

schedule:
   day: 1
   month: 1/2/sep
verified

mentioned in commit 54efae489c3cdaa04f234aa65902aaf3741eed4e

Commit: 54efae489c3cdaa04f234aa65902aaf3741eed4e 
Author: B Tasker                            
                            
Date: 2024-09-08T15:16:55.000+01:00 

Message

feat: allow multiple days to be specified (utilities/gitlab_recurring_issue#4)

+18 -4 (22 lines changed)

It's now possible to do the same with days:

schedule:
   day: 1
   month: 1/2/sep

I guess we should probably implement similar for every

verified

mentioned in commit 63aebece1434602bc19c3eafbb9f9bd4d747cb07

Commit: 63aebece1434602bc19c3eafbb9f9bd4d747cb07 
Author: B Tasker                            
                            
Date: 2024-09-08T15:19:24.000+01:00 

Message

feat: allow multiple every values (utilities/gitlab_recurring_issue#4)

+22 -6 (28 lines changed)

Can now do

schedule:
   every: mon/wed/fri
verified

mentioned in commit 2cf432d65853b09a16a6db638c4cf779a7ea22f8

Commit: 2cf432d65853b09a16a6db638c4cf779a7ea22f8 
Author: B Tasker                            
                            
Date: 2024-09-08T15:49:17.000+01:00 

Message

feat: implement support for nth scheduling (utilities/gitlab_recurring_issue#4)

+52 -7 (59 lines changed)

The commit above implements support for nth weekday scheduling.

For example

schedule:
   nth:
     n: 3
     weekday: Sunday

Will trigger on the 3rd Sunday of the month

I think we've got enough flexibility to do most of what I currently want/need