Add include_archived for blobs search graphql api
What does this MR do and why?
This MR adds include_archived
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 #501292 (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
No UI changes
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 one archived project and one un-archived project
- test in graphql explorer to test global, group and project search
- test each with no
includeArchived
,includeArchived: true
, andincludeArchived: 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 archived project id. results should return regardless of includeArchived
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