From c5dbd43391d833fb049e6a547c02d713a2081c1e Mon Sep 17 00:00:00 2001 From: Gord Pearson Date: Wed, 1 Feb 2017 12:03:48 -0500 Subject: [PATCH] Yarn deployments should not hang `yarn publish` [has an unskippable user input prompt](https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/publish.js#L136), so always use `npm publish` for JS projects. --- app/models/shipit/deploy_spec/npm_discovery.rb | 3 ++- test/unit/deploy_spec_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/shipit/deploy_spec/npm_discovery.rb b/app/models/shipit/deploy_spec/npm_discovery.rb index ec32956b9..f97a46eff 100644 --- a/app/models/shipit/deploy_spec/npm_discovery.rb +++ b/app/models/shipit/deploy_spec/npm_discovery.rb @@ -62,7 +62,8 @@ def discover_deploy_steps def publish_npm_package check_tags = 'assert-npm-version-tag' - publish = js_command('publish') + # `yarn publish` requires user input, so always use npm. + publish = 'npm publish' [check_tags, publish] end diff --git a/test/unit/deploy_spec_test.rb b/test/unit/deploy_spec_test.rb index bb746a5a9..738915940 100644 --- a/test/unit/deploy_spec_test.rb +++ b/test/unit/deploy_spec_test.rb @@ -495,9 +495,9 @@ class DeploySpecTest < ActiveSupport::TestCase assert_equal ['yarn install --no-progress'], @spec.dependencies_steps end - test '#publish_yarn_package checks if version tag exists, and then invokes yarn publish script' do + test '#publish_yarn_package checks if version tag exists, and then invokes npm publish script' do @spec.stubs(:yarn?).returns(true).at_least_once - assert_equal ['assert-npm-version-tag', 'yarn publish'], @spec.deploy_steps + assert_equal ['assert-npm-version-tag', 'npm publish'], @spec.deploy_steps end test 'yarn checklist takes precedence over npm checklist' do