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

Y24-339 - Pacbio pools store migration from axios to native fetch to reduce dependencies and increase maintainability. #1961

Open
14 tasks
seenanair opened this issue Sep 24, 2024 · 0 comments
Labels
Size: S Small - low effort & risk Technical Debt Technical debt Traction Stories related to Traction application Value: 3 Value to the insitute is average

Comments

@seenanair
Copy link
Contributor

seenanair commented Sep 24, 2024

Describe the Housekeeping

The goal of this task is to improve the codebase by reducing dependencies and increasing maintainability. Specifically, we will refactor the Pacbio Pools store to use fetch instead of axios, and create test factories to replace fixture data.

  1. Refactor the Pacbio pools store so that it uses fetch instead of axios : The primary reason for switching from axios to fetch is to minimize the use of external libraries wherever possible. By using the native fetch API, we reduce dependency on third-party libraries, which simplifies the codebase and makes it easier to maintain in the long run.

  2. Create and use test factories instead of test files : Introducing test factories instead of manually maintaining test files and fixtures helps avoid duplication of fixture data between unit and e2e tests. This makes the testing process more consistent, maintainable, and easier to update when changes are made in the codebase. The factory will generate standardized test data across different tests, streamlining the testing process and reducing potential errors caused by inconsistent data.

The major tasks involve:

  • Create a factory (example: https://github.com/sanger/traction-ui/pull/1756/files#diff-c5d273e6d7069f315f8d62842f5753d1599be7c0799f26fb6199392203007f2c)
  • plug factory into tests ( doing this first will ensure that when we change the code we kow what the failures are related to)
  • rationalise any use of test data e.g. reduce places where it is used. Standardise where possible
  • Change handleResponse from v1 to v2 in store or library
  • some stores use the old response type with deserialize - so you would need to move over to the new response type and use side loading
  • make sure you only use relative namespacing for imports because Cypress does not have access to @.
  • make sure you use file extensions e.g. .js at the end of the import name as this improves performance.
  • Change request from v1 to v2
  • Fix unit tests
  • Run tests for any components where store or library is used and make any changes and fix
  • Run tests for any views where store or library is used and make any changes and fix
  • Fixe e2e tests
  • Remove use of fixtures where store or library is used and use factory
  • Remove data file and fixture

Blocking issues
Describe any other issues or tickets that may be blocking this change.

Additional context
Y24-138 - As developers we want to move over all requests from Axios to fetch to remove a dependency and make the codebase easier to maintain

@seenanair seenanair added Traction Stories related to Traction application Technical Debt Technical debt labels Sep 24, 2024
@psd-issuer psd-issuer bot changed the title Pacbio pools store migration from axios to fetch Y24-339 - Pacbio pools store migration from axios to fetch Sep 24, 2024
@seenanair seenanair added Size: M Medium - medium effort & risk Value: 3 Value to the insitute is average Size: S Small - low effort & risk and removed Size: M Medium - medium effort & risk labels Sep 24, 2024
@seenanair seenanair changed the title Y24-339 - Pacbio pools store migration from axios to fetch Y24-339 - Pacbio pool store migration from axios to fetch Sep 24, 2024
@seenanair seenanair changed the title Y24-339 - Pacbio pool store migration from axios to fetch Y24-339 - Pacbio pools store migration from axios to fetch Sep 24, 2024
@seenanair seenanair changed the title Y24-339 - Pacbio pools store migration from axios to fetch Y24-339 - Pacbio pools store migration from axios to native fetch to reduce dependencies and increase maintainability. Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: S Small - low effort & risk Technical Debt Technical debt Traction Stories related to Traction application Value: 3 Value to the insitute is average
Projects
None yet
Development

No branches or pull requests

1 participant