-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[HTTP/OAS] Prepare @kbn/config-schema
for generating OAS
#180184
[HTTP/OAS] Prepare @kbn/config-schema
for generating OAS
#180184
Conversation
/ci |
/ci |
} | ||
}) | ||
) | ||
.meta({ [META_FIELD_X_OAS_MIN_LENGTH]: options.minLength }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* These fields are used in Joi meta to capture additional information used | ||
* by OpenAPI spec generator. | ||
*/ | ||
export const META_FIELD_X_OAS_OPTIONAL = 'x-oas-optional' as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the x-
prefix is expected by our partner lib https://www.npmjs.com/package/joi-to-json (to be introduced in a follow up PR)
Pinging @elastic/kibana-core (Team:Core) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to tell given the PR does not utilize the added meta, but LGTM.
Given how joi schema definitions are in the hot path at startup (due to all routes schemas being defined around that time), we may want to make sure that the addition of those meta fields aren't impacting the schema definition time significantly (I assume it doesn't, but better safe than sorry)
@pgayvallet I tested for performance regression using Total on Total with meta changes 11203ms I saw variation of +1.5sec on both across multiple runs so I'm not sure how reliable this is. I noticed a fair amount of variance in Overall this branch did not seem to introduce a clear performance regression. Though I do expect we How I tested: diff --git a/packages/core/root/core-root-server-internal/src/bootstrap.ts b/packages/core/root/core-root-server-internal/src/bootstrap.ts
index aea90c81f47..a23bfd1373f 100644
--- a/packages/core/root/core-root-server-internal/src/bootstrap.ts
+++ b/packages/core/root/core-root-server-internal/src/bootstrap.ts
@@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
+console.profile('setup 2');
+
import chalk from 'chalk';
import { getPackages } from '@kbn/repo-packages';
import { CliArgs, Env, RawConfigService } from '@kbn/config';
@@ -117,6 +119,7 @@ export async function bootstrap({ configs, cliArgs, applyConfigOverrides }: Boot
}
await root.setup();
+ console.profileEnd('setup 2');
await root.start();
// Notify parent process if we haven't done that yet during preboot stage.
Then started Kibana using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response Ops changes LGTM
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Introduces a set of meta fields that will be used to track metadata lost in how we currently use
joi
inside of@kbn/config-schema
.Notes