Skip to content

Project Dependencies: Fetch via GraphQL

What does this MR do and why?

This MR introduces a GraphQL-based implementation for fetching project dependencies, which is behind a feature flag. This change lays the groundwork for future improvements while maintaining compatibility with the existing REST API.

Implementation Details

  • Added a new GraphQL query (project_dependencies.query.graphql) to fetch dependencies data
  • Implemented fetchDependenciesViaGraphQL action to handle GraphQL data retrieval and transformation
  • Added SET_FULL_PATH mutation to store project path for GraphQL queries
  • Modified setSortField and toggleSortOrder to only update state and not re-fetch dependencies. This allows to keep the feature-flag logic within the UI-layer
  • Added feature flag (project_dependencies_graphql) and specs

References

Screenshots or screen recordings

No visible changes

How to set up and validate locally

  1. Import security reports: https://gitlab.com/gitlab-examples/security/security-reports
  2. Run pipeline on master
  3. Go to Secure > Dependency list on both project and group-level
  4. Check that the list of dependencies loads
  5. Check that both the sort-by and sort-order are working correctly
  6. Enable http://gdk.test:3000/rails/features/project_dependencies_graphql
  7. Check that the list loads (note: pagination, sorting, etc. is not yet implemented)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #527083 (closed)

Edited by David Pisek

Merge request reports

Loading