Skip to content

feat: register org-level GitHub Actions runners - #71

Merged
Peyton-Spencer merged 1 commit into
mainfrom
feat/org-level-runners
Jun 18, 2026
Merged

feat: register org-level GitHub Actions runners#71
Peyton-Spencer merged 1 commit into
mainfrom
feat/org-level-runners

Conversation

@Peyton-Spencer

Copy link
Copy Markdown
Contributor

Summary

  • Add RunnerScope (.repo | .org) and a scope-aware RunnerTarget value type
  • Plumb scope through GHCLIService, RunnerInstaller, RunnerManager, the GUI (AddRunnerView, MenuBarView), and CLI (mac-runner add ... --org)
  • Backward compatible: existing configs decode with scope = .repo

What changes

Model (Sources/Models/Runner.swift)

  • New RunnerScope enum and RunnerTarget struct (encapsulates apiPath, registrationURL, displayName)
  • Runner gains var scope: RunnerScope (default .repo) and a target computed property

GitHub CLI service (Sources/Services/GHCLIService.swift)

  • Target-based overloads for getRegistrationToken, listRemoteRunners, deleteRunner
  • New validateTarget(_:) — routes to repos/{owner}/{repo} or orgs/{org}
  • Legacy repo: String overloads preserved for backward compatibility

Runner lifecycle (Sources/Services/RunnerInstaller.swift, RunnerManager.swift)

  • setupRunner / configureRunner take a RunnerTarget so config.sh --url gets the right URL (https://github.com/{org} or https://github.com/{owner}/{repo})
  • addRunner / addRunners / duplicateRunner accept and persist the scope
  • updateRunnerStatuses groups by target (not raw repo string) so an org runner and a same-prefix repo runner don't collide
  • Active-job polling stays repo-only — workflow runs are repo-scoped in GitHub's API, so org runners skip that step instead of firing 404s

GUI (Sources/Views/AddRunnerView.swift, MenuBarView.swift)

  • New segmented "Target Type" picker (Repository / Organization) in the Add sheet
  • Browse dropdown shows orgs when org scope is selected (uses existing listOrgs())
  • Menubar list groups by target — org groups use the building.2 icon

CLI (Sources/Services/CLIHandler.swift)

  • mac-runner add <org> --org registers an org-level runner
  • Identifier shape is validated against the chosen scope before any network calls
  • list output labels org targets as acme (org); column renamed REPOTARGET

Backward compatibility

  • scope decodes with a .repo fallback (decodeIfPresent ?? .repo) — pre-existing config files load unchanged
  • All previous public function signatures still work (new ones are additional overloads)
  • Test added for legacy decoding (testRunnerDecodingDefaultsScopeToRepoForLegacyConfigs)

Test plan

  • Added RunnerModelTests coverage for scope encoding/decoding, target derivation, and legacy fallback
  • Manual: register a repo runner via GUI — confirm it still picks up repo-scoped jobs
  • Manual: register an org runner via GUI with an org you admin — confirm config.sh uses https://github.com/{org} and the runner appears at https://github.com/organizations/{org}/settings/actions/runners
  • Manual: mac-runner add my-org --org from the CLI
  • Manual: mac-runner list shows acme (org) for org runners

🤖 Generated with Claude Code

Add a RunnerScope (.repo | .org) and a scope-aware RunnerTarget value
type, then thread them through every layer that talks to GitHub:

* GHCLIService gets target-based overloads for getRegistrationToken,
  listRemoteRunners, deleteRunner, and a new validateTarget(_:) that
  routes to `repos/{owner}/{repo}` or `orgs/{org}` based on scope.
* RunnerInstaller / RunnerManager pass the target through to config.sh
  so the runner registers at https://github.com/{org} for org scope and
  https://github.com/{owner}/{repo} for repo scope.
* AddRunnerView gets a segmented Repository / Organization picker and
  a corresponding Browse dropdown backed by listOrgs().
* CLIHandler accepts `--org` (and `--repo` for symmetry) on `add`,
  validates the identifier shape against the chosen scope, and labels
  org targets in `list` output.
* MenuBarView groups by RunnerTarget so a repo and org with the same
  prefix don't collide, and uses a building icon for org groups.

The `scope` field decodes with a `.repo` fallback so configs written
by previous versions load unchanged.

Active-job polling (currentJob / completedJob) stays repo-only — the
GitHub API exposes workflow runs per repository, so org runners simply
skip that step rather than firing 404s.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Peyton-Spencer, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 12 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8bc37344-d214-4196-a2fd-ce3c6e744469

📥 Commits

Reviewing files that changed from the base of the PR and between 2b44e5d and 20ca577.

📒 Files selected for processing (8)
  • Sources/Models/Runner.swift
  • Sources/Services/CLIHandler.swift
  • Sources/Services/GHCLIService.swift
  • Sources/Services/RunnerInstaller.swift
  • Sources/Services/RunnerManager.swift
  • Sources/Views/AddRunnerView.swift
  • Sources/Views/MenuBarView.swift
  • Tests/MacRunnerTests/RunnerModelTests.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/org-level-runners

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.

@Peyton-Spencer
Peyton-Spencer merged commit d7a2458 into main Jun 18, 2026
2 checks passed
@Peyton-Spencer
Peyton-Spencer deleted the feat/org-level-runners branch June 18, 2026 17:41
github-actions Bot pushed a commit that referenced this pull request Jun 18, 2026
# [1.17.0](v1.16.0...v1.17.0) (2026-06-18)

### Features

* register org-level GitHub Actions runners ([#71](#71)) ([d7a2458](d7a2458))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant