Skip to content

Fix random time in tap-new - #23432

Merged
SMillerDev merged 1 commit into
mainfrom
SMillerDev-patch-1
Aug 4, 2026
Merged

Fix random time in tap-new#23432
SMillerDev merged 1 commit into
mainfrom
SMillerDev-patch-1

Conversation

@SMillerDev

@SMillerDev SMillerDev commented Aug 4, 2026

Copy link
Copy Markdown
Member

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

As @nandahkrishna pointed out, Random.rand does not include the max provided. So 23 can only give 22 as a max return. Upping it by one allows it to select the full day.

Copilot AI lite review requested due to automatic review settings August 4, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the random schedule time generation in brew tap-new so the generated autobump workflow can select the full 24-hour day (including hour 23) and all 5-minute blocks (including minute 55), avoiding an off-by-one limitation in Random.rand(max).

Changes:

  • Adjust random hour generation from Random.rand(23) to Random.rand(24) so 23 is reachable.
  • Adjust random 5-minute block generation from Random.rand(11) * 5 to Random.rand(12) * 5 so 55 is reachable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SMillerDev
SMillerDev added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit c98dece Aug 4, 2026
44 of 45 checks passed
@SMillerDev
SMillerDev deleted the SMillerDev-patch-1 branch August 4, 2026 15:09
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.

4 participants