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 onboarding] Removes dependency on apikey id in saved objects #159535

Merged

Conversation

ogupte
Copy link
Contributor

@ogupte ogupte commented Jun 13, 2023

Closes #159381

Makes use of the auto-generated saved object ID to identify observability onboarding state saved objects, so the API key id is never persisted. In this change, the generated API key never has an explicit association with the saved object for the onboarding flow.

@ogupte ogupte added release_note:skip Skip the PR/issue when compiling release notes v8.9.0 labels Jun 13, 2023
@ogupte ogupte requested a review from a team as a code owner June 13, 2023 04:34
@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.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Comment on lines +52 to +54
core.setup.http.basePath.publicBaseUrl ?? // priority given to server.publicBaseUrl
plugins.cloud?.setup?.kibanaUrl ?? // then cloud id
getFallbackUrls(coreStart).kibanaUrl; // falls back to local network binding
Copy link
Member

@sorenlouv sorenlouv Jun 13, 2023

Choose a reason for hiding this comment

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

Can you manually test this out in the QA environment to make sure it works in the cloud environment?

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 tested it out locally by setting xpack.cloud.id: 'es-logs-onboarding-test:ZWFzdHV...4MjYz', which is the config set in cloud.

Copy link
Member

Choose a reason for hiding this comment

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

You can create a serverless instance in the QA environment pretty easily (pastebin)

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

lgtm

@ogupte ogupte requested a review from a team as a code owner June 14, 2023 03:05
@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
observabilityOnboarding 45.0KB 45.1KB +127.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 13 15 +2
securitySolution 409 413 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 14 16 +2
securitySolution 492 496 +4
total +6

History

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

@@ -29,7 +29,7 @@ export interface SavedObservabilityOnboardingState
export const observabilityOnboardingState: SavedObjectsType = {
name: OBSERVABILITY_ONBOARDING_STATE_SAVED_OBJECT_TYPE,
hidden: false,
namespaceType: 'multiple',
Copy link
Contributor

Choose a reason for hiding this comment

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

So... In theory that kind of change is absolutely unsupported on released types (types already in a production version).

Now... In practice, technically this should mostly be fine, as both multiple and agnostic types have the same id-generation logic. However there can be functional impacts from this change. Also, I'm not even sure how our system reacts when an agnostic-type document is encountered with the namespaces field present and populated.

So, are you sure about this 😄 ?

Copy link
Member

@sorenlouv sorenlouv Jun 14, 2023

Choose a reason for hiding this comment

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

In theory that kind of change is absolutely unsupported on released types (types already in a production version).

This is not yet released :)
(introduced in #158386)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this should be fine: These saved objects are:

  • not yet released, so no users are impacted
  • always referenced by id, regardless of namespace (setting 'multiple' was an oversight)
  • mostly ephemeral, they exist for one step in a larger onboarding flow and then not referenced again after flow is completed

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, great then, thanks for confirming

@ogupte ogupte merged commit 2bab34a into elastic:main Jun 14, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 14, 2023
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 release_note:skip Skip the PR/issue when compiling release notes v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs onboarding] Use ApiKey metadata or name
6 participants