Add Zoekt internal API feature flag
What does this MR do and why?
This is a follow-up to !131671 (merged). We'd like to add a feature flag to control the behaviour of the internal Zoekt API. For example, we want to disable the registration of new zoekt nodes using a feature flag.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Create JWT token by going to this link and replacing
your-256-bit-secret
with contents from$GDK_DIR/gitlab/.gitlab_shell_secret
: - Make a request for one UUID and note the
shard_id
that is returned.curl -v --header "Gitlab-Shell-Api-Request: $YOURJWT" 'http://localhost:3000/api/v4/internal/search/zoekt/00000000-00000000-00000000-00000000/tasks?node.url=http://localhost:1234&disk.all=100&disk.free=50&disk.used=50&node.name=test-node'
Feature.disable(:zoekt_internal_api_register_nodes)
- Perform same request. Ensure you get a 422 response because the feature flag has been disabled.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Dmitry Gruzd