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
feat(schedule): Support month (M) in schedules #4832
feat(schedule): Support month (M) in schedules #4832
Conversation
As this seemed pretty easy, I thought I'd attempt to implement this one myself. However, it's my first contribution attempt and it seems like I screwed up the implementation in some aspect, seeing that From the coverage, it seems like the schedule is never checked with > parsedSchedule = later.parse.text("of January");
{ schedules: [ { M: [Array] } ], exceptions: [], error: -1 }
> parsedSchedule.schedules[0].M
[ 1 ]
> !!parsedSchedule.schedules[0].M
true If you find the time, could you be so kind to provide me with a pointer how I can find the cause of this issue? |
@cfra I suspect it's because you need to add renovate/lib/workers/branch/schedule.ts Line 52 in 4a62a72
|
4a62a72
to
65d449c
Compare
65d449c
to
ef77046
Compare
Thank you for spotting this. The tests seem to be fine now. |
@@ -49,10 +49,10 @@ export function hasValidSchedule( | |||
} | |||
if ( | |||
!parsedSchedule.schedules.some( | |||
s => s.d !== undefined || s.D || s.t_a !== undefined || s.t_b | |||
s => s.M || s.d !== undefined || s.D || s.t_a !== undefined || s.t_b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget - and clearly didn't document - why some checks were !== undefined
while others were just simple like s.t_b
. I don't suppose you looked into this while deciding what to do for s.M
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit I fell for cargo-cult here and copied the check applied to s.D
without real understanding. 😬
🎉 This PR is included in version 19.68.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Compare the
M
part of the schedule parsed by later so that schedules likeevery Monday of February-April
are handled correctly.Fixes: #4831