-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix(schedules): criteria for triggering a build #893
Conversation
Codecov Report
@@ Coverage Diff @@
## main #893 +/- ##
=======================================
Coverage 71.47% 71.47%
=======================================
Files 304 304
Lines 12450 12450
=======================================
Hits 8899 8899
Misses 3120 3120
Partials 431 431 |
looks good, just some minor tweaks to use the schedule we fetch from the database while iterating |
@jbrockopp should the |
@JordanSussman yeah I plan to remove that but initially had it there for testing purposes for Easton and I. I'm finalizing one last change here shortly and then I'll also remove that file. |
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.
thanks 👍🏼
Co-authored-by: @ecrupper
xref: go-vela/community#538
Part of go-vela/community#772
Based off of #846
This change attempts to address feedback provided by David in Slack.
First Time
The first change removes this code which would immediately trigger a build for a schedule if it hasn't already ran:
server/cmd/vela-server/schedule.go
Lines 52 to 59 in 45c6007
This is likely unexpected behavior from a user stand point so we should minimize the amount of triggered builds.
Processing Schedules
The second change modifies the logic used to determine how often we scan the
schedules
table:server/cmd/vela-server/server.go
Lines 179 to 193 in 45c6007
Currently, we're leveraging the
schedule-minimum-frequency
flag and jitter to control this behavior:server/cmd/vela-server/main.go
Lines 213 to 218 in 45c6007
However, this leads to complications for schedules setup to run at a specific time every hour.
Now, we'll leverage a completely separate
schedule-interval
flag to enable admins to configure this behavior.Timed Schedules
The final change modifies the logic used to determine if we should trigger a build for a schedule:
server/cmd/vela-server/schedule.go
Lines 60 to 83 in 9f92c24
This causes issues because adhocore/gronx rounds to the nearest whole interval.
i.e. if the current time is 2:03 with a
*/5 * * * *
schedule,PrevTick()
will be 2:00 andNextTick()
will be 2:05