Skip to content

[7.x] [App Search] Role mappings migration part 2 (#94461)#94762

Merged
kibanamachine merged 1 commit intoelastic:7.xfrom
kibanamachine:backport/7.x/pr-94461
Mar 16, 2021
Merged

[7.x] [App Search] Role mappings migration part 2 (#94461)#94762
kibanamachine merged 1 commit intoelastic:7.xfrom
kibanamachine:backport/7.x/pr-94461

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

* Add engines mock and fix mock role mapping

The original asRoleMapping was merely for a smoke test in the shared component. Refactored to work better in App Search component

* Add RoleMappingsLogic

* Fix test description

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* Fix test description

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* Add flash messages when creating, updating or deleting

* Add path and resetState calls

Refactoring the tests showed me that some parts of the state weren’t being reset.

* Refactor handleAuthProviderChange logic

I some how got the test coverage at 100% with my wrong way of doing tests before (scary). When I fixed it I noticed that noting I could do would trigger the fallback of just returning the `[ANY_AUTH_PROVIDER]` array. After talking with Constance, we could not come up with a way to trigger it either, given the conditions.

She had suggested removing the first return statement but that caused an empty array being returned sometimes.

Ultimately, I was able to get it working and covered with these changes.

* Refactor tests per PR feedback

The places where `role: 'superuser’` was deleted in the listeners was a side effect of using `setRoleMappingData` and not `mount`

* Add back deleted assertion

* Copy nit

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Mar 16, 2021
@kibanamachine kibanamachine enabled auto-merge (squash) March 16, 2021 21:09
@kibanamachine
Copy link
Copy Markdown
Contributor Author

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.1MB 2.1MB +888.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @scottybollinger

@kibanamachine kibanamachine merged commit eb51fd4 into elastic:7.x Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants