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

[Logs+] Enforce dataset names #166654

Merged
merged 7 commits into from
Sep 21, 2023

Conversation

Kerry350
Copy link
Contributor

@Kerry350 Kerry350 commented Sep 18, 2023

Summary

Closes #163830

This adds server side validation to enforce dataset name format rules for custom integrations. It then enhances the custom integrations Kibana package to handle this seamlessly in the create form.

There is no client side validation for the rules per se because as long as the dataset name passes other validations (length etc) then it is always valid - it just comes down to whether it's prefixed or not.

Other notes

  • Added a "fields pipeline" to improve the readability of the context update.

UI / UX changes

  • Users are informed when a prefix will be added.
Screenshot 2023-09-20 at 13 19 49
  • If the integration name has been touched, and the dataset name is untouched, the dataset name will automatically match the integration name.

matching

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@Kerry350 Kerry350 force-pushed the 163830-enforce-dataset-names branch 2 times, most recently from aef73d8 to 51d5376 Compare September 20, 2023 11:13
@Kerry350 Kerry350 force-pushed the 163830-enforce-dataset-names branch from 51d5376 to 48e146f Compare September 20, 2023 11:14
@Kerry350 Kerry350 self-assigned this Sep 20, 2023
@Kerry350 Kerry350 added Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes labels Sep 20, 2023
@Kerry350 Kerry350 marked this pull request as ready for review September 20, 2023 12:18
@Kerry350 Kerry350 requested review from a team as code owners September 20, 2023 12:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 20, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@tonyghiani tonyghiani self-requested a review September 20, 2023 12:53
Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +20 to +26
return pipe(
[context, event] as ValuesTuple,
updateFields(context),
updateTouchedFields(context),
maybeMatchDatasetNameToIntegrationName(context),
replaceSpecialCharacters(context)
);
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

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

Good job, it works well and code changes LGTM 👏

Copy link
Contributor

@hop-dev hop-dev left a comment

Choose a reason for hiding this comment

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

Fleet changes look good 🚀

import type { CustomPackageDatasetConfiguration } from '../../install';

// Dataset name must either match integration name exactly OR be prefixed with integration name and a dot.
export const checkDatasetsNameFormat = (
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function is a good candidate for unit testing :)

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

LGTM 🧙🏼‍♀️

@Kerry350
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Defend Workflows Cypress Tests #4 / Artifact pages Trusted applications should update Endpoint Policy on Endpoint when adding Trusted application name should update Endpoint Policy on Endpoint when adding Trusted application name

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observabilityOnboarding 178 179 +1

Async chunks

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

id before after diff
observabilityOnboarding 238.2KB 239.4KB +1.1KB

History

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

cc @Kerry350

@Kerry350 Kerry350 merged commit 795ec3e into elastic:main Sep 21, 2023
@kibanamachine kibanamachine added v8.11.0 backport:skip This commit does not require backporting labels Sep 21, 2023
yngrdyn added a commit that referenced this pull request Sep 27, 2023
`OBSERVABILITY_ONBOARDING_LOCATOR` and
`ObservabilityOnboardingLocatorParams` were removed from
`observability_onboarding` plugin in
[#165962](#165962) and are now
part of `@kbn/deeplinks-observability/locators`.

`datsetName` was transformed into an optional variable in the wizard
state in [#166654](#166654) which
makes sense for first step of custom logs onboarding but it's required
in onboarding saved object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs+] Enforce dataset names
9 participants