Skip to content

chore(rca): notes management without investigation store#190623

Merged
kdelemme merged 17 commits intoelastic:mainfrom
kdelemme:rca/handle-notes
Aug 19, 2024
Merged

chore(rca): notes management without investigation store#190623
kdelemme merged 17 commits intoelastic:mainfrom
kdelemme:rca/handle-notes

Conversation

@kdelemme
Copy link
Copy Markdown
Contributor

@kdelemme kdelemme commented Aug 15, 2024

Resolves ?

Summary

This PR removes the usage of the original investigation hook & store to manage the notes. It also uses the real user of the request to populate the createdBy field of the investigation and note.
We refresh the list of notes on creation/deletion (technically, react should not re-render the existing notes, but need to double check), and refresh automatically every 60 10 seconds (should we do it more often)?
Finally, user can only delete their own notes at the moment.

Testing

  1. Create an investigation (either from the API, or from an alert)
  2. Add a note
  3. Connect with another user created for the occasion, and go to the investigation.
  4. Add a note with the other user
  5. Notes should be sync within 10s

Screenshot

image

@kdelemme kdelemme marked this pull request as ready for review August 15, 2024 15:41
@kdelemme kdelemme requested a review from a team as a code owner August 15, 2024 15:41
@obltmachine
Copy link
Copy Markdown

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@kdelemme kdelemme added release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v8.16.0 labels Aug 15, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@botelastic botelastic Bot added the ci:project-deploy-observability Create an Observability project label Aug 15, 2024
@jasonrhodes
Copy link
Copy Markdown
Member

refresh automatically every 60 seconds (should we do it more often)

I expect this to be a fairly light-weight look up in most cases? If so, every 10s would be great.

@mgiota mgiota self-requested a review August 19, 2024 13:38

const deleteInvestigationNoteParamsSchema = t.type({
path: t.type({
id: t.string,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe rename to investigationId

},
{
onSuccess: (response, {}) => {
toasts.addSuccess('Note deleted');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we need i18n here

refetchIntervalInBackground: true,
onError: (error: Error) => {
toasts.addError(error, {
title: 'Something went wrong while fetching investigation notes',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i18n here

Copy link
Copy Markdown
Contributor

@mgiota mgiota left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the pair review, you brought me up to speed!

@kdelemme kdelemme enabled auto-merge (squash) August 19, 2024 21:18
@mgiota
Copy link
Copy Markdown
Contributor

mgiota commented Aug 19, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

kibana-ci commented Aug 19, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
investigate 21 17 -4
investigateApp 523 500 -23
total -27

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/investigation-shared 25 29 +4
investigate 111 94 -17
total -13

Async chunks

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

id before after diff
investigateApp 433.1KB 347.8KB -85.3KB

Page load bundle

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

id before after diff
investigate 9.1KB 7.3KB -1.8KB
investigateApp 13.1KB 13.0KB -50.0B
total -1.9KB
Unknown metric groups

API count

id before after diff
@kbn/investigation-shared 25 29 +4
investigate 111 94 -17
total -13

ESLint disabled line counts

id before after diff
investigate 1 0 -1

Total ESLint disabled count

id before after diff
investigate 3 2 -1

History

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

@kdelemme kdelemme merged commit 201c9d3 into elastic:main Aug 19, 2024
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Aug 19, 2024
@kdelemme kdelemme deleted the rca/handle-notes branch August 20, 2024 00:15
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 ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants