Skip to content
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] Switch default handler resolution based on Kibana config #155142

Merged

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Apr 18, 2023

Summary

When launching Kibana in serverless mode (i.e., with the --serverless=... flag we need to by default resolve to the newest request handlers, otherwise to the oldest request handler.

The approach taken in this PR is the same as with #154907.

Checklist

  • Add integration test

@jloleysens jloleysens added Feature:http Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes v8.8.0 labels Apr 18, 2023
@jloleysens jloleysens self-assigned this Apr 18, 2023
@jloleysens jloleysens force-pushed the serverless-flag-for-versioned-http-resolvers branch 4 times, most recently from bba7810 to 26a7dab Compare April 18, 2023 13:35
@jloleysens jloleysens force-pushed the serverless-flag-for-versioned-http-resolvers branch from 26a7dab to 06b1a88 Compare April 19, 2023 08:56
@@ -194,7 +194,7 @@ describe('Versioned route', () => {
);

const kibanaResponse = await handler!(
{ core: { env: { mode: { dev: true } } } } as any,
{} as any,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated to this PR, just cleaning up some unnecessary mock data

@jloleysens jloleysens marked this pull request as ready for review April 19, 2023 09:27
@jloleysens jloleysens requested a review from a team as a code owner April 19, 2023 09:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 432 435 +3

Total ESLint disabled count

id before after diff
securitySolution 512 515 +3

History

  • 💚 Build #120713 succeeded 26a7dabdff68399f62abaf333787fa0146863150
  • 💚 Build #120619 succeeded 5618f21734ad5d7df108cfb5b7ac8cdb0f4a0e0e

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jloleysens

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -142,7 +144,7 @@ export class Router<Context extends RequestHandlerContextBase = RequestHandlerCo
public readonly routerPath: string,
private readonly log: Logger,
private readonly enhanceWithContext: ContextEnhancer<any, any, any, any, any>,
private readonly options: RouterOptions = { isDev: false }
private readonly options: RouterOptions = { isDev: false, isServerless: false }
Copy link
Contributor

Choose a reason for hiding this comment

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

We could read the default from a pseudo-config file somewhere. Defaults set within a package are sometimes hard to track down.

@jloleysens jloleysens merged commit 517b0a0 into elastic:main Apr 20, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 20, 2023
@jloleysens jloleysens deleted the serverless-flag-for-versioned-http-resolvers branch April 20, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:http release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants