feat(runners): setup-runner.sh — idempotent GH Actions runner registration - #1614
POWERFULMOVES wants to merge 4 commits into
Conversation
…er registration Closes the #1463 residual: bootstrap-node.sh previously printed manual gh api instructions for runner registration, leaving every node hand-rolled and subject to label drift and restart loops. setup-runner.sh implements three-case idempotency: 1. online → skip (no-op) 2. offline/drifted → delete stale GH entry + rm container + re-register 3. missing → fresh register Auth cascade: GITHUB_PAT → GH_TOKEN → GITHUB_TOKEN → gh api registration token. RUNNER_ALLOW_RUNNER_REUSE=true always injected (matches local_cert_runners.py:317). Label mapping matches existing three-lane definitions in local_cert_runners.py. check() pattern compatible with verify-claw.sh output format. bootstrap-node.sh gains --with-runner, --runner-lane, --runner-repo flags triggering step 3.5 after gh CLI install (step 3), before Glances (step 4). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- bootstrap-node.sh: handle exit 2 from setup-runner.sh gracefully; set -euo pipefail would abort bootstrap on drift remediation - setup-runner.sh: fix gh api --paginate + jq interaction; pipe pages through jq -sc slurp instead of mixing --paginate with --jq filter - setup-runner.sh: guard docker version fetch behind $DRY_RUN check; ssh_or_dry skips SSH in dry-run but raw ssh call would still execute Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 2 minutes and 52 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51b10aafbe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "$SCRIPT_DIR/setup-runner.sh" \ | ||
| --target "$TARGET" \ | ||
| --repo "$RUNNER_REPO" \ | ||
| --lane "$RUNNER_LANE" || { |
There was a problem hiding this comment.
Mark setup-runner.sh executable or invoke via bash
This call executes setup-runner.sh directly, but the new file is committed with mode 100644 in this commit, so it lacks the executable bit. In the --with-runner path, bootstrap will fail with a permission error before registration runs unless users manually chmod +x the script or invoke it through bash.
Useful? React with 👍 / 👎.
| REG_TOKEN=$(gh api --method POST "repos/${REPO}/actions/runners/registration-token" \ | ||
| --jq '.token' 2>/dev/null || true) | ||
|
|
||
| if [[ -z "$REG_TOKEN" ]]; then | ||
| check "Registration token" "fail" "gh api call failed — check REPO and gh auth scopes" |
There was a problem hiding this comment.
Skip registration-token API call when PAT mode is selected
The script always requests a GitHub registration token and exits on failure, even when a PAT was already chosen for ACCESS_TOKEN. In environments where local gh auth can list runners but cannot create registration tokens, this causes a hard failure despite PAT-based container registration being otherwise viable, so valid PAT setups can fail unnecessarily.
Useful? React with 👍 / 👎.
|
All commits already merged into main via PR #1587. Branch is empty — closing as superseded. |
Summary
setup-runner.sh: idempotent self-hosted GitHub Actions runner registration scriptTest plan
setup-runner.shregisters a new runner without error on a fresh nodeps aux)🤖 Generated with Claude Code