Skip to content

Support zero day cooldown - #643

Merged
v-robaiken merged 2 commits into
mainfrom
robaiken/zero-day-cooldown
Aug 7, 2026
Merged

Support zero day cooldown#643
v-robaiken merged 2 commits into
mainfrom
robaiken/zero-day-cooldown

Conversation

@v-robaiken

Copy link
Copy Markdown
Contributor

Cooldown day values of 0 were silently dropped from the job payload. The fields were int with omitempty, so 0 was indistinguishable from unset:

before: {"cooldown":{}}
after:  {"cooldown":{"default-days":0,...}}

This makes 0 a usable way to explicitly disable cooldown.

Changes

  • UpdateCooldown day fields are now *int — explicit 0 serializes, unset stays omitted.
  • Added UpdateCooldown.Validate() in extractInput to reject negative values, covering all input paths (file, args, server, stdin) for update and graph.
  • Tests for zero / non-zero / omitted across the JSON and YAML round-trips.

omitempty is retained per the model-versioning guidance in internal/model/job.go, so this stays compatible with dependabot-core before and after. No existing smoke tests set a zero cooldown.

@v-robaiken
v-robaiken requested review from a team as code owners August 7, 2026 13:01
@v-robaiken v-robaiken self-assigned this Aug 7, 2026
@v-robaiken
v-robaiken marked this pull request as draft August 7, 2026 13:05
@v-robaiken
v-robaiken marked this pull request as ready for review August 7, 2026 13:16
@jakecoffman
jakecoffman requested a balanced review from Copilot August 7, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Enables explicit zero-day cooldowns while rejecting negative values.

Changes:

  • Uses pointer fields to distinguish zero from omitted values.
  • Validates cooldown values before execution.
  • Adds serialization and validation coverage.
Show a summary per file
File Description
internal/model/job.go Updates cooldown fields and validation.
internal/model/job_test.go Tests serialization and validation.
internal/infra/run.go Validates cooldowns before running jobs.
internal/infra/run_test.go Tests run-parameter validation.
testdata/cooldown.yml Adds a zero-day cooldown fixture.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@v-robaiken
v-robaiken added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit d94df0f Aug 7, 2026
108 checks passed
@v-robaiken
v-robaiken deleted the robaiken/zero-day-cooldown branch August 7, 2026 14:44
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.

3 participants