Add include_forked for blobs search graphql api
What does this MR do and why?
This MR adds include_forked
filter for the blob search graphQL API endpoint. the filter is already present in the search service, it just needed to be passed down from graphQL (as the SearchController
and Search
API already do)
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Related to #501293 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
N/A
How to set up and validate locally
- enable zoekt for gdk
- enable ff
zoekt_cross_namespace_search
for global search - setup a group (I used flightjs for this) and ensure it has at least one forked project
- test in graphql explorer to test global, group and project search
- test each with no
includeForked
,includeForked: true
, andincludeForked: false
global
query {
blobSearch(
search: "searchabletext",
) {
matchCount
perPage
fileCount
searchType
searchLevel
files {
path
fileUrl
}
}
}
group
query {
blobSearch(
search: "searchable",
groupId: "gid://gitlab/Group/33",
) {
matchCount
perPage
fileCount
searchType
searchLevel
files {
path
fileUrl
}
}
}
project
project id should be the forked project id. results should return regardless of includeForked
parameter
query {
blobSearch(
search: "searchable",
groupId: "gid://gitlab/Group/33",
projectId: "gid://gitlab/Project/26"
) {
matchCount
perPage
fileCount
searchType
searchLevel
files {
path
fileUrl
}
}
}
Edited by Terri Chu