Skip to content

Conversation

@chrisbmar
Copy link
Contributor

@chrisbmar chrisbmar commented Sep 19, 2025

Summary

Adds doclinks for the onechat app, relates to https://github.com/elastic/search-team/issues/11083

@chrisbmar chrisbmar requested review from a team as code owners September 19, 2025 12:55
@chrisbmar chrisbmar added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Sep 19, 2025
readonly datasetQuality: {
readonly failureStore: string;
};
readonly onechat: {
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: agentBuilder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhhhh man

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think we should change this? We still have Onechat references in code all the way through the onechat/ folder? Just wondering if we should change individual things atm or whether at some point we should do a pass and change everything onechat --> agent builder? @joemcelroy

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say let's just worry about the new references for now. We'll purge onechat later on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good. I've updated the references and I've added all the links.

So, let's get this one merged in, then you can get it into your PR and consume the url's, wdyt @zacharyparikh ?

@leemthompo
Copy link
Contributor

not sure why using {ELASTIC_WEBSITE_URL} instead of {ELASTIC_DOCS} but probably not huge deal 😄

@chrisbmar chrisbmar force-pushed the agent-builder-doclinks-11083 branch from 7ac706e to 3c38cec Compare September 19, 2025 13:42
@chrisbmar
Copy link
Contributor Author

chrisbmar commented Sep 19, 2025

@leemthompo

good feedback and spot! Updated 😄

@chrisbmar chrisbmar enabled auto-merge (squash) September 19, 2025 13:55
@zacharyparikh
Copy link
Contributor

CI failing because of bundle size

ERROR Metric overages:
--
  | page load bundle size > onechat with value of 15750 is greater than the limit of 15709

@joemcelroy Should we up the limit again here?

@chrisbmar chrisbmar force-pushed the agent-builder-doclinks-11083 branch from b316497 to 3ae55b1 Compare September 19, 2025 15:15
@chrisbmar chrisbmar requested a review from a team as a code owner September 19, 2025 15:15
@chrisbmar chrisbmar force-pushed the agent-builder-doclinks-11083 branch from 3ae55b1 to d815acc Compare September 19, 2025 15:17
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

packages/kbn-optimizer/limits.yml LGTM

@zacharyparikh
Copy link
Contributor

@elasticmachine merge upstream

@zacharyparikh
Copy link
Contributor

@elasticmachine merge upstream

@zacharyparikh
Copy link
Contributor

@elasticmachine merge upstream

@zacharyparikh
Copy link
Contributor

/ci

1 similar comment
@chrisbmar
Copy link
Contributor Author

/ci

@zacharyparikh
Copy link
Contributor

Failing test is being skipped now

@zacharyparikh
Copy link
Contributor

@elasticmachine merge upstream

@chrisbmar chrisbmar merged commit f69f928 into elastic:main Sep 20, 2025
13 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
onechat 576 577 +1

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/doc-links 85 86 +1

Async chunks

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

id before after diff
aiAssistantManagementSelection 78.8KB 79.4KB +641.0B
lists 126.6KB 127.2KB +641.0B
total +1.3KB

Page load bundle

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

id before after diff
core 503.5KB 504.1KB +641.0B
onechat 14.5KB 15.4KB +947.0B
total +1.6KB
Unknown metric groups

API count

id before after diff
@kbn/doc-links 85 86 +1

History

dgieselaar added a commit that referenced this pull request Sep 23, 2025
Closes #235079

Lazily instantiate core mocks, to relieve memory pressure. This has the
benefit of tests using less memory usage, and thus us being able to run
them in parallel without upsizing our CI workers, and CPU time spent on
garbage collection goes down. Here's how it affects one of the alerting
plugin test files, significant improvements across the board:

```stdout
Benchmark diff: cwd -> f69f92
cwd: [Jest] Lazily instantiate mocks
f69f92: [Agent Builder] Setup doclinks structure (#235804)
alerting-plugin-test
-
                         cwd            f69f92                    Δ                   CI 
 Duration         6.3s ±1.7%        7.0s ±1.8%       711ms (+11.3%)    95%, +7.9%–+14.8% 
 CPU Usage        6.5s ±2.0%        7.4s ±2.1%       852ms (+13.1%)    95%, +9.1%–+17.2% 
 Max RSS     857.90 MB ±1.3%   977.20 MB ±2.4%   119.30 MB (+13.9%)   95%, +10.3%–+17.6% 
 GC time         190ms ±4.4%       252ms ±3.4%        62ms (+32.6%)   95%, +23.8%–+42.0%
 ```
 
### How it works

Core mocks are instantiated using `lazyObject`. This is a helper utility that will be rewritten using a Babel plugin to create annotated getters that will only instantiate the mock when it is accessed.

### Why it helps

Core mocks are eagerly created, and this means that many objects will be allocated. Specifically, jest will keep mocks in a global registry to support `jest.clearAllMocks()`. This means only when a test file completes these functions will be garbage collected. Increased memory consumption has two consequences that are relevant in this context:

- they increase memory pressure, which means garbage collection has to run more frequently to prevent the process from running out of memory
- our CI workers (that run Jest tests) have 16gb of memory. running jest configs in parallel means that there currently is a risk that either the processes themselves run out of memory, or the agent will. if we reduce memory usage, we can run them in parallel.

---------

Co-authored-by: kibanamachine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
Closes elastic#235079

Lazily instantiate core mocks, to relieve memory pressure. This has the
benefit of tests using less memory usage, and thus us being able to run
them in parallel without upsizing our CI workers, and CPU time spent on
garbage collection goes down. Here's how it affects one of the alerting
plugin test files, significant improvements across the board:

```stdout
Benchmark diff: cwd -> f69f92
cwd: [Jest] Lazily instantiate mocks
f69f92: [Agent Builder] Setup doclinks structure (elastic#235804)
alerting-plugin-test
-
                         cwd            f69f92                    Δ                   CI 
 Duration         6.3s ±1.7%        7.0s ±1.8%       711ms (+11.3%)    95%, +7.9%–+14.8% 
 CPU Usage        6.5s ±2.0%        7.4s ±2.1%       852ms (+13.1%)    95%, +9.1%–+17.2% 
 Max RSS     857.90 MB ±1.3%   977.20 MB ±2.4%   119.30 MB (+13.9%)   95%, +10.3%–+17.6% 
 GC time         190ms ±4.4%       252ms ±3.4%        62ms (+32.6%)   95%, +23.8%–+42.0%
 ```
 
### How it works

Core mocks are instantiated using `lazyObject`. This is a helper utility that will be rewritten using a Babel plugin to create annotated getters that will only instantiate the mock when it is accessed.

### Why it helps

Core mocks are eagerly created, and this means that many objects will be allocated. Specifically, jest will keep mocks in a global registry to support `jest.clearAllMocks()`. This means only when a test file completes these functions will be garbage collected. Increased memory consumption has two consequences that are relevant in this context:

- they increase memory pressure, which means garbage collection has to run more frequently to prevent the process from running out of memory
- our CI workers (that run Jest tests) have 16gb of memory. running jest configs in parallel means that there currently is a risk that either the processes themselves run out of memory, or the agent will. if we reduce memory usage, we can run them in parallel.

---------

Co-authored-by: kibanamachine <[email protected]>
niros1 pushed a commit that referenced this pull request Sep 30, 2025
Closes #235079

Lazily instantiate core mocks, to relieve memory pressure. This has the
benefit of tests using less memory usage, and thus us being able to run
them in parallel without upsizing our CI workers, and CPU time spent on
garbage collection goes down. Here's how it affects one of the alerting
plugin test files, significant improvements across the board:

```stdout
Benchmark diff: cwd -> f69f92
cwd: [Jest] Lazily instantiate mocks
f69f92: [Agent Builder] Setup doclinks structure (#235804)
alerting-plugin-test
-
                         cwd            f69f92                    Δ                   CI 
 Duration         6.3s ±1.7%        7.0s ±1.8%       711ms (+11.3%)    95%, +7.9%–+14.8% 
 CPU Usage        6.5s ±2.0%        7.4s ±2.1%       852ms (+13.1%)    95%, +9.1%–+17.2% 
 Max RSS     857.90 MB ±1.3%   977.20 MB ±2.4%   119.30 MB (+13.9%)   95%, +10.3%–+17.6% 
 GC time         190ms ±4.4%       252ms ±3.4%        62ms (+32.6%)   95%, +23.8%–+42.0%
 ```
 
### How it works

Core mocks are instantiated using `lazyObject`. This is a helper utility that will be rewritten using a Babel plugin to create annotated getters that will only instantiate the mock when it is accessed.

### Why it helps

Core mocks are eagerly created, and this means that many objects will be allocated. Specifically, jest will keep mocks in a global registry to support `jest.clearAllMocks()`. This means only when a test file completes these functions will be garbage collected. Increased memory consumption has two consequences that are relevant in this context:

- they increase memory pressure, which means garbage collection has to run more frequently to prevent the process from running out of memory
- our CI workers (that run Jest tests) have 16gb of memory. running jest configs in parallel means that there currently is a risk that either the processes themselves run out of memory, or the agent will. if we reduce memory usage, we can run them in parallel.

---------

Co-authored-by: kibanamachine <[email protected]>
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
Closes elastic#235079

Lazily instantiate core mocks, to relieve memory pressure. This has the
benefit of tests using less memory usage, and thus us being able to run
them in parallel without upsizing our CI workers, and CPU time spent on
garbage collection goes down. Here's how it affects one of the alerting
plugin test files, significant improvements across the board:

```stdout
Benchmark diff: cwd -> f69f92
cwd: [Jest] Lazily instantiate mocks
f69f92: [Agent Builder] Setup doclinks structure (elastic#235804)
alerting-plugin-test
-
                         cwd            f69f92                    Δ                   CI 
 Duration         6.3s ±1.7%        7.0s ±1.8%       711ms (+11.3%)    95%, +7.9%–+14.8% 
 CPU Usage        6.5s ±2.0%        7.4s ±2.1%       852ms (+13.1%)    95%, +9.1%–+17.2% 
 Max RSS     857.90 MB ±1.3%   977.20 MB ±2.4%   119.30 MB (+13.9%)   95%, +10.3%–+17.6% 
 GC time         190ms ±4.4%       252ms ±3.4%        62ms (+32.6%)   95%, +23.8%–+42.0%
 ```
 
### How it works

Core mocks are instantiated using `lazyObject`. This is a helper utility that will be rewritten using a Babel plugin to create annotated getters that will only instantiate the mock when it is accessed.

### Why it helps

Core mocks are eagerly created, and this means that many objects will be allocated. Specifically, jest will keep mocks in a global registry to support `jest.clearAllMocks()`. This means only when a test file completes these functions will be garbage collected. Increased memory consumption has two consequences that are relevant in this context:

- they increase memory pressure, which means garbage collection has to run more frequently to prevent the process from running out of memory
- our CI workers (that run Jest tests) have 16gb of memory. running jest configs in parallel means that there currently is a risk that either the processes themselves run out of memory, or the agent will. if we reduce memory usage, we can run them in parallel.

---------

Co-authored-by: kibanamachine <[email protected]>
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 release_note:skip Skip the PR/issue when compiling release notes v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants