From 12980418ae5b947fb67e0427d3afe3fd224927c4 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 17 Jun 2022 16:51:28 +0100 Subject: [PATCH] DEV: Disable the use of 'legacy' Ember assets (#17127) Anyone still using `EMBER_CLI_PROD_ASSETS=0` in development or production will be gracefully switched to Ember CLI. In development, a repeated message will be logged to STDERR. Similarly, passing `QUNIT_EMBER_CLI=0` to the qunit rake task will now do nothing. A warning will be printed, and ember-cli mode will be used. Note that we've chosen not to fail the task, so that existing plugin/theme CI jobs don't immediately start failing. We may switch to a hard fail in the coming days/weeks. --- .github/workflows/tests.yml | 12 +----------- lib/ember_cli.rb | 5 ++++- lib/tasks/assets.rake | 4 ++++ lib/tasks/qunit.rake | 6 +++++- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b2d486670e4..9e045655590 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: - build_type: [backend, frontend, frontend-legacy, annotations] + build_type: [backend, frontend, annotations] target: [core, plugins] exclude: - build_type: annotations @@ -153,16 +153,6 @@ jobs: if: matrix.build_type == 'backend' && matrix.target == 'plugins' run: bin/rake plugin:spec - - name: Core QUnit (Legacy) - if: matrix.build_type == 'frontend-legacy' && matrix.target == 'core' - run: QUNIT_EMBER_CLI=0 bin/rake qunit:test['1200000'] - timeout-minutes: 30 - - - name: Plugin QUnit (Legacy) - if: matrix.build_type == 'frontend-legacy' && matrix.target == 'plugins' - run: QUNIT_EMBER_CLI=0 bin/rake plugin:qunit['*','1200000'] - timeout-minutes: 30 - - name: Plugin QUnit (Ember CLI) if: matrix.build_type == 'frontend' && (matrix.target == 'plugins' || matrix.target == 'core-plugins') run: QUNIT_EMBER_CLI=1 bin/rake plugin:qunit['*','1200000'] diff --git a/lib/ember_cli.rb b/lib/ember_cli.rb index de6d5ef310c..04387c67e77 100644 --- a/lib/ember_cli.rb +++ b/lib/ember_cli.rb @@ -17,7 +17,10 @@ module EmberCli } def self.enabled? - ENV["EMBER_CLI_PROD_ASSETS"] != "0" + if !Rails.env.production? && ENV["EMBER_CLI_PROD_ASSETS"] == "0" + STDERR.puts "The 'legacy' ember environment is discontinued. Running with ember-cli assets. Remove the EMBER_CLI_PROD_ASSETS=0 flag." + end + true end def self.script_chunks diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index b17f777d04f..d5c84ec344a 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -4,6 +4,10 @@ if !defined?(EMBER_CLI) EMBER_CLI = EmberCli.enabled? end +if ENV["EMBER_CLI_PROD_ASSETS"] == "0" + STDERR.puts "The 'legacy' ember environment is discontinued. Compiling with ember-cli assets..." +end + task 'assets:precompile:before' do require 'uglifier' diff --git a/lib/tasks/qunit.rake b/lib/tasks/qunit.rake index 35da5e3590a..a7294a38ba7 100644 --- a/lib/tasks/qunit.rake +++ b/lib/tasks/qunit.rake @@ -28,7 +28,11 @@ task "qunit:test", [:timeout, :qunit_path] do |_, args| false end - ember_cli = ENV['QUNIT_EMBER_CLI'] == "1" + if ENV['QUNIT_EMBER_CLI'] == "0" + puts "The 'legacy' ember environment is discontinued - running tests with ember-cli assets..." + end + + ember_cli = true port = ENV['TEST_SERVER_PORT'] || 60099 while !port_available? port