renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io

Home Page:https://mend.io/renovate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Widen cron syntax support, update docs

rarkins opened this issue · comments

Describe the proposed change(s).

Discussion: #32369

We should support as much of the cron spec as our parser allows us. I'm not sure why we needed to write our own logic actually, isn't there the ability for us to use a library to tell us "is this now?"

Additionally, our docs on scheduling should be changed to be cron-first and not using later syntax by default.

We could use the cron-parser library's next() method as implemented in this PR. But, this only covers use of L in the day of month and day of week field. And some other keywords like #, W are not supported yet by this library.

Some other libraries which also have the equivalent of above mentioned next() method are:

  1. cronosjs (supports every cron special char)
  2. croner ( doesn't support W)
  3. node-schedule (does not support L, W and #)
  4. cron-schedule (even has a matchDate fn, like we want ... but doesn't support L and #)

Take the one which supports all?

Take the one which supports all?

Cronosjs does but has 60k downloads...whereas Croner only falls short on W char but has 2mil downloads .

I am confused between these two.

Cronojs seems "unmaintained", although with no bugs open either. I think it's worth going with a maintained dependency, even if we have to document 1-2 limitations

Additionally, our docs on scheduling should be changed to be cron-first and not using later syntax by default.

Should all the schedule examples in later syntax be converted?

Yes good idea