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
fetchDependenciesViaGraphQLaction to handle GraphQL data retrieval and transformation - Added
SET_FULL_PATHmutation to store project path for GraphQL queries - Modified
setSortFieldandtoggleSortOrderto 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
- Import security reports: https://gitlab.com/gitlab-examples/security/security-reports
- Run pipeline on master
- Go to Secure > Dependency list on both project and group-level
- Check that the list of dependencies loads
- Check that both the sort-by and sort-order are working correctly
- Enable http://gdk.test:3000/rails/features/project_dependencies_graphql
- 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