Optimize CI: use pre-built base image and parallelize steps #70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/optimize-pipeline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ruby:3.4.9-slimto the platform'sruby-rails-buildimage, eliminatingapt-get,gem install bundler, and native extension compilation on every rundepends_on: [clone]so lint and test run in parallel instead of sequentiallyBUNDLE_DEPLOYMENTandBUNDLE_WITHOUTenv vars since the base image defaults to production bundle settingsCloses #69
Changes
.woodpecker.yaml: Replace step images, remove package installation commands, add parallel execution, add bundle env overridesTest Plan
Review Checklist
Related Notes
ldraney/landscaping-assistant #69— CI optimization feature issuelandscaping-assistant— projectldraney/base-images— source of the ruby-rails-build imagePR #70 Review
DOMAIN REVIEW
Tech stack: Woodpecker CI pipeline configuration (YAML), referencing a Ruby/Rails project with RSpec, RuboCop, Postgres, and Kaniko-based container builds.
Image reference: Both lint and test steps correctly use
harbor.harbor.svc.cluster.local/library/ruby-rails-build:latest, which is the k8s-internal DNS for Harbor. This is consistent with the build-and-push step'sregistrysetting on the same hostname. The Dockerfile separately uses the Tailscale hostname (harbor.tail5b443a.ts.net) which is appropriate for its build context.BUNDLE_DEPLOYMENT / BUNDLE_WITHOUT overrides: The base image is built for production and sets
BUNDLE_DEPLOYMENT=trueandBUNDLE_WITHOUT=development:test. Overriding both to empty strings in CI is correct -- CI needs dev/test gems (rubocop, rspec, capybara, debug, brakeman, bundler-audit). Without these overrides,bundle installwould skip the test/development groups and rubocop/rspec would be missing. Good catch.Parallel execution: Adding
depends_on: [clone]to both lint and test means they fan out after clone completes and run concurrently. The build-and-push step already hasdepends_on: [lint, test], so it correctly gates on both completing. The DAG is sound: clone -> (lint | test) -> build-and-push.Removed apt-get / gem install: The base image (
ruby-rails-build) includes build-essential, libpq-dev, libyaml-dev, git, and bundler. Removing these install commands from CI is the entire point of the pre-built image strategy. No dependencies are missing.:latesttag risk: Both steps pin to:latest. This is a minor concern -- a breaking change to the base image would silently affect CI. However, sinceldraney/base-imagesis also under your control and the Dockerfile already uses:latestfor the same image, this is a consistent policy choice, not an oversight. Noted as a nit below.Postgres service container: The database service is unchanged and correct. The test step's
DATABASE_URLpoints to it properly.BLOCKERS
None.
This PR modifies CI configuration only -- no application code, no new functionality requiring tests, no user input handling, no secrets in code, no auth logic. None of the BLOCKER criteria apply.
NITS
:latesttag on CI images -- Consider pinning to a SHA digest or semver tag (e.g.,ruby-rails-build:3.4.9-1) to make CI reproducible. A bad push tobase-imageswould break CI silently with:latest. This is a platform-wide decision, not specific to this PR.DRY opportunity -- The
BUNDLE_DEPLOYMENT: ""andBUNDLE_WITHOUT: ""environment block is duplicated across lint and test. Woodpecker supports top-levelenvironmentor YAML anchors to deduplicate. Low priority since there are only two steps.SOP COMPLIANCE
ci/optimize-pipeline-- does not follow{issue-number}-{kebab-case-purpose}convention (would be69-optimize-ci-pipeline). This is a minor deviation. The branch uses aci/prefix convention instead.from_secret, no plaintext secretsPROCESS OBSERVATIONS
This change directly improves DORA lead time by eliminating ~30-60s of apt-get and gem install per CI step and running lint/test in parallel instead of sequentially. Net effect: CI wall-clock time should roughly halve for the lint+test phase. The pre-built image strategy centralizes dependency management in
base-images, which is the right architectural call -- dependency drift between CI and production is a common source of change failure.The branch naming deviation (
ci/optimize-pipelinevs69-optimize-ci-pipeline) is worth noting for process consistency but is not blocking.VERDICT: APPROVED