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

feat(schedule): use croner library to check schedule #32573

Conversation

RahulGautamSingh
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh commented Nov 16, 2024

Changes

Use the nextRun() method from croner library to get the next scheduled date. And compare it to current date to check if current date lies in the cron schedule.

Context

Cover implementation requirements of: #32414

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository 1, 2, 3, 4, 5

@RahulGautamSingh RahulGautamSingh marked this pull request as ready for review November 18, 2024 15:37
@RahulGautamSingh RahulGautamSingh changed the title refactor(schedule): use cron-parser library to check schedule refactor(schedule): use croner library to check schedule Nov 18, 2024
@RahulGautamSingh RahulGautamSingh requested review from rarkins, secustor and viceice and removed request for rarkins and secustor November 18, 2024 16:43
Copy link
Collaborator

@secustor secustor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The massaging of the input value is missing, else LGTM

@RahulGautamSingh
Copy link
Collaborator Author

The massaging of the input value is missing, else LGTM

It was disicussed internally to leave it as we will need to add more complexity to support something that is essentially an invalid configuration.

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/workers/repository/update/branch/schedule.ts Outdated Show resolved Hide resolved
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should update docs to.only use five part cron syntax, because we don't care for second and minute anyway.

lib/workers/repository/update/branch/schedule.ts Outdated Show resolved Hide resolved
@RahulGautamSingh
Copy link
Collaborator Author

I think we should update docs to.only use five part cron syntax, because we don't care for second and minute anyway.

In all examples of cron syntax, we have 5 parts

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@viceice viceice changed the title refactor(schedule): use croner library to check schedule feat(schedule): use croner library to check schedule Nov 24, 2024
@secustor secustor added this pull request to the merge queue Nov 25, 2024
Merged via the queue into renovatebot:main with commit a9a5db2 Nov 25, 2024
39 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 39.30.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants