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

Upgrade bug and test fixes #17500

Merged
merged 10 commits into from
Oct 13, 2022
Merged

Conversation

zofskeez
Copy link
Contributor

@zofskeez zofskeez commented Oct 12, 2022

Other than general bug fixes that were causing tests to fail, here are the primary things addressed:

  • ember-cli-content-secrity-policy was causing a weird browser timeout issue in test runs when not using -s. We were on a really old version so I bumped it to the latest which moves the config to a dedicated file with more options. There's an option to choose whether or not policy errors will cause a test to fail and I left it enabled for now
  • Integration tests were failing for components within engines and throwing an error when setting up a container for ember data which initially led me in the wrong direction. I eventually came across this PR which introduces a new API for testing engines so I upgraded to the latest version and updated the tests
  • I realized that the flashMessages service was being automatically injected so that was throwing errors in places. I updated the inject-service codemod to take an arg for service name so that it's more flexible and did another pass for flashMessages
  • The majority of the test failures were coming from errors thrown when passing in a template string to hbs and not using this which I cleaned up

@zofskeez zofskeez added the ui label Oct 12, 2022
@zofskeez zofskeez marked this pull request as draft October 12, 2022 02:19
Comment on lines +1 to +11
/* eslint-disable ember/no-computed-properties-in-native-classes */
import FlashMessage from 'ember-cli-flash/components/flash-message';

export default FlashMessage.extend({
export default class FlashMessageComponent extends FlashMessage {
// override alertType to get Bulma specific prefix
//https://github.com/poteto/ember-cli-flash/blob/master/addon/components/flash-message.js#L35
alertType: computed('flash.type', {
get() {
const flashType = this.flash.type || '';
let prefix = 'is-';

return `${prefix}${flashType}`;
},
}),
});
//https://github.com/poteto/ember-cli-flash/blob/master/addon/components/flash-message.js#L55
get alertType() {
const flashType = this.args.flash.type || '';
return `is-${flashType}`;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needed to be updated after upgrading to the latest version since they converted to native class.

@zofskeez zofskeez marked this pull request as ready for review October 12, 2022 23:43
@@ -40,7 +38,7 @@ const LIST_ROOT_ROUTE = 'vault.cluster.secrets.backend.list-root';
const SHOW_ROUTE = 'vault.cluster.secrets.backend.show';

export default class SecretCreateOrUpdate extends Component {
@tracked codemirrorString = null;
// @tracked codemirrorString = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to keep this as a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Guessing I was trying to debug something so let me uncomment it and see if the tests still pass.

Copy link
Contributor Author

@zofskeez zofskeez Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So commenting that out did fix these tests which are now failing. I must have forgot to loop back and look for a proper solution. I'm thinking the code-mirror modifier must be send the on change event right away which is triggering the same computation error.

@@ -11,7 +11,7 @@
class="input"
{{on "input" this.onInput}}
/>
<BasicDropdown @registerAPI={{fn (mut this.dropdownAPI)}} @renderInPlace={{true}} as |D|>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this removed because mut is being deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No mut is still a good helper but it was throwing the twice in the same computation error but didn't when I moved it to an action.

@@ -11,7 +11,7 @@ module('Integration | Component | link-status', function (hooks) {

// this can be removed once feature is released for OSS
hooks.beforeEach(function () {
this.owner.lookup('service:version').set('isEnterprise', true);
this.owner.lookup('service:version').set('version', '1.13.0+ent');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this continue to stay true after we increase the binaries? say when we hit the next 1.14 binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the plan is to introduce this to OSS in the next version so it's likely only temporary. The problem with this particular line was that isEnterprise is a computed property and an error is thrown now when a computed property without a setter is overriden. Setting the version this way makes isEnterprise return true.

Copy link
Contributor

@Monkeychip Monkeychip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. left two comments about comments that might have accidentally been left in.

Comment on lines -32 to +35
this.args.named.onUpdate(editor.getValue(), this._editor);
// avoid sending change event after initial setup when editor value is set to content
if (this.args.named.content !== editor.getValue()) {
this.args.named.onUpdate(editor.getValue(), this._editor);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Monkeychip this was this issue causing the same computation error. Since we are setting the editor value to the content arg in the setup the change event was firing immediately.

@zofskeez zofskeez merged commit 31356d1 into ui/ember-upgrade-4.4 Oct 13, 2022
@zofskeez zofskeez deleted the ui/VAULT-9018/test-fixes branch October 13, 2022 03:57
zofskeez added a commit that referenced this pull request Oct 18, 2022
* runs ember-cli-update to 4.4.0

* updates yarn.lock

* updates dependencies causing runtime errors (#17135)

* Inject Store Service When Accessed Implicitly (#17345)

* adds codemod for injecting store service

* adds custom babylon parser with decorators-legacy plugin for jscodeshift transforms

* updates inject-store-service codemod to only look for .extend object expressions and adds recast options

* runs inject-store-service codemod on js files

* replace query-params helper with hash (#17404)

* Updates/removes dependencies throwing errors in Ember 4.4 (#17396)

* updates ember-responsive to latest

* updates ember-composable-helpers to latest and uses includes helper since contains was removed

* updates ember-concurrency to latest

* updates ember-cli-clipboard to latest

* temporary workaround for toolbar-link component throwing errors for using params arg with LinkTo

* adds missing store injection to auth configure route

* fixes issue with string-list component throwing error for accessing prop in same computation

* fixes non-iterable query params issue in mfa methods controller

* refactors field-to-attrs to handle belongsTo rather than fragments

* converts mount-config fragment to belongsTo on auth-method model

* removes ember-api-actions and adds tune method to auth-method adapter

* converts cluster replication attributes from fragment to relationship

* updates ember-data, removes ember-data-fragments and updates yarn to latest

* removes fragments from secret-engine model

* removes fragment from test-form-model

* removes commented out code

* minor change to inject-store-service codemod and runs again on js files

* Remove LinkTo positional params (#17421)

* updates ember-cli-page-object to latest version

* update toolbar-link to support link-to args and not positional params

* adds replace arg to toolbar-link component

* Clean up js lint errors (#17426)

* replaces assert.equal to assert.strictEqual

* update eslint no-console to error and disables invididual intended uses of console

* cleans up hbs lint warnings (#17432)

* Upgrade bug and test fixes (#17500)

* updates inject-service codemod to take arg for service name and runs for flashMessages service

* fixes hbs lint error after merging main

* fixes flash messages

* updates more deps

* bug fixes

* test fixes

* updates ember-cli-content-security-policy and prevents default form submission throwing errors

* more bug and test fixes

* removes commented out code

* fixes issue with code-mirror modifier sending change event on setup causing same computation error

* Upgrade Clean Up (#17543)

* updates deprecation workflow and filter

* cleans up build errors, removes unused ivy-codemirror and sass and updates ember-cli-sass and node-sass to latest

* fixes control groups test that was skipped after upgrade

* updates control group service tests

* addresses review feedback

* updates control group service handleError method to use router.currentURL rather that transition.intent.url

* adds changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants