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

[Security Solution] endpoint metadata transform stats API #120429

Merged

Conversation

joeypoon
Copy link
Member

@joeypoon joeypoon commented Dec 3, 2021

Summary

Add new endpoint metadata transform stats API that explicitly checks for fleet permissions and switch endpoints transform warning banner to use new endpoint.

Checklist

For maintainers

@joeypoon joeypoon added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 labels Dec 3, 2021
@joeypoon joeypoon force-pushed the feature/metadata-transform-stats-api branch from 938067d to e1de52a Compare December 3, 2021 23:13
@@ -114,54 +118,52 @@ describe('test endpoint routes', () => {
perPage: 1000,
});
});

endpointAppContextService = new EndpointAppContextService();
Copy link
Member Author

@joeypoon joeypoon Dec 3, 2021

Choose a reason for hiding this comment

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

no changes to this chunk of code, just moving this up one level to remove the duplicates.

const t = transform as unknown as { id: string };
return client.transform.startTransform({ transform_id: t.id });
});
return Promise.all(
Copy link
Member Author

@joeypoon joeypoon Dec 3, 2021

Choose a reason for hiding this comment

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

hard to believe everything was passing consistently without this 😅 .

@joeypoon joeypoon requested a review from a team December 4, 2021 00:29
@joeypoon joeypoon marked this pull request as ready for review December 5, 2021 19:44
@joeypoon joeypoon requested a review from a team as a code owner December 5, 2021 19:44
@joeypoon joeypoon requested review from academo and parkiino December 5, 2021 19:44
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Left just a few questions, but nothing that should hold this back from my perspective.

🚢

@@ -784,7 +784,7 @@ export async function handleLoadMetadataTransformStats(http: HttpStart, store: E

try {
const transformStatsResponse: TransformStatsResponse = await http.get(
METADATA_TRANSFORM_STATS_URL
METADATA_TRANSFORMS_STATUS_ROUTE
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know what happens if the API call returns a failure in the code below (line 795)? Do we show it on the UI?

Copy link
Member Author

@joeypoon joeypoon Dec 6, 2021

Choose a reason for hiding this comment

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

It shouldn't show up in the UI. the banner only shows if the response has transforms with the warning states we defined. so no transforms returned would just be silently ignored as far as the user is concerned. though this should be exceedingly rare for permission based failures since the banner lives in the endpoint list component which uses the same permissions.

@joeypoon joeypoon force-pushed the feature/metadata-transform-stats-api branch from e1de52a to aadd7cb Compare December 6, 2021 16:22
@joeypoon joeypoon enabled auto-merge (squash) December 6, 2021 16:29
@kibana-ci
Copy link
Collaborator

💚 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
securitySolution 4.6MB 4.5MB -11.1KB

Page load bundle

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

id before after diff
securitySolution 243.7KB 242.9KB -841.0B
Unknown metric groups

async chunk count

id before after diff
securitySolution 21 22 +1

History

  • 💚 Build #11129 succeeded e1de52a25eb8dc01dbfd2bcc37ebbd125ca8b483
  • 💔 Build #11127 failed 938067d6af06eb8ddb419630cf7aed76ec378f51

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

@joeypoon joeypoon merged commit 7fc30d5 into elastic:main Dec 6, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
8.0 Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 120429

joeypoon added a commit to joeypoon/kibana that referenced this pull request Dec 6, 2021
…0429)

# Conflicts:
#	x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts
joeypoon added a commit that referenced this pull request Dec 6, 2021
…120537)

# Conflicts:
#	x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts
@joeypoon joeypoon deleted the feature/metadata-transform-stats-api branch December 6, 2021 22:04
@machadoum machadoum removed the auto-backport Deprecated - use backport:version if exact versions are needed label Dec 7, 2021
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants