Skip to content

workflows/hetzner: expose machine_count and server_type as dispatch inputs#291

Merged
igorpecovnik merged 3 commits intomainfrom
hetzner-workflow-dispatch-inputs
Apr 24, 2026
Merged

workflows/hetzner: expose machine_count and server_type as dispatch inputs#291
igorpecovnik merged 3 commits intomainfrom
hetzner-workflow-dispatch-inputs

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

Summary

The Hetzner runner workflow advertised four knobs (MACHINE, MACHINE_COUNT, RUNNER_COUNT, PERIOD) in its original commit message but none were actually wired up — workflow_dispatch had no inputs: block, so ${{ env.MACHINE || 'cax41' }} and ${{ env.MACHINE_COUNT || '4' }} always evaluated to the default and the workflow name ("Enable 16 Hetzner ARM64 runners") was literally the only thing it could do.

First pass at making it configurable:

  • machine_count — choice of 1/2/4/8/16, default 4. Matrix generator now reads inputs.machine_count.
  • server_type — choice of cax41/cax31/cax21, default cax41. Create and Cleaning both pick it up. The action auto-falls back to a smaller type on capacity shortage, so this is "biggest you're willing to wait for".

|| '<default>' fallbacks are kept so repository_dispatch / REST API callers that omit inputs keep working as before.

Workflow renamed to drop the "16" — it's now variable.

Out of scope (follow-ups)

  • RUNNER_COUNT and PERIOD are still hardcoded; wiring those is a separate pass.
  • The "Hetzner VMs come up but runners don't register" issue we hit last run — needs an actual armbian-config / HETZNER_RUNNER token investigation; not a workflow-shape problem.

Test plan

  • Trigger via UI with all defaults → 4 × cax41 as before
  • Trigger via UI with machine_count=2, server_type=cax31 → 2 × cax31
  • Trigger via REST API without any inputs → falls back to 4 × cax41 (verifies the `|| ''` path)

…nputs

The workflow advertised four runtime knobs (MACHINE, MACHINE_COUNT,
RUNNER_COUNT, PERIOD) in its original commit message, but none were
wired up — workflow_dispatch had no `inputs:` block and there's no
top-level `env:`, so `${{ env.MACHINE || 'cax41' }}` and
`${{ env.MACHINE_COUNT || '4' }}` always evaluated to the default.
That made the workflow name ("Enable 16 Hetzner ARM64 runners")
literally true — it was the only thing you could trigger.

First pass at unfreezing it:

- machine_count: choice of 1/2/4/8/16 (default 4). The matrix
  generator now reads inputs.machine_count instead of env.MACHINE_COUNT.
- server_type: choice of cax41/cax31/cax21 (default cax41). Create +
  Cleaning both pick up inputs.server_type. The action auto-falls
  back to a smaller server type on capacity shortage regardless,
  so this is really "biggest you're willing to wait for".

`|| '<default>'` fallbacks are kept so repository_dispatch / API
callers that omit inputs still behave like the legacy call shape.

RUNNER_COUNT and PERIOD stay hardcoded for now; wiring those is a
follow-up.

Workflow renamed to drop the "16" — it's now variable.
@github-actions github-actions Bot added size/small PR with less then 50 lines 05 Milestone: Second quarter release GitHub Actions GitHub Actions code Needs review Seeking for review labels Apr 24, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

Warning

Rate limit exceeded

@igorpecovnik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 20 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 25 minutes and 20 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5c6fd792-26ba-4de5-8d35-443268871318

📥 Commits

Reviewing files that changed from the base of the PR and between 2c42287 and 9ffdd18.

📒 Files selected for processing (1)
  • .github/workflows/infrastructure-hetzner-runners.yml

Walkthrough

The workflow now accepts configurable inputs via manual dispatch: machine_count and server_type parameters with specified defaults and constrained option lists. The matrix generation step is updated to use the dispatch input machine_count (defaulting to 4) instead of a hardcoded environment variable. The Hetzner runner provisioning and cleanup steps are modified to derive server_type from the dispatch input instead of a static environment variable (defaulting to cax41). The workflow name is also updated to remove hardcoded "16" wording. Changes total +29/-4 lines across a single workflow file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: exposing machine_count and server_type as configurable dispatch inputs in the Hetzner workflow.
Description check ✅ Passed The description clearly explains the purpose of the changes, the inputs being added, backward compatibility measures, scope limitations, and a test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hetzner-workflow-dispatch-inputs

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@igorpecovnik igorpecovnik merged commit d2ab32a into main Apr 24, 2026
5 checks passed
@igorpecovnik igorpecovnik deleted the hetzner-workflow-dispatch-inputs branch April 24, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release GitHub Actions GitHub Actions code Needs review Seeking for review size/small PR with less then 50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant