Geo Package Files - Fetch Data Correctly
What does this MR do?
This MR splits off from !32872 (closed)
This MR is an attempt at MVC to avoid the above massive MR going in all at once.
This MR focuses on preparing the Vuex store to handle both RESTful and GraphQL data entry points in the Geo Replicable UI. A breakdown of the changes in this MR will be listed below.
This MR creates a split when fetching data to determine based on the state property useGraphQl
to determine whether to fetch the data via REST or GraphQL.
The UI does not support listing the GraphQL data as part of this MR, the UI hookup will be implemented as part of !33987 (merged)
What is still left to implement as part of this MVC
- Add conditionals to support viewing PackageFiles in the UI
- Add the GraphQL based pagination UI elements
Breakdown of changes in this MR
- Adding
useGraphQL
state member to thecreateStore
method.
This allows us to set up the store with how to fetch the data before we fully mount the Vue component (GraphQL vs REST). This required every spec to update their createStore method with this new parameter, causing a lot of files to be touched.
- Update pagination object in store to handle both Page based Pagination and Cursor based Pagination
Instead of having every pagination variable as a top level key in the state, I added a paginationData
object that holds all the pagination data. This way GraphQL and REST pagination can reference it the same way without the need for multiple mutations. This of course cause a lot of file touches as anything referencing them had to be updated.
Important Notes about ~"technical debt"
This MR adds some technical debt requiring essentially 2 paths of data fetching inside the same Vue components. This causes a bit of over-complexity that should be addressed.
The following issues are opened and currently being prioritized to allow for this complexity to be removed in favor of using GraphQL always.
Screenshots
Data Fetching | |
---|---|
RESTful (previously implemented) | |
GraphQL (new implementation) |
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team