-
Notifications
You must be signed in to change notification settings - Fork 59
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
refactor: Remove ExecutionDataCache in favor of react-query #126
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BobNisco
approved these changes
Dec 4, 2020
schottra
added a commit
that referenced
this pull request
Jan 4, 2021
* refactor: first step of using queries for NE table * refactor: removing data cache from first layer of NE table * refactor: removing remaining execution data cache usage * refactor: rename QueryKey type and remove bug workaround * refactor: fixing remaining consumers of NEs
schottra
added a commit
that referenced
this pull request
Jan 5, 2021
* refactor: first step of using queries for NE table * refactor: removing data cache from first layer of NE table * refactor: removing remaining execution data cache usage * refactor: rename QueryKey type and remove bug workaround * refactor: fixing remaining consumers of NEs
schottra
added a commit
that referenced
this pull request
Jan 6, 2021
* refactor: integrate react-query for execution data fetching (#123) * refactor: using react-query to load top level Execution * refactor: upgrading react-query and fixing execution termination * refactor: handle 401s on queries and do auth flow * refactor: adding conditional refresh for execution status * refactor: cleanup broken files after context refactor * chore: docs * refactor: Remove ExecutionDataCache in favor of react-query (#126) * refactor: first step of using queries for NE table * refactor: removing data cache from first layer of NE table * refactor: removing remaining execution data cache usage * refactor: rename QueryKey type and remove bug workaround * refactor: fixing remaining consumers of NEs * test: adds setup for mock-service-worker (#127) * test: add msw and basic handlers for a few types * test: add mock data for a basic workflow execution * test: fixing/removing tests after adding msw * test: throw on unexpected requests to msw * fix: upgrade TS to fix error and cleanup resulting errors * Migrate from TSLint to ESLint (#128) * ci: move from tslint->eslint * fix: addressing eslint errors * fix: remove passing of unused variable * ci: remove unnecessary prettier config * refactor: clean up mock fixtures and re-enable tests for executions (#130) * test: adding test data for node executions * test: mocks and refactoring to re-enable NodeExecutionDetails tests * chore: lint error * test: getting first test for NE table working again * test: mocks and a couple of tests for NE table * refactor: msw handlers to use a backing map and return 404s * test: more tests for NE table * test: adding fixture for dynamic external workflow * test: using mock fixture for sub workflow tests * test: move remaining mocks to fixtures and fix tests * test: re-enabling more execution tests * fix: removing global query handlers for caching entitiesq * test: re-enable ExecutionNodeViews tests * fix: typo in import path * fix: show DataError by default for failed queries * chore: documentation * chore: pr feedback * test: fixing storybook rendering for NE table * refactor: queries and loading states for (Task)ExecutionDetails * chore: cleanup unused code * fix: adds mock support for launch plans * test: update LoadingSpinner tests * fix: handle error case for NE children * chore: remove todo * fix: typo
service-github-lyft-semantic-release
added a commit
that referenced
this pull request
Jan 6, 2021
# [0.18.0](http://github.com/lyft/flyteconsole/compare/v0.17.8...v0.18.0) (2021-01-06) ### Features * improved data fetching for execution details page ([#131](http://github.com/lyft/flyteconsole/issues/131)) ([928f094](http://github.com/lyft/flyteconsole/commit/928f094bee6f84a34325eb1ab88c1ddf88d45541)), closes [#123](http://github.com/lyft/flyteconsole/issues/123) [#126](http://github.com/lyft/flyteconsole/issues/126) [#127](http://github.com/lyft/flyteconsole/issues/127) [#128](http://github.com/lyft/flyteconsole/issues/128) [#130](http://github.com/lyft/flyteconsole/issues/130)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is another step toward refactoring our data fetching for the ExecutionDetails view to use react-query instead of
ExecutionDataCache
.This PR removes
ExecutionDataCache
and updates all code using it to use queries instead. It also includes a fair amount of supporting code and refactoring to clean up our usage of react-query.Notes
Full change list:
react-query
v3id
fields of entities)ExecutionDataCache
and related contextnodeExecutionQueries
file with queries/hooks related to fetching lists of node executionsNodeExecution
once and then cached, since they will not changeWorkflows
andTasks
Workflow
,NodeExecutionList
andTaskExecutionChildList
queries to extract nested entities and store them in the query cache. This allows subsequent queries for a singleNodeExecution
orTaskTemplate
to hit the cache instead of requesting data we already have. This was the primary purpose ofExecutionDataCache
.ExecutionNodeViews
and child components (includingDetailsPanel
) to be compatible with queries.ExecutionDataCache
. They will need a more significant change to the way data is mocked and will be handled in a future PR.NodeExecutionsTable
to get their data from a query, which should be cached from fetching the list at the level above.NodeExecutionsTable
. There is additional work to make it handle errors and loading states correctly, but it doesn't need full details of how we fetch data.NodeExecution
children to use queries instead ofExecutionDataCache
. This resulted in less-complicated code, so the queries were moved to live inside ofnodeExecutionQueries
QueryType
enum for use as the first value inQueryKey
arrays. Each type of entity we fetch or generate will have its own type, which is combined with anid
and/orRequestConfig
object to generate the unique hash for the query.NodeExecutions
,TaskExecutions
, and their children to have no limit. We usually always want all items with no pagination.