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

Detect old Kibana UI on serverless server #162332

Closed
jloleysens opened this issue Jul 20, 2023 · 4 comments · Fixed by #163577
Closed

Detect old Kibana UI on serverless server #162332

jloleysens opened this issue Jul 20, 2023 · 4 comments · Fixed by #163577
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@jloleysens
Copy link
Contributor

jloleysens commented Jul 20, 2023

Since our thinking has evolved on the original issue here are my thoughts on technical details of an approach to just detecting old browsers/UIs on Kibana server.

On serverless we will be deploying versions "between" stack versions but we only communicate the stack version today (i.e. 8.9.0) via the kbn-version header.

Proposal for detecting old UIs

We modify the version being sent via kbn-version to something that can represent a new Kibana build (as opposed to just a new stack version). Top of my head I can imagine two approaches:

  1. We update the kbn-version value with a build number: something like 8.9.0+123abcdefg and keep it SemVer compliant.
  2. Change kbn-version to something entirely new like a build hash 123abcdefg, non SemVer compliant

I prefer (1), I also think it will be easier to implement as it remains largely compatible with how this value is used today, but I can also see a case for (2) in that "stack version" is not really a thing on serverless anymore.

Note: we have a way to get a unique build number for Kibana, this will be a number like 64910 not an actual commit SHA. In development we just set this to Node.js' max int. See:

https://github.com/elastic/kibana/blob/a39531edce1c59e18c1f5b77e62cf77ac5e43ef2/src/dev/build/lib/get_build_number.ts

Open to other ideas of course!

@botelastic botelastic bot added the needs-team Issues missing a team label label Jul 20, 2023
@jloleysens jloleysens added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Jul 20, 2023
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jul 20, 2023
@pgayvallet
Copy link
Contributor

pgayvallet commented Jul 24, 2023

Between the two listed options, I'd rather go with 1 too. The upsides I see is that we still know about the stack version, and call still properly infer the build number from the semver string, without any downsides I can think of.

I can also see a case for (2) in that "stack version" is not really a thing on serverless anymore

Yeah, but I don't think it matters much in the end. That header is an "internal" header that in theory is only used for kibana UI<->server communication, so it's value and format can probably be considered an implementation detail ihmo.

Note that an alternative would be to keep kbn-version and add the buildNum (or any value that could be used as a "serverless version") in a new, dedicated header, but I think it just introduces more complexity without any significant upsides, so I don't think that would be better in any way compared to the {semver}-{buildNum} approach.

@lukeelmers
Copy link
Member

Note that an alternative would to keep kbn-version and add the buildNum (or any value that could be used as a "serverless version") in a new, dedicated header,

I was going to suggest this as well. We now have the build hash included in the status API (in both serverless and self-managed iirc), so I could see a kbn-build-hash header making sense. But considering {version}+{buildNum} is still valid semver I think option 1 is fine too, so no strong feelings on this.

@rayafratkina
Copy link
Contributor

Related to #163671

jloleysens added a commit that referenced this issue Aug 16, 2023
Close #162332

### List

- [x] Add E2E test

---------

Co-authored-by: Kibana Machine <[email protected]>
hop-dev pushed a commit to hop-dev/kibana that referenced this issue Aug 16, 2023
…ic#163577)

Close elastic#162332

### List

- [x] Add E2E test

---------

Co-authored-by: Kibana Machine <[email protected]>
bryce-b pushed a commit that referenced this issue Aug 22, 2023
Close #162332

### List

- [x] Add E2E test

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants