Skip to content

[Emotion] Use patched Emotion library to resolve Flyout System issue#256086

Merged
tsullivan merged 8 commits intoelastic:mainfrom
tsullivan:emotion-fix/insertBefore-crash
Mar 7, 2026
Merged

[Emotion] Use patched Emotion library to resolve Flyout System issue#256086
tsullivan merged 8 commits intoelastic:mainfrom
tsullivan:emotion-fix/insertBefore-crash

Conversation

@tsullivan
Copy link
Copy Markdown
Member

@tsullivan tsullivan commented Mar 4, 2026

Summary

Closes #255318

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • [ ] Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • [ ] Flaky Test Runner was used on any tests changed
  • [ ] The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • [ ] Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

  • Added a resolution field for @emotion/sheet to use an Elastic fork (see diff). We trust any issue this may add can be caught by functional tests, especially the new one added.

@tsullivan tsullivan changed the title [Emotion] Use patched @emotion/sheet library [Emotion] Use patched Emotion library to resolve Flyout System issue Mar 4, 2026
@tkajtoch
Copy link
Copy Markdown
Member

tkajtoch commented Mar 5, 2026

@elasticmachine merge upstream

@tkajtoch tkajtoch added the ci:project-deploy-observability Create an Observability project label Mar 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@tkajtoch
Copy link
Copy Markdown
Member

tkajtoch commented Mar 5, 2026

The snapshot failures come from isSpeedy defaulting to true in production environments. This is already the case in Kibana (see src), but old Enzyme tests that import directly from enzyme and don't wrap the JSX in necessary providers result in their snapshots being slightly different.

The real difference is that in the original package (1.2.2), Emotion checks process.env.NODE_ENV === 'production' (src), which results in false in Kibana test environment, while the latest version got refactored to use an import directive (src) that checks whether NODE_ENV is set to 'development' - pretty much the same thing, but better, because it keeps all non-development environments in sync.

Considering these are just a few snapshots, I'm tempted to just update them so that the tests reflect what's in production builds.

@tsullivan
Copy link
Copy Markdown
Member Author

Considering these are just a few snapshots, I'm tempted to just update them so that the tests reflect what's in production builds.

Thanks @tkajtoch. I concluded the same thing I have updated the test snapshots.

Earlier this week I sent an email to Kibana contributors asking them to migrate away from tests that assert snapshots of rendered components as this type of this is low-value and brittle. Hopefully as people migrate away from Enzyme they can do so in a way that replaces snapshot tests with things that verify component behaviors with RTL.

@tsullivan tsullivan marked this pull request as ready for review March 5, 2026 18:18
@tsullivan tsullivan requested review from a team as code owners March 5, 2026 18:18
@tsullivan tsullivan added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Mar 5, 2026
Copy link
Copy Markdown
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

Obs exploration changes LGTM

Copy link
Copy Markdown
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Ran through the Scout test scenario manually to verify. Data Discovery changes LGTM 👍 Thanks for all the investigation here and fixing this!

@tsullivan
Copy link
Copy Markdown
Member Author

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10984

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 15/15 tests passed.

see run 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.

kibana-presentation changes LGTM - jest snapshot update
code review only

@tsullivan tsullivan enabled auto-merge (squash) March 6, 2026 15:26
@tsullivan
Copy link
Copy Markdown
Member Author

/ci

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Mar 7, 2026

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 06dffb5
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-256086-06dffb50612c

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/scout 252 253 +1
@kbn/scout-oblt 258 259 +1
@kbn/scout-search 247 248 +1
@kbn/scout-security 262 263 +1
total +4

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/scout 34 35 +1

Page load bundle

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

id before after diff
kbnUiSharedDeps-npmDll 7.1MB 7.1MB +69.0B
Unknown metric groups

API count

id before after diff
@kbn/scout 658 659 +1
@kbn/scout-oblt 649 650 +1
@kbn/scout-search 638 639 +1
@kbn/scout-security 653 654 +1
total +4

History

@tsullivan tsullivan merged commit f3bf285 into elastic:main Mar 7, 2026
20 checks passed
@tsullivan tsullivan deleted the emotion-fix/insertBefore-crash branch March 8, 2026 03:24
kapral18 pushed a commit to kapral18/kibana that referenced this pull request Mar 9, 2026
…lastic#256086)

## Summary

Closes elastic#255318


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- ~[ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~
- ~[ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- ~[ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- ~[ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.~
- ~[ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed~
- ~[ ] The PR description includes the appropriate Release Notes
section, and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~
- ~[ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.~

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [x] Added a `resolution` field for `@emotion/sheet` to use an [Elastic
fork](https://github.com/elastic/emotion) ([see
diff](emotion-js/emotion@main...elastic:emotion:main)).
We trust any issue this may add can be caught by functional tests,
especially the new one added.

---------

Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
…lastic#256086)

## Summary

Closes elastic#255318


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- ~[ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~
- ~[ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- ~[ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- ~[ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.~
- ~[ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed~
- ~[ ] The PR description includes the appropriate Release Notes
section, and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~
- ~[ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.~

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [x] Added a `resolution` field for `@emotion/sheet` to use an [Elastic
fork](https://github.com/elastic/emotion) ([see
diff](emotion-js/emotion@main...elastic:emotion:main)).
We trust any issue this may add can be caught by functional tests,
especially the new one added.

---------

Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flyout System] "NotFoundError: Failed to execute 'insertBefore' on 'Node'

10 participants