Skip to content

[Dashboards] Replace contentClient with getContentClient on DashboardStart server api#217586

Merged
nickpeihl merged 2 commits intoelastic:mainfrom
nickpeihl:fix-dashboardstart-api
Apr 10, 2025
Merged

[Dashboards] Replace contentClient with getContentClient on DashboardStart server api#217586
nickpeihl merged 2 commits intoelastic:mainfrom
nickpeihl:fix-dashboardstart-api

Conversation

@nickpeihl
Copy link
Copy Markdown
Contributor

@nickpeihl nickpeihl commented Apr 8, 2025

Summary

Changes the DashboardStart server api to provide a getContentClient function.

In #214788, we set the contentClient returned from the content management register method after start lifecycle of all plugins. This means the contentClient returned from the DashboardStart contract was undefined. This PR changes the start contract to provide a getContentClient function instead.

Only one consumer was using the contentClient from DashboardStart and this PR also updates that consumer.

@dominiqueclarke dominiqueclarke self-requested a review April 9, 2025 16:50
@nickpeihl nickpeihl added backport:version Backport to applied version labels v8.18.0 v8.19.0 v8.17.5 backport:skip This PR does not require backporting v9.1.0 release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. and removed backport:version Backport to applied version labels v8.18.0 v8.19.0 v8.17.5 backport:skip This PR does not require backporting labels Apr 9, 2025
@nickpeihl nickpeihl marked this pull request as ready for review April 9, 2025 18:02
@nickpeihl nickpeihl requested review from a team as code owners April 9, 2025 18:02
@nickpeihl nickpeihl added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// label Apr 9, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #10 / Event filter form Details and Conditions should change description
  • [job] [logs] Jest Integration Tests #6 / unrecognized task types should be no workload aggregator errors when there are removed task types

Metrics [docs]

✅ unchanged

History

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Apr 10, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

LGTM

@nickpeihl nickpeihl merged commit 72d18d8 into elastic:main Apr 10, 2025
37 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/14388117195

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [DOCS] Add minimal synthetic APIs (#214518)
- [Synthtrace] Fix wrong url build in the Kibana client (#217678)
- [APM][UI] Sort environment dropdown alphabetically (#217710)
- 🌊 Streams: Add experimental badge to nav entry (#217819)

Manual backport

To create the backport manually run:

node scripts/backport --pr 217586

Questions ?

Please refer to the Backport tool documentation

nickpeihl added a commit to nickpeihl/kibana that referenced this pull request Apr 11, 2025
…Start server api (elastic#217586)

## Summary

Changes the DashboardStart server api to provide a getContentClient
function.

In elastic#214788, we set the
`contentClient` returned from the content management register method
after start lifecycle of all plugins. This means the `contentClient`
returned from the `DashboardStart` contract was undefined. This PR
changes the start contract to provide a getContentClient function
instead.

Only one consumer was using the contentClient from DashboardStart and
this PR also updates that consumer.

(cherry picked from commit 72d18d8)

# Conflicts:
#	x-pack/solutions/observability/plugins/observability/server/routes/alerts/route.ts
@nickpeihl
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 14, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

nickpeihl added a commit that referenced this pull request Apr 15, 2025
…hboardStart server api (#217586) (#217989)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dashboards] Replace contentClient with getContentClient on
DashboardStart server api
(#217586)](#217586)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"nick.peihl@elastic.co"},"sourceCommit":{"committedDate":"2025-04-10T18:52:38Z","message":"[Dashboards]
Replace contentClient with getContentClient on DashboardStart server api
(#217586)\n\n## Summary\n\nChanges the DashboardStart server api to
provide a getContentClient\nfunction.\n\nIn
#214788, we set
the\n`contentClient` returned from the content management register
method\nafter start lifecycle of all plugins. This means the
`contentClient`\nreturned from the `DashboardStart` contract was
undefined. This PR\nchanges the start contract to provide a
getContentClient function\ninstead.\n\nOnly one consumer was using the
contentClient from DashboardStart and\nthis PR also updates that
consumer.","sha":"72d18d8b992c99bb0be42123406453f0379f29d8","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:plugin_api_changes","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0"],"title":"[Dashboards]
Replace contentClient with getContentClient on DashboardStart server
api","number":217586,"url":"https://github.com/elastic/kibana/pull/217586","mergeCommit":{"message":"[Dashboards]
Replace contentClient with getContentClient on DashboardStart server api
(#217586)\n\n## Summary\n\nChanges the DashboardStart server api to
provide a getContentClient\nfunction.\n\nIn
#214788, we set
the\n`contentClient` returned from the content management register
method\nafter start lifecycle of all plugins. This means the
`contentClient`\nreturned from the `DashboardStart` contract was
undefined. This PR\nchanges the start contract to provide a
getContentClient function\ninstead.\n\nOnly one consumer was using the
contentClient from DashboardStart and\nthis PR also updates that
consumer.","sha":"72d18d8b992c99bb0be42123406453f0379f29d8"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217586","number":217586,"mergeCommit":{"message":"[Dashboards]
Replace contentClient with getContentClient on DashboardStart server api
(#217586)\n\n## Summary\n\nChanges the DashboardStart server api to
provide a getContentClient\nfunction.\n\nIn
#214788, we set
the\n`contentClient` returned from the content management register
method\nafter start lifecycle of all plugins. This means the
`contentClient`\nreturned from the `DashboardStart` contract was
undefined. This PR\nchanges the start contract to provide a
getContentClient function\ninstead.\n\nOnly one consumer was using the
contentClient from DashboardStart and\nthis PR also updates that
consumer.","sha":"72d18d8b992c99bb0be42123406453f0379f29d8"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 15, 2025
@florent-leborgne
Copy link
Copy Markdown
Member

@nickpeihl just out of curiosity, what is the release_note:plugin_api_changes used for?

@nickpeihl
Copy link
Copy Markdown
Contributor Author

@florent-leborgne In the context of this PR, we changed how our built-in plugins can access the CRUD client from the dashboard. It is probably not worth noting in our release notes as the changes should not impact external users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants