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

[ML] Transforms: Fixes privileges check #163687

Merged
merged 1 commit into from Aug 11, 2023

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Aug 11, 2023

Summary

Related to #164303.
Fixes a regression introduced in #154007.

When security is disabled, the check for transform privileges/capabilities would fail and the transform page would not render.

  • This fixes the endpoint to return data in the correct format should security be disabled.
  • The endpoint's TypeScript has been updated to catch malformed responses.
  • The client side custom useRequest is replaced with useQuery from '@tanstack/react-query' which also fixes TypeScript support on the client side.

Checklist

@walterra walterra added bug Fixes for quality problems that affect the customer experience release_note:fix :ml Feature:Transforms ML transforms v8.10.0 v8.9.2 labels Aug 11, 2023
@walterra walterra marked this pull request as ready for review August 11, 2023 10:03
@walterra walterra requested a review from a team as a code owner August 11, 2023 10:03
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
transform 366 365 -1

Async chunks

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

id before after diff
transform 404.7KB 404.7KB +1.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
transform 17.7KB 17.8KB +54.0B

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

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

Tested, LGTM

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM

@walterra walterra merged commit ecaa8a7 into elastic:main Aug 11, 2023
33 checks passed
@walterra walterra deleted the ml-transform-fix-privileges branch August 11, 2023 13:47
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.9 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 163687

Questions ?

Please refer to the Backport tool documentation

@walterra
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

walterra added a commit to walterra/kibana that referenced this pull request Aug 11, 2023
Fixes a regression introduced in elastic#154007.

When security is disabled, the check for transform
privileges/capabilities would fail and the transform page would not
render.

- This fixes the endpoint to return data in the correct format should
security be disabled.
- The endpoint's TypeScript has been updated to catch malformed
responses.
- The client side custom `useRequest` is replaced with `useQuery` from
`'@tanstack/react-query'` which also fixes TypeScript support on the
client side.

(cherry picked from commit ecaa8a7)

# Conflicts:
#	x-pack/plugins/transform/public/app/app.tsx
jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 11, 2023
* main: (64 commits)
  [ML] Transforms: Fix privileges check. (elastic#163687)
  [Log Explorer] Add test suite for Dataset Selector (elastic#163079)
  [Security Solution][Endpoint] Add API checks to Endpoint Policy create/update for checking `endpointPolicyProtections` is enabled (elastic#163429)
  [Security Solution] Fix flaky test: x-pack/test/detection_engine_api_integration/security_and_spaces/update_prebuilt_rules_package/update_prebuilt_rules_package·ts - update_prebuilt_rules_package should allow user to install prebuilt rules from scratch, then install new rules and upgrade existing rules from the new package (elastic#163241)
  [Security Solution] expandable flyout - replace feature flag with advanced settings toggle (elastic#161614)
  [DOCS] Adds the release notes for the 8.9.1 release. (elastic#163578)
  [FTR] Implement browser network condition utils (elastic#163633)
  [Security Solution] Unskip rules table auto-refresh Cypress tests (elastic#163451)
  [Security Solution] Re-enable fixed rule snoozing Cypress test (elastic#160037)
  [Flaky Test elastic#111821] Mock `moment` to avoid midnight TZ issues (elastic#163157)
  Document interactive setup (elastic#163619)
  [Lens] Align decoration color with text color for layer actions (elastic#163630)
  [Lens] Relax counter field checks for saved visualizations with unsupported operations (elastic#163515)
  [Security Solution][Endpoint] Removes pMap and uses a for loop instead (elastic#163509)
  [Enterprise Search] Update Workplace Search connectors doclink (elastic#163676)
  Update APM (main) (elastic#163623)
  [Serverless] Partially fix lens/maps/visualize breadcrumbs missing title  (elastic#163476)
  [Flaky elastic#118272] Unskip tests (elastic#163319)
  [APM] Make service group saved objects exportable (elastic#163569)
  [Observability AI Assistant] Action menu item (elastic#163463)
  ...
walterra added a commit that referenced this pull request Aug 11, 2023
# Backport

This will backport the following commits from `main` to `8.9`:
- [[ML] Transforms: Fix privileges check.
(#163687)](#163687)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"walter.rafelsberger@elastic.co"},"sourceCommit":{"committedDate":"2023-08-11T13:46:56Z","message":"[ML]
Transforms: Fix privileges check. (#163687)\n\nFixes a regression
introduced in #154007.\r\n\r\nWhen security is disabled, the check for
transform\r\nprivileges/capabilities would fail and the transform page
would not\r\nrender.\r\n\r\n- This fixes the endpoint to return data in
the correct format should\r\nsecurity be disabled.\r\n- The endpoint's
TypeScript has been updated to catch malformed\r\nresponses.\r\n- The
client side custom `useRequest` is replaced with `useQuery`
from\r\n`'@tanstack/react-query'` which also fixes TypeScript support on
the\r\nclient
side.","sha":"ecaa8a73707f97c99ef2d57574ac3dcbac3096df","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix",":ml","Feature:Transforms","v8.10.0","v8.9.2"],"number":163687,"url":"#163687
Transforms: Fix privileges check. (#163687)\n\nFixes a regression
introduced in #154007.\r\n\r\nWhen security is disabled, the check for
transform\r\nprivileges/capabilities would fail and the transform page
would not\r\nrender.\r\n\r\n- This fixes the endpoint to return data in
the correct format should\r\nsecurity be disabled.\r\n- The endpoint's
TypeScript has been updated to catch malformed\r\nresponses.\r\n- The
client side custom `useRequest` is replaced with `useQuery`
from\r\n`'@tanstack/react-query'` which also fixes TypeScript support on
the\r\nclient
side.","sha":"ecaa8a73707f97c99ef2d57574ac3dcbac3096df"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"#163687
Transforms: Fix privileges check. (#163687)\n\nFixes a regression
introduced in #154007.\r\n\r\nWhen security is disabled, the check for
transform\r\nprivileges/capabilities would fail and the transform page
would not\r\nrender.\r\n\r\n- This fixes the endpoint to return data in
the correct format should\r\nsecurity be disabled.\r\n- The endpoint's
TypeScript has been updated to catch malformed\r\nresponses.\r\n- The
client side custom `useRequest` is replaced with `useQuery`
from\r\n`'@tanstack/react-query'` which also fixes TypeScript support on
the\r\nclient
side.","sha":"ecaa8a73707f97c99ef2d57574ac3dcbac3096df"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
benakansara pushed a commit to benakansara/kibana that referenced this pull request Aug 14, 2023
Fixes a regression introduced in elastic#154007.

When security is disabled, the check for transform
privileges/capabilities would fail and the transform page would not
render.

- This fixes the endpoint to return data in the correct format should
security be disabled.
- The endpoint's TypeScript has been updated to catch malformed
responses.
- The client side custom `useRequest` is replaced with `useQuery` from
`'@tanstack/react-query'` which also fixes TypeScript support on the
client side.
@mistic
Copy link
Member

mistic commented Aug 17, 2023

This pr didn't make it into the build candidate for v8.9.1. Updating the labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Transforms ML transforms :ml release_note:fix v8.9.2 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants