discourse/script
David Taylor 16b6e86932 DEV: Introduce feature-flag for Ember 5 upgrade
This commit introduces the scaffolding for us to easily switch between Ember 3.28 and Ember 5 on the `main` branch of Discourse. Unfortunately, there is no built-in system to apply this kind of flagging within yarn / ember-cli. There are projects like `ember-try` which are designed for running against multiple version of a dependency, but they do not allow us to 'lock' dependency/sub-dependency versions, and are therefore unsuitable for our use in production.

Instead, we will be maintaining two root `package.json` files, and two `yarn.lock` files. For ember-3, they remain as-is. For ember5, we use a yarn 'resolution' to override the version for ember-source across the entire yarn workspace.

To allow for easy switching with minimal diff against the repository, `package.json` and `yarn.lock` are symlinks which point to `package-ember3.json` and `yarn-ember3.lock` by default. To switch to Ember 5, we can run `script/switch ember version 5` to update the symlinks to point to `package-ember5.json` and `package-ember3.json` respectively. In production, and when using `bin/ember-cli` for development, the ember version can also be upgraded using the `EMBER_VERSION=5` environment variable.

When making changes to dependencies, these should be made against the default `ember3` versions, and then `script/regen_ember_5_lockfile` should be used to regenerate `yarn-ember5.lock` accordingly. A new 'Ember Version Lockfiles' GitHub workflow will automate this process on Dependabot PRs.

When running a local environment against Ember 5, the two symlink changes will show up as git diffs. To avoid us accidentally committing/pushing that change, another GitHub workflow is introduced which checks the default Ember version and raises an error if it is greater than v3.

Supporting two ember versions simultaneously obviously carries significant overhead, so our aim will be to get themes/plugins updated as quickly as possible, and then drop this flag.
2023-11-27 16:40:22 +00:00
..
benchmarks
bulk_import DEV: Adding polls, solutions, upload references and other improvements to the Discourse merger script (#23689) 2023-11-16 14:32:53 +01:00
demon_test
import_scripts FIX: A typo bug in an import script (#24553) 2023-11-25 18:10:42 +01:00
.gitignore
alice.txt
analyse_message_bus.rb
analyze_sidekiq_queues.rb
bench.rb
biggest_objects.rb
boot_mem.rb
build_jsconfig.rb DEV: Consolidate and update jsconfig, and add types packages (#23824) 2023-10-18 12:13:20 +01:00
cache_critical_dns DEV(cache_critical_dns): sort resolved SRV targets by priority 2023-11-22 08:26:00 +10:00
check_forking.rb
check_reproducible_assets.rb DEV: introduce Embroider behind a flag, and start testing in CI (#23005) 2023-09-07 13:15:43 +01:00
copyright-deposit
db_timestamps_mover.rb
diff_heaps.rb
discourse
docker_test.rb DEV: Fix typo in `docker_test.rb` script (#23456) 2023-09-07 15:36:27 +08:00
i18n_lint.rb
install_minio_binaries.rb DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
local_minio_s3.rb DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
measure.rb
memory-analysis
memstats.rb
micro_bench.rb
mwrap_sidekiq
profile_db_generator.rb
promote_migrations
rails
redis_memory.rb
regen_ember_5_lockfile DEV: Introduce feature-flag for Ember 5 upgrade 2023-11-27 16:40:22 +00:00
require_profiler.rb
silence_successful_output DEV: Silence successful database migration output in github actions (#24416) 2023-11-16 15:55:41 +00:00
spawn_backup_restore.rb
start_test_db.rb DEV: Add `docker:test:setup` Rake task (#23430) 2023-09-07 13:46:23 +08:00
switch_container_ruby
switch_ember_version DEV: Introduce feature-flag for Ember 5 upgrade 2023-11-27 16:40:22 +00:00
test_email_settings.rb
test_mem.rb
test_memory_leak.rb
test_pretty_text.rb
thread_detective.rb
user_simulator.rb