Skip to content

ci: dispatch autobump within a minute of a Ruby release - #85

Merged
jdx merged 3 commits into
mainfrom
claude/project-thread-u3tr26
Nov 28, 2026
Merged

jdx merged 3 commits into
mainfrom
claude/project-thread-u3tr26

Conversation

@jdx

@jdx jdx commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Before: new Ruby releases were picked up by the hourly autobump cron, but GitHub drops most of those runs. Since the hourly cron landed on Nov 23 it has fired about every 8 to 10 hours (e.g. Nov 27 05:00, 15:00, 23:25, Nov 28 07:41, 16:51 UTC), so a new Ruby could wait most of a day to start building.

After: a Cloudflare Worker (watcher/) checks ruby/ruby's releases every minute and dispatches autobump as soon as a release has no recipe, so the build starts within about a minute of the GitHub release. The hourly cron stays as the fallback.

No added GitHub Actions usage: the per-minute polling runs on Cloudflare, not Actions. The only Actions runs it starts are the autobump runs a new release needs anyway (plus a retry every few minutes if the tarball reaches cache.ruby-lang.org after the GitHub release). It doesn't add a workflow or a cron; CI only gains a few-second node --test step in the existing syntax job.

The worker picks missing versions with the same rules as autobump (newest stable per series from 3.2, prereleases of series with no stable yet), ported to JS and tested against the same cases as test/autobump_check_test.sh. It never stacks runs: it skips while any recent autobump run is queued or running, and waits a cooldown after the last run (3 minutes for a release under 2 hours old; 30 minutes up to a day; after that it leaves the release to the hourly cron and its failure email). Idle cost is two authenticated GitHub API calls a minute.

How: autobump gets a rubies_only dispatch input so the watcher's runs skip the bundled-gems job. The worker is scheduled-only (workers_dev: false), so there is no public URL that could spend the token.

Deploy (one time, not done by this PR): create a fine-grained token for jdx/ruby with Actions read/write and Contents read, then

cd watcher
npx wrangler deploy
npx wrangler secret put GITHUB_TOKEN

🤖 Generated with Claude Code


Note

Medium Risk
Touches the release automation path by dispatching autobump with a GitHub token and changing when bundled-gem updates run; behavior is gated by tests and cooldowns, but misconfiguration could spam dispatches or delay gem bumps.

Overview
Adds a Cloudflare Worker (watcher/) that runs every minute, compares ruby/ruby releases to recipes/rubies.yml, and dispatches the existing autobump workflow when a missing version would be added under the same rules as autobump (ported in versions.mjs, tested against autobump_check_test.sh). It avoids duplicate runs by honoring in-flight workflows, age-based cooldowns (3 min / 30 min / defer to hourly cron), and only posts rubies_only: true dispatches.

Autobump gains a workflow_dispatch rubies_only input so watcher-triggered runs skip the bundled-gems job; the hourly cron remains documented as fallback. CI’s syntax job runs node --test watcher/test/*.test.mjs, and .wrangler/ is gitignored for local Wrangler deploys.

Reviewed by Cursor Bugbot for commit 57b1029. Bugbot is set up for automated code reviews on this repo. Configure here.

GitHub fires the hourly autobump cron only every 8 to 10 hours, so new
Rubies waited that long to build. Add a Cloudflare Worker that checks
ruby/ruby's releases every minute and dispatches autobump (rubies only)
when a release has no recipe yet, with a cooldown so it never stacks runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a95a7913-1b6f-4435-bc99-506334a083d2
Commits

Reviewing files that changed from the base of the PR and between 9d92a52 and 57b1029.

Files selected for processing: 2

  • watcher/src/index.mjs
  • watcher/test/watcher.test.mjs

No actionable comments were generated in the recent review.

Walkthrough

A scheduled Cloudflare Worker checks Ruby releases against recipe versions and dispatches autobump for eligible missing versions. The workflow accepts a rubies_only input and skips the bundled-gems job when that input is true. Tests and deployment configuration are added.

Changes: Ruby release watcher

Layer / File(s) Summary
Version selection and recipe parsing
watcher/src/versions.mjs, watcher/test/watcher.test.mjs
The helpers select missing stable and prerelease versions for supported Ruby series and parse recipe version keys. Tests cover version selection, numeric patch comparison, and recipe parsing.
Scheduled checks and dispatch
watcher/src/index.mjs, watcher/test/watcher.test.mjs, watcher/README.md
The Worker checks releases, recipes, workflow status, and cooldowns before returning a status or dispatching autobump. Tests cover the outcomes, and the README documents the checks and cooldown periods.
Workflow wiring and deployment
.github/workflows/autobump.yml, watcher/wrangler.jsonc, .github/workflows/tests.yml, .gitignore, watcher/README.md
The workflow adds the rubies_only input and skips the bundled-gems job when it is true. Wrangler configures the scheduled Worker. CI runs its tests, .gitignore excludes .wrangler/, and the README documents deployment and test commands.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Worker as Cloudflare Worker
  participant GitHub as GitHub API
  Worker->>GitHub: Fetch releases, recipe file, and latest workflow run
  GitHub-->>Worker: Return release, recipe, and workflow data
  Worker->>Worker: Select missing versions and check eligibility
  Worker->>GitHub: Dispatch autobump.yml with rubies_only=true
Loading

Possibly related PRs

  • jdx/ruby#76: Adds the bundled-gems update step that this change gates for watcher-triggered runs.
  • jdx/ruby#79: Changes the autobump workflow structure that this change updates with the rubies_only condition.
Merge Risk: Minimal · previous review 9d92a

The watcher adds a scheduled dispatch of autobump after Ruby releases. No concrete merge-blocking risk was identified. Deployment remains a separate manual follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "ci: dispatch autobump within a minute of a Ruby release" matches the main change. The PR adds a scheduled Cloudflare Worker in watcher/ that checks Ruby releases every minute and dispatches…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "ci: dispatch autobump within a minute of a Ruby release" matches the main change. The PR adds a scheduled Cloudflare Worker in watcher/ that checks Ruby releases every minute and dispatches autobump.yml when a release has no recipe. The title is specific, concise, and uses a conventional commit prefix. It does not mention the rubies_only input or the cooldown logic, but those are supporting details.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 22665c64-f255-448e-a34f-734e20ed064e
Commits

Reviewing files that changed from the base of the PR and between bab2101 and 9d92a52.

Files selected for processing: 8

  • .github/workflows/autobump.yml
  • .github/workflows/tests.yml
  • .gitignore
  • watcher/README.md
  • watcher/src/index.mjs
  • watcher/src/versions.mjs
  • watcher/test/watcher.test.mjs
  • watcher/wrangler.jsonc

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issues remain.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues remain.

Summary

Adds a Cloudflare Worker that checks for missing Ruby recipes every minute and starts autobump.yml. The hourly schedule remains as a fallback.

  • A minute-by-minute watcher starts autobump for new Ruby releases.
  • The watcher picks Ruby versions that autobump would add.

No new actionable issues were found.

Reviews (3) · Last reviewed commit: "fix(watcher): send the dispatch body as ..." · Reviewed by Greptile

Comment thread watcher/src/index.mjs Resolved
@jdx jdx closed this Nov 28, 2026
@jdx jdx reopened this Nov 28, 2026
The newest run can be a queued run that concurrency cancelled while an
older run is still working, so look at the last 20 runs, not just one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f412d05. Configure here.

Comment thread watcher/src/index.mjs Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdx
jdx merged commit 2c3d16d into main Nov 28, 2026
12 checks passed
@jdx
jdx deleted the claude/project-thread-u3tr26 branch November 28, 2026 20:54
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.

2 participants