DAST Site profile - Link from library to edit form
The following discussion from !38315 (merged) should be addressed:
-
@philipcunningham started a discussion: (+4 comments) @pgascouvaillancourt this is taking shape
🙇 i've added some comments and suggestions above but i think there might be a slightly more systemic issue in that all of our graphql endpoints for
dast_site_profiles
anddast_on_demand_scans
deal with global ids (e.g."gid://gitlab/DastSiteProfile/3"
) whereas the code you're using here relies on primary keys of the db tables.you could extract the primary key from global id in the graphql response but i don't know if this is a common pattern on the frontend or not. that said, i wonder if it might make sense to add that graphql query to the backend for pulling sooner rather than later to ensure that we can fit everything together. wdyt?
Problem to solve
Once the DAST site profiles library and the DAST site profile form are completed, the Edit links in the former should link to the latter.
Prior art: GroupEntity
Implementation plan
-
Extend the DastSiteProfiles
GraphQL query to expose the edit path which can be obtained with theedit_project_dast_site_profile_path(project, dast_site_profile)
helper.
query DastSiteProfiles($fullPath: ID!, $after: Int, $before: Int, $first: Int, $last: Int) {
project(fullPath: $fullPath) {
DastSiteProfiles(after: $after, before: $before, first: $first, last: $last) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
id,
profileName,
targetUrl,
+ editPath,
validationStatus # stubbed until validation iteration is complete
}
}
}
}
}
-
In the DAST site profiles list, retrieve the editPath
and use it for as the href for Edit links.