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

fix(slo): Optimistic updates #176548

Merged
merged 8 commits into from
Feb 8, 2024
Merged

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Feb 8, 2024

🌮 Summary

This PR removes the broken optimistic updates we had in our various react query mutations for SLOs, namely useCreateSlo, useUpdateSlo, useResetSlo and useDeleteSlo. We are removing them for a few reasons:

  1. useCreateSlo optimistic update was not used since we wait for the response before creating the rule and then redirecting to the list page.
  2. useDeleteSlo optimistic update was broken, and deleted SLO was not removed until refresh of the page.
  3. useUpdateSlo was not updating the page neither.
  4. With the groupBy feature, the optimistic updates require more complexity (more requests to optimistically update/manage)

I've also notice usage of a useMutation for a non mutation API (_inspect), therefore I've changed the hook to use a useQuery instead. I had to change how this useMutation was then use in the InspectSlo flyout component.

I've also updated the EquivalentAPIRequest to handle the edit form flow, and show the correct API verb and URI.

🧪 Testing

  • Create some SLOs
  • Update some SLOs
  • Delete some SLOs
  • Inspect an SLO while creating
  • Inspect an SLO while updating
  • Check API Equivalent while creating
  • Check API Equivalent while updating

@apmmachine
Copy link
Contributor

🤖 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!)

@kdelemme kdelemme added v8.13.0 release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team Feature:SLO labels Feb 8, 2024
@kdelemme kdelemme self-assigned this Feb 8, 2024
@kdelemme
Copy link
Contributor Author

kdelemme commented Feb 8, 2024

/ci

@kdelemme
Copy link
Contributor Author

kdelemme commented Feb 8, 2024

/ci

@kdelemme
Copy link
Contributor Author

kdelemme commented Feb 8, 2024

/ci

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 597 596 -1

Async chunks

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

id before after diff
observability 637.3KB 635.4KB -1.9KB

History

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

cc @kdelemme

Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

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

LGTM

@kdelemme kdelemme marked this pull request as ready for review February 8, 2024 22:25
@kdelemme kdelemme requested a review from a team as a code owner February 8, 2024 22:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@kdelemme kdelemme merged commit 8e53ee3 into elastic:main Feb 8, 2024
16 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 8, 2024
@kdelemme kdelemme deleted the fix/optimistic-updates branch February 8, 2024 22:40
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
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:SLO release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants