Skip to content

ci: Make Linux CI runners configurable and split macOS legs into disable-able workflows. - #2445

Open
jackluo923 wants to merge 2 commits into
mainfrom
ci-configurable-runners
Open

ci: Make Linux CI runners configurable and split macOS legs into disable-able workflows.#2445
jackluo923 wants to merge 2 commits into
mainfrom
ci-configurable-runners

Conversation

@jackluo923

@jackluo923 jackluo923 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Description

Replaces the hard-coded github.repository_owner == 'y-scope' runner selector with four repository variables GH_RUNNER_LINUX_[HEAVY|LIGHT]_[X64|ARM64], so any repo with self-hosted capacity can opt in without forking the workflows. Unset variables fall back to the previous GitHub-hosted runners, so behavior is unchanged for forks and for upstream before configuration.

  • The four macOS+Linux matrix workflows (clp-uv-checks, clp-lint, clp-docs, clp-s-generated-code-checks) are split into Linux-only originals plus new *-macos.yaml siblings, each gated by if: vars.GH_DISABLE_MACOS != 'true' (opt-out: unset = macOS runs). clp-core-build-macos gets the same gate.
  • package-image is split into package-image-amd64 + package-image-arm64 (arm64 main-only); package-image-multiarch-manifest still gates the release tag on both arches.

Status: WIP — opened as draft while the upstream run validates self-hosted routing.

Checklist

Validation performed

  • yamllint clean on all affected workflow files; actionlint reports no new findings (only pre-existing SC2046 warnings on the chown runner-images workaround step).
  • CI on the branch: 27/30 workflow runs green at open; clp-artifact-build and clp-core-build-macos still running — to be confirmed once complete.

Summary by CodeRabbit

  • New Features

    • Added macOS automation for documentation builds, linting, generated-code validation, and dependency-lock checks.
    • Added multi-architecture package image builds and manifest publishing for amd64 and arm64.
  • Improvements

    • CI jobs now support configurable Linux runners with sensible defaults.
    • Added options to disable macOS workflows when needed.
    • Improved architecture-specific container build handling and dependency selection.

…-able workflows

Replace hard-coded self-hosted runner selectors with 4 repo vars GH_RUNNER_LINUX_[HEAVY|LIGHT]_[X64|ARM64]. Every Linux runs-on is `fromJSON(vars.X || '["<github-hosted>"]')`, so unset vars (upstream before config, or any fork) fall back to GitHub-hosted unchanged; no more repository_owner special-casing. The vars are named GH_RUNNER_LINUX_* (the LINUX segment scopes them to Linux legs; macOS is never overridden) and the HEAVY values include a "docker" label so artifact-build routes to the DinD-capable runners.

The 4 macOS+Linux matrix workflows (clp-uv-checks, clp-lint, clp-docs, clp-s-generated-code-checks) are split into Linux-only originals plus new *-macos.yaml siblings, each gated by `if: vars.GH_DISABLE_MACOS != 'true'` so a fork without macOS capacity can skip every macOS job via one repo var (job-level if can't see the matrix context, hence the split). clp-core-build-macos gets the same gate. A skipped required check counts as success for branch protection; the var is opt-out (unset = macOS runs, so upstream and forks are unaffected).

package-image is split into package-image-amd64 + package-image-arm64 (arm64 main-only via a plain if:); each depends only on its own arch's deps image (the old single matrix needed both), and package-image-multiarch-manifest still gates the release tag on both arches.

Categorization by core-benefit: HEAVY_X64 = artifact-build x86 + clp-docs-generated-code-checks (release Rust codegen); HEAVY_ARM64 = package-image-arm64; LIGHT_X64 = lint/docs/s-gen/uv-checks/helm/pr-title/rust-checks; LIGHT_ARM64 = arm64 deps-images (network-bound). rust-checks stays on LIGHT_X64 because tests:rust-all starts LocalStack on 127.0.0.1, broken on self-hosted runners.

Validated: yamllint clean; actionlint only the pre-existing SC2046 chown warnings on the runner-images#6775 workaround step.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2789b7f7-7a71-430a-8009-d50ab21e6e26

📥 Commits

Reviewing files that changed from the base of the PR and between 27dad11 and dbe5341.

📒 Files selected for processing (4)
  • .github/workflows/clp-docs-macos.yaml
  • .github/workflows/clp-lint-macos.yaml
  • .github/workflows/clp-s-generated-code-checks-macos.yaml
  • .github/workflows/clp-uv-checks-macos.yaml

Walkthrough

The pull request configures GitHub Actions runner selection, separates amd64 and arm64 artifact packaging, and adds macOS workflows for documentation, linting, generated-code checks, and uv validation.

Changes

Artifact build architecture flow

Layer / File(s) Summary
Artifact build runner configuration
.github/workflows/clp-artifact-build.yaml
Artifact build jobs and dependency-image matrices use configurable heavy x64 and light arm64 runners.
Architecture-specific package images
.github/workflows/clp-artifact-build.yaml
The package matrix is replaced by separate amd64 and arm64 jobs. A manifest job waits for both jobs before publishing the multi-architecture manifest.

Linux and macOS workflow execution

Layer / File(s) Summary
Linux workflow runner consolidation
.github/workflows/clp-docs-generated-code-checks.yaml, .github/workflows/clp-docs.yaml, .github/workflows/clp-lint.yaml, .github/workflows/clp-package-helm.yaml, .github/workflows/clp-pr-title-checks.yaml, .github/workflows/clp-rust-checks.yaml, .github/workflows/clp-s-generated-code-checks.yaml, .github/workflows/clp-uv-checks.yaml
Linux jobs now use configurable runners with Ubuntu fallbacks. The Linux lint workflow keeps only the Ubuntu MariaDB setup path.
macOS validation workflows
.github/workflows/clp-core-build-macos.yaml, .github/workflows/clp-docs-macos.yaml, .github/workflows/clp-lint-macos.yaml, .github/workflows/clp-s-generated-code-checks-macos.yaml, .github/workflows/clp-uv-checks-macos.yaml
macOS workflows conditionally build documentation, run lint tasks, validate generated CLP-S files, and check uv lock files.

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

Sequence Diagram(s)

sequenceDiagram
  participant DependencyImageJobs
  participant PackageImageAmd64
  participant PackageImageArm64
  participant MultiArchManifest
  DependencyImageJobs->>PackageImageAmd64: provide amd64 dependency image
  DependencyImageJobs->>PackageImageArm64: provide arm64 dependency image
  PackageImageAmd64->>MultiArchManifest: complete amd64 package image
  PackageImageArm64->>MultiArchManifest: complete arm64 package image
  MultiArchManifest->>MultiArchManifest: publish multi-architecture manifest
Loading

Possibly related PRs

  • y-scope/clp#2357: Both changes modify artifact build architecture handling.
  • y-scope/clp#2407: Both changes modify package jobs and the multi-architecture manifest flow.

Suggested reviewers: kirkrodrigues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the configurable Linux runners and separately managed macOS workflows, which are the main changes in the pull request.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci-configurable-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.

@jackluo923
jackluo923 marked this pull request as ready for review August 1, 2026 22:43
@jackluo923
jackluo923 requested a review from a team as a code owner August 1, 2026 22:43

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/clp-artifact-build.yaml:
- Around line 785-787: Update the conditions controlling package-image-arm64 and
package-image-multiarch-manifest so successful, non-cancelled release-tag refs
(refs/tags/<release>) are permitted alongside the existing main-branch path;
apply this change at both .github/workflows/clp-artifact-build.yaml lines
785-787 and 830-834, preserving the existing exclusions for cancelled or failed
runs.
- Around line 752-780: The package-image-amd64 job currently exposes
GITHUB_TOKEN to the pull-request-controlled clp-build-runtime-image action.
Remove the image_registry_username and image_registry_password inputs from this
PR job, configure its permissions as read-only, and retain registry credentials
only in the trusted main-only publish job while preserving the runtime image
build behavior.

In @.github/workflows/clp-docs-macos.yaml:
- Around line 16-25: Restrict the documentation workflow permissions to
contents: read and update the actions/checkout step to set persist-credentials
to false. Apply these changes to the workflow containing the build-macos job,
preserving its existing LFS and recursive submodule settings.

In @.github/workflows/clp-lint-macos.yaml:
- Around line 22-24: Add top-level permissions restricting contents to read in
.github/workflows/clp-lint-macos.yaml,
.github/workflows/clp-s-generated-code-checks-macos.yaml, and
.github/workflows/clp-uv-checks-macos.yaml; in each workflow’s checkout step,
set persist-credentials to false while preserving recursive submodule checkout.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f20dfe61-dd22-4b0a-8ded-1efed1f0c46a

📥 Commits

Reviewing files that changed from the base of the PR and between 155fbda and d12530e.

📒 Files selected for processing (14)
  • .github/workflows/clp-artifact-build.yaml
  • .github/workflows/clp-core-build-macos.yaml
  • .github/workflows/clp-docs-generated-code-checks.yaml
  • .github/workflows/clp-docs-macos.yaml
  • .github/workflows/clp-docs.yaml
  • .github/workflows/clp-lint-macos.yaml
  • .github/workflows/clp-lint.yaml
  • .github/workflows/clp-package-helm.yaml
  • .github/workflows/clp-pr-title-checks.yaml
  • .github/workflows/clp-rust-checks.yaml
  • .github/workflows/clp-s-generated-code-checks-macos.yaml
  • .github/workflows/clp-s-generated-code-checks.yaml
  • .github/workflows/clp-uv-checks-macos.yaml
  • .github/workflows/clp-uv-checks.yaml

Comment thread .github/workflows/clp-artifact-build.yaml
Comment thread .github/workflows/clp-artifact-build.yaml
Comment thread .github/workflows/clp-docs-macos.yaml
Comment thread .github/workflows/clp-lint-macos.yaml
@jackluo923 jackluo923 changed the title ci: Make Linux CI runners configurable; split macOS legs into disable-able workflows ci: Make Linux CI runners configurable and split macOS legs into disable-able workflows. Aug 2, 2026
…flows.

Applies the repository's existing hardening idiom to the four macOS workflows added by this branch: a workflow-level `permissions: {}` deny-all, a job-level `contents: "read"` grant for checkout, and `persist-credentials: false` so the token is not left in `.git/config` for subsequent steps.
@jackluo923
jackluo923 force-pushed the ci-configurable-runners branch from 27dad11 to dbe5341 Compare August 3, 2026 00:25
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.

1 participant