Auto-skip dependency installation for production_platform repos#1474
Open
DudeRandom21 wants to merge 1 commit intomainfrom
Open
Auto-skip dependency installation for production_platform repos#1474DudeRandom21 wants to merge 1 commit intomainfrom
DudeRandom21 wants to merge 1 commit intomainfrom
Conversation
When a repo has production_platform configured and all explicitly configured deploy/rollback/task steps match a known-safe command allowlist (production-platform-next, kubernetes-deploy, kubernetes-restart), skip dependency installation automatically. This unblocks Ruby version upgrades for repos that deploy via production-platform-next, where bundle install fails due to gem incompatibilities with the new Ruby version on the shipit worker, even though those deps are never actually needed for the deploy. Refs Shopify/continuous-deployment#2454 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8ecf9b0 to
09dfd4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
production_platformconfigured in its shipit.yml and all explicitly configured deploy/rollback/task steps match a known-safe command allowlist (production-platform-next,kubernetes-deploy,kubernetes-restart), skip dependency installation automaticallydependencies.overrideconfig is always respected — this only affects auto-discoveryRefs Shopify/continuous-deployment#2454
Motivation
Repos deploying via
production-platform-nextdon't need local Ruby/Node dependencies installed on the shipit worker — the app runs in pre-built Docker containers. But shipit's auto-discovery detectsGemfile/package.jsonand runsbundle installanyway. When the worker's Ruby version doesn't match the repo's required version, the install fails and blocks deploys entirely, preventing Ruby version upgrades.Design decisions
deploy.override,deploy.pre/post,rollback.override,rollback.pre/post, andtasksfrom config. Auto-discovered steps (e.g., fromKubernetesDiscovery) are not inspected — if no overrides exist, we conservatively install deps.[].all?vacuous truth).Future consideration: extending to auto-discovered steps
Currently this only triggers for repos with
production_platformconfig AND explicit step overrides. There's an opportunity to also skip deps for repos that rely on auto-discovered steps fromKubernetesDiscovery(which produceskubernetes-deployandkubernetes-restartcommands — both already on the safe allowlist). This would cover repos with akubernetesconfig key but noproduction_platformkey.More broadly, several auto-discovery modules are for non-Ruby platforms (PyPI/Python, npm/yarn for package publishing, Lerna) — repos that trigger these are unlikely to have meaningful Ruby dependencies to install in the first place. Since the motivation for this change is unblocking Ruby version upgrades (where
bundle installfails due to gem incompatibilities with the new version), these non-Ruby stacks are lower priority — they're unlikely to hit the version mismatch problem even without this change. That said, skipping unnecessary installs for them would still be a correctness improvement worth considering in a follow-up.Test plan
dependencies.override→ respected regardless🤖 Generated with Claude Code