Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember Upgrade to 3.24 #13443

Merged
merged 53 commits into from
Dec 17, 2021
Merged

Ember Upgrade to 3.24 #13443

merged 53 commits into from
Dec 17, 2021

Conversation

zofskeez
Copy link
Contributor

The primary goal here was to upgrade Ember to the latest LTS version (3.24) and as many of the other dependencies as necessary to get the app to build. Here is a brief overview of the changes and things to be aware of.

Linting

Some new lint rules were added which led to cleaning up all of the new and existing js and hbs lint errors. Since some rules are Octane focused, individual rules have either been globally ignored until we can fully glimmerize everything or ignored/configured to warn on a per file basis. The .eslintrc.js and .template-lintrc.js contain all the rule overrides. We should work towards fully adopting the recommended lint rules over time.

While template linting was available in the project prior to the upgrade it was not being utilized. Part of the issue (for me at least) was that the Ember Language Server VSCode extension was not working with ember-template-lint. It may no longer be maintained since there hasn't been an update since May 2020 and perhaps that is why it is not working in the latest VSCode with the newest version of ember-template-lint.

It is highly recommended to use the Unstable Ember Language Server extension which is a fork that is actively maintained and works with ember-template-lint in the Vault project. Since some folks may not prefer live linting in the editor I added the lint:hbs:quiet task to the test run. Both js and hbs linting must find no errors before the Ember tests will run. Note that the lint tasks that contain :quiet will not fail if they contain warnings. We should strive to resolve all warnings over time and eventually flip them back to error.

Deprecations

ember-cli-deprecation-workflow was enabled to handle deprecation warnings. It's not always trivial to refactor to get around deprecations and they may also be reported from addons which may involve updating, or in the case of no longer maintained addons there may need to be a plan to migrate away from usage. With that in mind I created an initializer to filter out deprecation warnings that will remain until version 4.0.0. This gives us time to address any immediate issues and plan a path forward before our next major upgrade.

Test Failures

After touching many files fixing lint errors it was expected that there would be failing tests. I would like to briefly highlight some async issues that reoccur throughout the acceptance tests. It seems that after the upgrade the issue has increased and many acceptance tests that wait on an async action before asserting that a route transition has taken place fail intermittently.

await click('[data-test-save]');
assert.equal(currentURL(), '/some/route', 'route changes after save');

There is a new lint rule that errors when placing settled(); after a click citing that the click handler uses settled internally. To get around this for the time being and attempt to fix the flakiness I refactored any failures caught by CircleCI to use waitUntil:

await click('[data-test-save']);
assert.ok(
  await waitUntil(() => currentURL() === '/some/route'),
  'route changes after save'
);

We should attempt to address this issue globally and try and get to a point where we can reduce the usage of settled and waitUntil which will both clean up the readability of the tests and reduce intermittent failures.

@vercel vercel bot temporarily deployed to Preview – vault December 16, 2021 18:27 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook December 16, 2021 18:27 Inactive
@zofskeez zofskeez added ui dependencies Pull requests that update a dependency file labels Dec 16, 2021
@zofskeez zofskeez added this to the 1.10 milestone Dec 16, 2021
@zofskeez
Copy link
Contributor Author

@Monkeychip would you mind giving the recent changes a once over when you have a minute? Based on our conversation, the latest batch of commits address the following:

  • added an hbs specific rule to prettier to use double quotes in templates
  • updated the lint-staged task (which is triggered on pre commit) to format (via prettier) and lint .js and .hbs files. Prettier is also run on .scss files which remains unchanged.
  • set the prettier cli config arg to use .prettierrc.js rather than passing in individual rule flags to align with editor extension formatting
  • ran prettier again on .hbs files and manually fixed anything that couldn't be auto-fixed. There is an opportunity to leverage custom fixers in ember-template-lint in the future but it wasn't something I was ready to tackle last night
  • fixed enterprise tests

@zofskeez
Copy link
Contributor Author

@Monkeychip I fixed the issue with the hanging acceptance test. I traced it back to the ember-concurrency-test-waiters addon which is deprecated and they suggested to use @ember/test-waiters so I refactored any instances of the old method to the new.

@zofskeez zofskeez merged commit e5b1f71 into main Dec 17, 2021
@zofskeez zofskeez deleted the ui/update-deps-1.10 branch December 17, 2021 03:44
heppu pushed a commit to heppu/vault that referenced this pull request Jan 13, 2022
* Update browserslist

* Add browserslistrc

* ember-cli-update --to 3.26, fix conflicts

* Run codemodes that start with ember-*

* More codemods - before cp*

* More codemods (curly data-test-*)

* WIP ember-basic-dropdown template errors

* updates ember-basic-dropdown and related deps to fix build issues

* updates basic dropdown instances to new version API

* updates more deps -- ember-template-lint is working again

* runs no-implicit-this codemod

* creates and runs no-quoteless-attributes codemod

* runs angle brackets codemod

* updates lint:hbs globs to only touch hbs files

* removes yield only templates

* creates and runs deprecated args transform

* supresses lint error for invokeAction on LinkTo component

* resolves remaining ambiguous path lint errors

* resolves simple-unless lint errors

* adds warnings for deprecated tagName arg on LinkTo components

* adds warnings for remaining curly component invocation

* updates global template lint rules

* resolves remaining template lint errors

* disables some ember specfic lint rules that target pre octane patterns

* js lint fix run

* resolves remaining js lint errors

* fixes test run

* adds npm-run-all dep

* fixes test attribute issues

* fixes console acceptance tests

* fixes tests

* adds yield only wizard/tutorial-active template

* fixes more tests

* attempts to fix more flaky tests

* removes commented out settled in transit test

* updates deprecations workflow and adds initializer to filter by version

* updates flaky policies acl old test

* updates to flaky transit test

* bumps ember deps down to LTS version

* runs linters after main merge

* fixes client count tests after bad merge conflict fixes

* fixes client count history test

* more updates to lint config

* another round of hbs lint fixes after extending stylistic rule

* updates lint-staged commands

* removes indent eslint rule since it seems to break things

* fixes bad attribute in transform-edit-form template

* test fixes

* fixes enterprise tests

* adds changelog

* removes deprecated ember-concurrency-test-waiters dep and adds @ember/test-waiters

* flaky test fix

Co-authored-by: hashishaw <cshaw@hashicorp.com>
joatmon08 pushed a commit that referenced this pull request Jan 25, 2022
* Update browserslist

* Add browserslistrc

* ember-cli-update --to 3.26, fix conflicts

* Run codemodes that start with ember-*

* More codemods - before cp*

* More codemods (curly data-test-*)

* WIP ember-basic-dropdown template errors

* updates ember-basic-dropdown and related deps to fix build issues

* updates basic dropdown instances to new version API

* updates more deps -- ember-template-lint is working again

* runs no-implicit-this codemod

* creates and runs no-quoteless-attributes codemod

* runs angle brackets codemod

* updates lint:hbs globs to only touch hbs files

* removes yield only templates

* creates and runs deprecated args transform

* supresses lint error for invokeAction on LinkTo component

* resolves remaining ambiguous path lint errors

* resolves simple-unless lint errors

* adds warnings for deprecated tagName arg on LinkTo components

* adds warnings for remaining curly component invocation

* updates global template lint rules

* resolves remaining template lint errors

* disables some ember specfic lint rules that target pre octane patterns

* js lint fix run

* resolves remaining js lint errors

* fixes test run

* adds npm-run-all dep

* fixes test attribute issues

* fixes console acceptance tests

* fixes tests

* adds yield only wizard/tutorial-active template

* fixes more tests

* attempts to fix more flaky tests

* removes commented out settled in transit test

* updates deprecations workflow and adds initializer to filter by version

* updates flaky policies acl old test

* updates to flaky transit test

* bumps ember deps down to LTS version

* runs linters after main merge

* fixes client count tests after bad merge conflict fixes

* fixes client count history test

* more updates to lint config

* another round of hbs lint fixes after extending stylistic rule

* updates lint-staged commands

* removes indent eslint rule since it seems to break things

* fixes bad attribute in transform-edit-form template

* test fixes

* fixes enterprise tests

* adds changelog

* removes deprecated ember-concurrency-test-waiters dep and adds @ember/test-waiters

* flaky test fix

Co-authored-by: hashishaw <cshaw@hashicorp.com>
qk4l pushed a commit to qk4l/vault that referenced this pull request Feb 4, 2022
* Update browserslist

* Add browserslistrc

* ember-cli-update --to 3.26, fix conflicts

* Run codemodes that start with ember-*

* More codemods - before cp*

* More codemods (curly data-test-*)

* WIP ember-basic-dropdown template errors

* updates ember-basic-dropdown and related deps to fix build issues

* updates basic dropdown instances to new version API

* updates more deps -- ember-template-lint is working again

* runs no-implicit-this codemod

* creates and runs no-quoteless-attributes codemod

* runs angle brackets codemod

* updates lint:hbs globs to only touch hbs files

* removes yield only templates

* creates and runs deprecated args transform

* supresses lint error for invokeAction on LinkTo component

* resolves remaining ambiguous path lint errors

* resolves simple-unless lint errors

* adds warnings for deprecated tagName arg on LinkTo components

* adds warnings for remaining curly component invocation

* updates global template lint rules

* resolves remaining template lint errors

* disables some ember specfic lint rules that target pre octane patterns

* js lint fix run

* resolves remaining js lint errors

* fixes test run

* adds npm-run-all dep

* fixes test attribute issues

* fixes console acceptance tests

* fixes tests

* adds yield only wizard/tutorial-active template

* fixes more tests

* attempts to fix more flaky tests

* removes commented out settled in transit test

* updates deprecations workflow and adds initializer to filter by version

* updates flaky policies acl old test

* updates to flaky transit test

* bumps ember deps down to LTS version

* runs linters after main merge

* fixes client count tests after bad merge conflict fixes

* fixes client count history test

* more updates to lint config

* another round of hbs lint fixes after extending stylistic rule

* updates lint-staged commands

* removes indent eslint rule since it seems to break things

* fixes bad attribute in transform-edit-form template

* test fixes

* fixes enterprise tests

* adds changelog

* removes deprecated ember-concurrency-test-waiters dep and adds @ember/test-waiters

* flaky test fix

Co-authored-by: hashishaw <cshaw@hashicorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants