@sylviashen would you mind a backend review?
note (non-blocking): technically the mcp_server? check is first, so this test is actually testing that (even if ES and zoekt is not enabled)
note (non-blocking): I combined these to make it easier to add future blob/code params. They only need to be added in the constant for validation and all of the search APIs immediately get validation (no changes required)
note (non-blocking): I considered trying to combine these because there is a one to one grape middleware for each param. However, the middleware are not used across all search types equally (global, group, and project) and that falls outside of the scope of this issue
@GitLabDuo this has been fixed in the last commit
Terri Chu (ca6225da) at 19 Mar 00:54
Add value constraints to num_context_lines API param
@GitLabDuo these are auto generated
Adds num_context_lines as an optional API parameter to the global, group,
and project search endpoints. The parameter controls how many lines of context
are returned around each match in blob search results. It is only available
for advanced and exact code search (zoekt), consistent with how the parameter
is already used internally.
As part of this MR, the three separate verify_ee_param_* methods for blob
search params (regex, exclude_forks, num_context_lines) have been
refactored into a single verify_ee_blob_search_params! method driven by a
BLOB_SEARCH_PARAM_RULES constant, making it trivial to add new params in
future.
N/A - API only change.
num_context_lines:
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
"https://gdk.test:3443/api/v4/search?scope=blobs&search=monitors&num_context_lines=5"
num_context_lines without advanced or exact code
search returns a 400 error.Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Adds num_context_lines as an optional API parameter to the global, group,
and project search endpoints. The parameter controls how many lines of context
are returned around each match in blob search results. It is only available
for advanced and exact code search (zoekt), consistent with how the parameter
is already used internally.
As part of this MR, the three separate verify_ee_param_* methods for blob
search params (regex, exclude_forks, num_context_lines) have been
refactored into a single verify_ee_blob_search_params! method driven by a
BLOB_SEARCH_PARAM_RULES constant, making it trivial to add new params in
future.
N/A - API only change.
num_context_lines:
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
"https://gdk.test:3443/api/v4/search?scope=blobs&search=monitors&num_context_lines=5"
num_context_lines without advanced or exact code
search returns a 400 error.Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Adds num_context_lines as an optional API parameter to the global, group,
and project search endpoints. The parameter controls how many lines of context
are returned around each match in blob search results. It is only available
for advanced and exact code search (zoekt), consistent with how the parameter
is already used internally.
As part of this MR, the three separate verify_ee_param_* methods for blob
search params (regex, exclude_forks, num_context_lines) have been
refactored into a single verify_ee_blob_search_params! method driven by a
BLOB_SEARCH_PARAM_RULES constant, making it trivial to add new params in
future.
N/A - API only change.
num_context_lines:
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
"https://gdk.test:3443/api/v4/search?scope=blobs&search=monitors&num_context_lines=5"
num_context_lines without advanced or exact code
search returns a 400 error.Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Adds num_context_lines as an optional API parameter to the global, group,
and project search endpoints. The parameter controls how many lines of context
are returned around each match in blob search results. It is only available
for advanced and exact code search (zoekt), consistent with how the parameter
is already used internally.
As part of this MR, the three separate verify_ee_param_* methods for blob
search params (regex, exclude_forks, num_context_lines) have been
refactored into a single verify_ee_blob_search_params! method driven by a
BLOB_SEARCH_PARAM_RULES constant, making it trivial to add new params in
future.
N/A - API only change.
num_context_lines:
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
"https://gdk.test:3443/api/v4/search?scope=blobs&search=monitors&num_context_lines=5"
num_context_lines without advanced or exact code
search returns a 400 error.Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Adds num_context_lines as an optional API parameter to the global, group,
and project search endpoints. The parameter controls how many lines of context
are returned around each match in blob search results. It is only available
for advanced and exact code search (zoekt), consistent with how the parameter
is already used internally.
As part of this MR, the three separate verify_ee_param_* methods for blob
search params (regex, exclude_forks, num_context_lines) have been
refactored into a single verify_ee_blob_search_params! method driven by a
BLOB_SEARCH_PARAM_RULES constant, making it trivial to add new params in
future.
N/A - API only change.
num_context_lines:
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
"https://gdk.test:3443/api/v4/search?scope=blobs&search=monitors&num_context_lines=5"
num_context_lines without advanced or exact code
search returns a 400 error.Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Terri Chu (106898f1) at 19 Mar 00:00
Refactor blob search param verification into a single method
... and 1 more commit
@tskorupa-gl sorry for the random ping, but I thought you might be able to help me understand why this spec doesn't include gitlab_main_cell_setting in the exempted tables?
That's fine with me to keep it in. All the others, I'm ok to move out a milestone.
@stefanosxan would you mind an initial review? This is a fix for at least one of the errors I'm seeing in sentry. I'm not sure how to reproduce it manually but testing is added. Can you send it to @rkumar555 or @maddievn for the backend maintainer ( they can also cover Advanced Search Framework )
note (non-blocking): The failed tests were not related to these changes
The ES tests did in fact run after adding the label. Maybe our rules need a tweak?