Skip to content

Add Zoekt internal API feature flag

Dmitry Gruzd requested to merge add-zoekt-nodes-feature-flag into master

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

  1. Create JWT token by going to this link and replacing your-256-bit-secret with contents from $GDK_DIR/gitlab/.gitlab_shell_secret:
  2. 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'
  3. Feature.disable(:zoekt_internal_api_register_nodes)
  4. 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.

#430836 (closed)

Edited by Dmitry Gruzd

Merge request reports