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

Stricter byte size validation #193529

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Stricter byte size validation #193529

merged 1 commit into from
Sep 20, 2024

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Sep 20, 2024

Summary

This makes byte size validation stricter by ensuring that the string starts and ends with valid values so it won't match on e.g. a1234b or 1234ba.

This has a slight chance to fail validation on an existing kibana.yml if users had a typo that we previously ignored. As such it would be safer to not backport to 8.x

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc backport:skip This commit does not require backporting v9.0.0 labels Sep 20, 2024
@rudolf rudolf requested a review from a team as a code owner September 20, 2024 10:14
@elasticmachine
Copy link
Contributor

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

@rudolf rudolf added the release_note:skip Skip the PR/issue when compiling release notes label Sep 20, 2024
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
enterpriseSearch 2.6MB 2.6MB +91.0B
serverlessSearch 327.2KB 327.3KB +91.0B
total +182.0B

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

@rudolf rudolf merged commit c3617a6 into elastic:main Sep 20, 2024
37 checks passed
@rudolf rudolf deleted the stricter-byte-size branch September 20, 2024 13:37
rudolf added a commit that referenced this pull request Nov 20, 2024
## Summary

Inspired by #193529 but does not
change the regular expression, it only limits the string length which is
anyway the biggest performance improvement. This makes it a lot safer to
backport since it's less likely that we could break existing kibana
configurations that had typos.


### Checklist

### Identify risks

- [ ] Could cause a Kibana to refuse to start up after an upgrade if it had a byte size configuration value that was excessively long.
rudolf added a commit to rudolf/kibana that referenced this pull request Nov 20, 2024
## Summary

Inspired by elastic#193529 but does not
change the regular expression, it only limits the string length which is
anyway the biggest performance improvement. This makes it a lot safer to
backport since it's less likely that we could break existing kibana
configurations that had typos.

### Checklist

### Identify risks

- [ ] Could cause a Kibana to refuse to start up after an upgrade if it had a byte size configuration value that was excessively long.

(cherry picked from commit b476f7f)

# Conflicts:
#	packages/kbn-config-schema/src/byte_size_value/index.test.ts
#	packages/kbn-config-schema/src/byte_size_value/index.ts
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 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 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants