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

[Security Solution][Investigations][Tech Debt] - Timeline Data Reducers #124161

Closed
9 tasks
michaelolo24 opened this issue Jan 31, 2022 · 2 comments
Closed
9 tasks
Labels
Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team technical debt Improvement of the software architecture and operational architecture

Comments

@michaelolo24
Copy link
Contributor

michaelolo24 commented Jan 31, 2022

Background:

We currently use the concept of containers (custom hooks that fetch data) within the security solution to allow data to be fetched and consumed from any component within the application. While this allows for a lot of flexibility, moving this data to a shared reducer would allow other parts of the application to react based on the existing data as well as unify on the one way data flow through redux to make it easier to reason about the application.

Details:

Reducers should be created to match state for each of the data sources below. Actions can then be created to fire off the api requests via middleware with any configurable fields and then stored in the reducer to be fetched via selectors across the application.

The containers for the timelines plugin are all located:

x-pack/plugins/security_solution/public/timelines/containers

  • /all
  • /details
  • /kpis
  • /local_storage
  • /notes
  • /pinned_events
  • api.ts
  • index.tsx

x-pack/plugins/timelines/container

  • /source
  • index
  • use_update_alerts

Acceptance Criteria:

  • Cypress Tests are added for any UI changes (https://docs.cypress.io/guides/guides/network-requests)
    • For all the referenced API's in
      • security_solution: all/, details/, kpis/, local_storage/, notes/, pinned_events/, api.ts, index.tsx
      • timelines: source/, index.tsx, use_update_alerts:
      • Add fixtures of successful API responses
      • Add fixtures for failed API responses
      • Test actions launched lead to the expected success and failure scenarios
      • Test calls are only made the correct # of times
  • Functional Tests are added for any server changes
  • Untested code paths should have unit tests added
  • The application functions as before
@michaelolo24 michaelolo24 added technical debt Improvement of the software architecture and operational architecture Team:Threat Hunting:Investigations Security Solution Investigations Team labels Jan 31, 2022
@michaelolo24 michaelolo24 changed the title [Security Solution][Investigations][Tech Debt] - Timeline data reducers [Security Solution][Investigations][Tech Debt] - Timeline Data Reducers Jan 31, 2022
@MindyRS MindyRS added the Team:Threat Hunting Security Solution Threat Hunting Team label Feb 23, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@michaelolo24
Copy link
Contributor Author

Closing in favor of: #124138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

3 participants