Auto-skip dependency installation for production_platform repos#1474
Auto-skip dependency installation for production_platform repos#1474DudeRandom21 wants to merge 1 commit intomainfrom
Conversation
8ecf9b0 to
09dfd4c
Compare
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>
09dfd4c to
fcdac79
Compare
| kubernetes-deploy | ||
| kubernetes-restart |
There was a problem hiding this comment.
Oof, is anything still actually using kubernetes-deploy or kubernetes-restart? That's pretty ancient code. That same tool has been renamed to krane, fwiw (repo for ref)
There was a problem hiding this comment.
Good catch. No nothing seems to be using it anymore. It got picked up because it still exists here https://github.com/Shopify/shipit-engine/blob/main/app/models/shipit/deploy_spec/kubernetes_discovery.rb
If the tool was renamed do you think it's worth fixing the auto discovery then?
timothysmith0609
left a comment
There was a problem hiding this comment.
I don't think it's appropriate to encode this logic here in the OSS gem code: can we move this to our internal shipit?
I wasn't sure how I would do this purely in the internal layer but I'll dig into it and likely close this PR. Thanks |
|
Moving this logic entirely to the shipit app — production_platform is a shipit-internal concept, not an engine concern. The skip-dependencies behavior will be implemented via a prepended module in the app, matching the existing pattern for production platform discovery. |
Summary
production_platformconfigured in its shipit.yml and all explicitly configured deploy/rollback/task steps match a configurable safe-command allowlist, skip dependency installation automaticallyShipit.safe_deploy_command_prefixes(defaults to empty — feature is opt-in per instance)dependencies.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
Shipit.safe_deploy_command_prefixes, defaulting to an empty array (feature disabled). Each shipit deployment sets its own prefixes in an initializer.deploy.override,deploy.pre/post,rollback.override,rollback.pre/post, andtasksfrom config. Auto-discovered steps are not inspected — if no overrides exist, we conservatively install deps.[].all?vacuous truth).Configuration
In your shipit instance's initializer:
Test plan
dependencies.override→ respected regardless🤖 Generated with Claude Code