Skip to content

[Fleet] fix UI error when entering an invalid semver#179631

Merged
juliaElastic merged 4 commits intoelastic:mainfrom
juliaElastic:fix-upgrade-ui-error
Apr 2, 2024
Merged

[Fleet] fix UI error when entering an invalid semver#179631
juliaElastic merged 4 commits intoelastic:mainfrom
juliaElastic:fix-upgrade-ui-error

Conversation

@juliaElastic
Copy link
Copy Markdown
Contributor

Summary

Closes #179592

The UI calls the semver version check functions on every keystroke, it seems the semver functions throw error if the input is not a valid semver (e.g. 8.14 instead of 8.14.0). Added try-catch around the logic which is called from the UI.

To verify:

  • run a stack 8.14.0-SNAPSHOT with fleet-server
  • enroll an agent with version 8.13.0
  • upgrade agent, type in 8.14
  • verify that the UI error is no longer visible
  • the submit button should only be enabled if typing a valid semver e.g. 8.14.0
image image

Checklist

@juliaElastic juliaElastic self-assigned this Mar 28, 2024
@juliaElastic juliaElastic requested a review from a team as a code owner March 28, 2024 14:24
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 28, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@ghost
Copy link
Copy Markdown

ghost commented Mar 28, 2024

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@nchaulet nchaulet self-requested a review March 28, 2024 14:29
Copy link
Copy Markdown
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

code LGTM 🚀
I am wondering if we can improve this by adding a validation message in the UI with a regex so use can figure why they cannot click on upgrade?

@juliaElastic juliaElastic added release_note:skip Skip the PR/issue when compiling release notes and removed backport:prev-minor release_note:fix labels Mar 28, 2024
@juliaElastic
Copy link
Copy Markdown
Contributor Author

Found that this code was added only in 8.14, so no need to backport and release note: #178079

@juliaElastic
Copy link
Copy Markdown
Contributor Author

@nchaulet Added UI validation to show a message if the entered version is not a valid semver:
image

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

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
fleet 1.2MB 1.2MB +297.0B

Page load bundle

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

id before after diff
fleet 158.1KB 158.2KB +53.0B

History

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

cc @juliaElastic

@juliaElastic juliaElastic merged commit a1abf16 into elastic:main Apr 2, 2024
@kibanamachine kibanamachine added v8.14.0 backport:skip This PR does not require backporting labels Apr 2, 2024
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 Team:Fleet Team label for Observability Data Collection Fleet team v8.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet]: Red banner on Agents tab is observed on typing 8.14 under Upgrade agent flyout.

5 participants