DEV: Drop Ember 3 feature flag

This commit is contained in:
David Taylor
2024-02-26 10:53:32 +00:00
parent 2018cd3b62
commit 542cb22fd4
24 changed files with 12 additions and 12136 deletions

View File

@@ -1,69 +0,0 @@
# This workflow is designed to stop us accidently committing the lockfile/packagejson symlink changes
# which would cause the default Ember version to change.
name: Ember Version Enforcement
on:
pull_request:
push:
branches:
- main
permissions:
contents: write
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Yarn install
run: |
cd app/assets/javascripts/discourse
yarn install
- name: "Check default ember version"
working-directory: app/assets/javascripts/discourse
run: |
node -e '
const version = require("ember-source/package.json").version;
console.log("Ember version is", version);
if(version.split(".")[0] !== "5"){
console.log(`Ember has unexpectedly been downgraded to version ${version}. If this is intentional, remove this github workflow.`);
process.exit(1);
}
'
- name: Downgrade ember
run: |
script/switch_ember_version 3
cd app/assets/javascripts/discourse
yarn install
- name: "Check upgraded version"
working-directory: app/assets/javascripts/discourse
run: |
node -e '
const version = require("ember-source/package.json").version;
console.log("Ember version is", version);
if(version.split(".")[0] !== "3"){
console.log(`Expected Ember 3, but found ${version}`);
process.exit(1);
}
'
- name: "Revert ember downgrade"
run: |
script/switch_ember_version 5
- name: "Ensure no diff"
run: |
if [ ! -z "$(git status --porcelain)" ]; then
echo "Working directory was not clean after upgrading/downgrading ember. Perhaps a lockfile is out-of-date. Run this command to re-sync:"
echo " script/regen_ember_3_lockfile"
echo
echo "Current diff:"
echo "---------------------------------------------"
git -c color.ui=always diff
exit 1
fi

View File

@@ -1,38 +0,0 @@
# This workflow will run on dependabot pull requests to ensure that they update both the ember3 and ember5 lockfiles
name: Ember Version Lockfiles
on:
- pull_request
permissions:
contents: write
jobs:
help_dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Move lockfile to correct location
run: |
# Dependabot gets confused by the symlinks and dumps the updated lockfile in the root of the repo.
# Let's move it back to the correct location.
if [[ -f yarn-ember5.lock ]]; then
mv yarn-ember5.lock app/assets/javascripts/yarn-ember5.lock
fi
- name: Update ember3 lockfile
run: script/regen_ember_3_lockfile
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "build@discourse.org"
git config --global user.name "discoursebuild"
git add .
git commit -m "Update lockfiles for ember version flag"
git push
fi

View File

@@ -22,7 +22,7 @@ permissions:
jobs:
build:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: ${{ matrix.target }} ${{ matrix.build_type }}${{ !matrix.updated_ember && ' (Ember 3)' || '' }} # Update fetch-job-id step if changing this
name: ${{ matrix.target }} ${{ matrix.build_type }} # Update fetch-job-id step if changing this
runs-on: ${{ (matrix.build_type == 'annotations') && 'ubuntu-latest' || 'ubuntu-20.04-8core' }}
container: discourse/discourse_test:slim${{ (matrix.build_type == 'frontend' || matrix.build_type == 'system') && '-browsers' || '' }}${{ (matrix.ruby == '3.1') && '-ruby-3.1.0' || '' }}
timeout-minutes: 20
@@ -35,7 +35,6 @@ jobs:
USES_PARALLEL_DATABASES: ${{ matrix.build_type == 'backend' || matrix.build_type == 'system' }}
CAPYBARA_DEFAULT_MAX_WAIT_TIME: 10
MINIO_RUNNER_LOG_LEVEL: DEBUG
EMBER_VERSION: ${{ (matrix.updated_ember && '5') || '3' }}
DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS: ${{ (matrix.build_type == 'system' || matrix.build_type == 'backend') && github.ref == 'refs/main/head' }}
strategy:
@@ -45,7 +44,6 @@ jobs:
build_type: [backend, frontend, system, annotations]
target: [core, plugins, themes]
ruby: ["3.2"]
updated_ember: [true]
exclude:
- build_type: annotations
target: plugins
@@ -58,7 +56,6 @@ jobs:
include:
- build_type: system
target: chat
updated_ember: true
steps:
- name: Set working directory owner
@@ -299,7 +296,7 @@ jobs:
id: fetch-job-id
if: always() && steps.check-flaky-spec-report.outputs.exists == 'true'
run: |
job_id=$(ruby script/get_github_workflow_run_job_id.rb ${{ github.run_id }} ${{ github.run_attempt }} '${{ matrix.target }} ${{ matrix.build_type }}${{ !matrix.updated_ember && ' (Ember 3)' || '' }}')
job_id=$(ruby script/get_github_workflow_run_job_id.rb ${{ github.run_id }} ${{ github.run_attempt }} '${{ matrix.target }} ${{ matrix.build_type }}')
echo "job_id=$job_id" >> $GITHUB_OUTPUT
- name: Create flaky tests report artifact
@@ -332,7 +329,7 @@ jobs:
core_frontend_tests:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: core frontend (${{ matrix.browser }})${{ !matrix.updated_ember && ' (Ember 3)' || '' }}
name: core frontend (${{ matrix.browser }})
runs-on: ubuntu-20.04-8core
container:
image: discourse/discourse_test:slim-browsers
@@ -344,10 +341,6 @@ jobs:
fail-fast: false
matrix:
browser: ["Chrome", "Firefox ESR", "Firefox Evergreen"]
updated_ember: [true]
include:
- browser: Chrome
updated_ember: false
env:
TESTEM_BROWSER: ${{ (startsWith(matrix.browser, 'Firefox') && 'Firefox') || matrix.browser }}
@@ -374,10 +367,6 @@ jobs:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-cachev2
- name: Downgrade Ember
if: matrix.updated_ember == false
run: script/switch_ember_version 3
- name: Yarn install
working-directory: ./app/assets/javascripts/discourse
run: yarn install --frozen-lockfile