Skip to content

Upgrade @elastic charts in Kibana

Marco Vettorello edited this page Dec 1, 2022 · 2 revisions

Kibana use RenovateBot to automatically create a PRs with the updated dependencies. We should use the bot PRs and push any commits that are required to solve possible breaking changes (the bot will stop updating the PR with a newer version if you pushed a commit to that branch).

  1. Check if the RenovateBot has already created a PR for the newer version here: renovate bot dependencies GH issue or here list of all PRs. If you don't find the PR, create one from scratch using this PR as an example. Please use the following title if we are just upgrading the library: Update dependency @elastic/charts to vx.x.x If the upgrade fixes just a specific issue, then you can use a more specific title like: [TSVB] Fix wrongly display stacked as percentage charts

  2. Apply, at least, the following labels and any other that may apply: Feature:ElasticCharts, dependencies, Team: Visualizations, and the release_note:skip if the features/fixes are not directly visible to Kibana

  3. Check the PR description, in particular, the Release Notes to see if everything is correctly reported (I've seen sometimes issues with the Release Notes not correctly picked up by the bot). Release notes should be germane to fixes to features related to Kibana, not @elastic/charts.

  4. Fixing failures and breaking changes:

    1. if we are upgrading to a minor or a patch version and failures appear on the CI, please open an issue in the elastic-chart repo reporting if that failure is directly related to elastic-charts. We should strictly follow the semantic versioning, so if on a minor or a patch release there are issues with the code, maybe something is slipped through the public API and we didn't publish correctly a breaking change release.
    2. If we are upgrading a major release it's probable that we are getting at least one failure on the CI. Check the failure and its relation with elastic-charts and try to fix them on the PR branch.
    3. A failure maybe not be directly picked by the CI due to missing tests. A manual check on every breaking change is always required. The easiest way is to manually check the current implementation details on the Kibana repo where the elastic-chart library is used: search through the repo for every library import from '@elastic/charts and check the code against the breaking changes of the library (i.e. Lens, dashboard, TSVB, etc.). NOTE: there can be existing code that uses elastic-charts in a js code where you will never get type errors if something is changed. So please check also those codes manually to see if you can spot non-detected breaking changes (here for example ml is using our typing to render a similar tooltip, but the code that generates the tooltip data is under pure js files https://github.com/elastic/kibana/pull/60578/commits/ec827791cc5abee8cafd244d4a5f79032296fa30) . CSS breaking changes, like changing a classname can also slip through the CI. Check the library for any of these breaking changes and apply them to Kibana.
    4. The PR will automatically request the review of every team involved in the changes made, but you can also ping directly the author of the chart implementation.
    5. If the breaking changes are relative to a visual change, like a different look-and-feel, a different default value on the APIs, etc, please check if the visual change also applies to each chart implementation, describe the visual change on the PR, and ping each chart consumer involved asking to double-check the change, revert that change on the Kibana code if requested. (note: we should write a quick guide on how to test each chart implementation ourselves on a running Kibana instance. Actually, it's not that easy due to the need for a different type of dataset on each specific case, but we should find an easy way to check that)
    6. Merge the PR only when we got a review of each team involved.
    7. Backport the PR if necessary following the backporting guide. Do not backport a major version into a maintenance branch, just merge it into master and the previous minor version

FAQ

  1. Update the usual failing test DonutChart
cd x-pack
node ./scripts/jest.js ./plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart.test.tsx