Skip to content

Geo Package Files - Fetch Data Correctly

Zack Cuddy requested to merge 208470_02-package-file-store into master

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

  1. Add conditionals to support viewing PackageFiles in the UI
  2. Add the GraphQL based pagination UI elements

Breakdown of changes in this MR

  1. Adding useGraphQL state member to the createStore 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.

  1. 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) RESTful_Query
GraphQL (new implementation) GraphQL_Query

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Zack Cuddy

Merge request reports