renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

Does renovate support this schedule? (Twice monthly on a specific day of the week) #953

Closed fullstackzach closed 4 years ago

fullstackzach commented 4 years ago

Which Renovate are you using?

Renovate Open Source CLI

Which platform are you using?

GitLab self-hosted

Have you checked the logs? Don't forget to include them if relevant

What would you like to do?

Hello Rhys and team!

I am trying to set up a schedule config where I would like to set Renovate to only open new merge requests twice monthly (every two weeks) on Wednesdays only. Eg. for 2020 upcoming November it would only open on the 4th and 18th and for December on the 2nd and 16th.

I developed this text string that it seems would work with later.js: later.parse.text('on wednesday on the 1st and 3rd day instance')

This seems to work in later.js and I get a later.js schedule showing: { schedules: [ { d: [ 4 ], dc: [ 1, 3 ] } ],  exceptions: [],  error: -1 }

later.schedule(sched).next(10, now.toDate()) shows this output (adjusted for timezone using moment.js)

[ Wed Nov 04 2020 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Nov 18 2020 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Dec 02 2020 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Dec 16 2020 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Jan 06 2021 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Jan 20 2021 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Feb 03 2021 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Feb 17 2021 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Mar 03 2021 00:00:00 GMT-0600 (Central Standard Time), 
  Wed Mar 17 2021 00:00:00 GMT-0500 (Central Daylight Time) ] 

I didn't want to wait until a valid schedule occurance to test and I was curious how renovate uses the later.js schedule object, so I looked into renovate code itself and found it is parsingd, D t_a, t_b and t_y from later.js in schedule.ts. But, it doesn't parse dc (dayOfWeekCount). This leads me to think my schedule string will cause renovate to run weekly every Wednesday instead.

Is my thinking correct and is there a different way I could set the schedule in a renovate config to achieve this?

rarkins commented 4 years ago

Using later has definitely been both a benefit and a curse. It sounds like we should try to support dc, so that it behaves as you'd wish.

Quick question: I don't suppose this is a schedule you'd configure using cron syntax if given the chance? I've considered adding cron schedule support as a "foolproof" alternative to later's syntax. Surprised to not find an open issue for it so created one now: https://github.com/renovatebot/renovate/issues/7612

fullstackzach commented 4 years ago

I've used cron before and would be familiar with that option if available, it sounds like a good alternative. The later text parser normally is intuitive for a simpler schedule, but in this case the language didn't seem very intuitive. If I were scheduling a recurring meeting for example, I wouldn't say to my peers we would schedule it "on wednesday on the 1st and 3rd day instance".

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. If this question is not done (either you plan to update it or are waiting on someone to respond) then please add a comment here to bump it and/or get the other person's attention. We aim to do our best to solve every problem. This bot is here to help us clean up issues which are no longer of use to the original poster, and not to close anything prematurely, so bump as you need!