Skip to content

Migrate pipeline from CircleCI to GitHub Actions - #140

Merged
phelma merged 1 commit into
mainfrom
gha-migration
Jul 22, 2026
Merged

Migrate pipeline from CircleCI to GitHub Actions#140
phelma merged 1 commit into
mainfrom
gha-migration

Conversation

@phelma

@phelma phelma commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Part of PP-709.

Cutover to GitHub Actions per the Variant A family plan (gem pilot).
Includes decommission — merging this PR completes the repo's migration.

  • main + pr workflows: check/test, prerelease, release environment gate
  • PR CI publishes a namespaced pre-release to RubyGems (see below)
  • git-crypt unlock on the runner; encrypted CI GPG key moved to .github/
  • Slack notifications via rake_slack; dependabot auto-merge job
  • Rakefile provisioning swapped to rake_github secrets/environments; rake_circle_ci dropped
  • CircleCI pipeline removed: .circleci/, scripts/ci/, the CI SSH deploy
    key pair and its keys:deploy/deploy_keys provisioning, and the stored
    CircleCI/GitHub API credentials (config/secrets/{circle_ci,github}/)

Deliberate decisions (not defects)

This cutover reproduces the CircleCI pipeline's behaviour, warts included;
fixing inherited hazards is post-migration work. In particular:

  • ./go release publishes to RubyGems before the version-bump commit is
    pushed — pre-existing ordering inside the untouched release logic.
  • Prerelease publishes on every push to main with no approval gate; only
    full releases are gated (environment: release).
  • Dependabot auto-merge accepts any update type that passes checks, and the
    merge does not trigger a release build — on CircleCI the merge commit
    carried [skip ci], so this matches. Updates ship with the next
    human-triggered release.
  • The release job pulls main at approval time, so a delayed approval
    publishes main as it stands then, not the SHA this run tested — parity with
    the old release.sh (which also pulled; prerelease.sh did not, so the
    prerelease job has no pull).
  • asdf_install@v1 is our own action (infrablocks/github-actions); we are
    happy tracking its major version tag.
  • Job scaffolding is repeated flat per job by design: the logic lives in the
    build system (./go/rake) and CI stays lean — it just triggers tasks and
    supplies secrets/context.
  • Gemfile.lock carries transitive major bumps — the unavoidable resolution
    of the targeted bundle lock --update, not scope creep.
  • Small library hunks may appear where the refreshed toolchain's rubocop
    autocorrects existing code (e.g. Style/ArgumentsForwarding) — required
    by the library:check verification gate, not drive-by refactoring.
  • Provisioning (pipeline:prepare) authenticates with the operator's ambient
    gh login (GITHUB_TOKEN fallback) instead of a stored PAT — a deliberate
    parity deviation; the stored token in config/secrets/github/config.yaml
    is deleted with the rest of the CircleCI-era credentials.

PR-CI prerelease publish (deliberate, permanent)

pr.yaml has a prerelease job that publishes a namespaced pre-release of
this gem to RubyGems from the PR branch — a permanent CI feature, not
migration-only. This is a deliberate deviation from CircleCI (which published
nothing pre-merge): it proves the publish path before merge instead of
discovering it broken on main. The version is
<committed-version>.pr<PR>.<run>.<attempt> (via the new prerelease:publish
Rakefile task), so it can never collide with main's version:bump[pre]
sequence; the task builds the gem and pushes it straight to RubyGems, then
restores version.rb, so nothing is committed, tagged, or pushed
(gem release is not used — it aborts on the uncommitted version rewrite).
The job is skipped for fork
and Dependabot PRs (they hold no secrets), and merge-pull-request does not
depend on it. PR pre-release versions accumulate permanently on RubyGems —
accepted.

Do not merge manually — the pipeline merges once checks are green.
Disabling the CircleCI project and deleting the CircleCI deploy key are
deferred to the end-of-migration sweep.


🏭 This PR was opened by Foundry, Atomic's AI software development
factory. Implementation, review, and fixes are performed by AI agents;
merges happen automatically once the review and checks gates pass.
This task migrates a Ruby gem's CI from CircleCI to GitHub Actions.

Pipeline Task pack Family Run
migrate migrate-gem gem 2026-07-22T17-48-59-192Z

atomic-foundry-pr · foundry-pipeline: migrate · foundry-task: migrate-gem · foundry-run: 2026-07-22T17-48-59-192Z

@phelma phelma left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: #140 - Migrate pipeline from CircleCI to GitHub Actions

Verdict: COMMENT

This CircleCI→GitHub Actions cutover conforms tightly to the Variant A family plan §4. Across correctness, security, safety, standards, and code-quality lenses no critical, major, or minor defects were found: the workflows, Rakefile blocks, gemspec, README, GPG-key move, and CircleCI decommission all match the prescribed shapes, and the release job is correctly parameterised to the repo's deleted release.sh (version:bump[minor], no documentation:update). Only two non-blocking observations remain, one of which is against plan-prescribed code.

Cross-Cutting Themes

  • Correct release-job parameterisation (flagged by: correctness, safety, standards) — three lenses independently confirmed the release job mirrors the deleted release.sh (minor bump, git pull, no docs step). No documentation:update task exists in the Rakefile, so the common failure mode of copying the template's docs step verbatim was correctly avoided.

Strengths

  • ✅ No workflow injection: all attacker-influenced PR data (title, number, URL, head SHA) is bound via env: and referenced as shell variables, never interpolated into run:. The only ${{ }} in a run: is job.status.
  • ✅ Least-privilege tokens: top-level contents: read, elevated per-job only where needed.
  • ✅ Correct trust boundary: the secret-bearing PR prerelease job is guarded to same-repo human PRs, and merge-pull-request does not needs: it.
  • --match-head-commit "$HEAD_SHA" preserves merge integrity.
  • ✅ Rakefile guards fail fast on a locked clone (missing passphrase / git-crypt ciphertext sentinel) rather than uploading garbage secrets.
  • prerelease:publish wraps the temporary version.rb rewrite in begin/ensure, restoring the file and removing the built gem even on failure.
  • ✅ Decommission is complete and clean: no circleci references remain outside docs//Gemfile.lock; only the two portable scripts/ci/common scripts are retained; config/secrets/ci keeps only the git-crypt material.

General Findings

  • 🔵 code-quality (plan concern): prerelease:publish uses the replacement-string form source.sub(version_pattern, "\\1#{version}\\3"), which couples correctness to backslash-escape semantics of the interpolated version. Safe today (numeric facts only). This is the plan's verbatim §4.4 step 8 code, so it is a plan concern, not a diff defect.
  • 🔵 correctness (false positive): the check/test jobs use ./go test:unit while the deleted test.sh invoked ./go spec. Verified benign — test:unit is the existing RSpec task and the family-canonical name; no spec task exists. Counted nowhere.

Review generated by /accelerator:review-pr

Comment thread .rubocop.yml
- context
- shared_examples
- it
- define_repository_tasks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Standards (suggestion)

This adds define_repository_tasks to Metrics/BlockLength's AllowedMethods to accommodate the now-larger RakeGithub.define_repository_tasks block (the token-resolution and passphrase-guard logic). The family plan §4 prescribes exact file shapes and includes no .rubocop.yml change; §4.4 only asks that the Rakefile stay clean against the 80-char rule. If this relaxation is genuinely required to pass library:check, it is reasonable — but note it in the PR description as a deliberate deviation so future maintainers can trace it, since it permanently relaxes a lint rule for the repo.

@phelma
phelma marked this pull request as ready for review July 22, 2026 21:38
@phelma
phelma merged commit 541a043 into main Jul 22, 2026
5 of 6 checks passed
@phelma
phelma deleted the gha-migration branch July 22, 2026 21:38
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