Skip to content

Add API to receive task requests from zoekt indexer

What does this MR do and why?

Updates a Zoekt::Shard whenever a heartbeat is received from a zoekt indexer (gitlab-zoekt-indexer!60 (merged)).

Note: in production, there is currently only 1 shard.

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. Perform same request and ensure the same shard_id as before is returned in response.
  4. Perform same request with different node UUID. Ensure you get a 422 response because the node.url has been taken.
    curl -v --header "Gitlab-Shell-Api-Request: $YOURJWT" 'http://localhost:3000/api/v4/internal/search/zoekt/00000000-00000000-00000000-00000001/tasks?node.url=http://localhost:1234&disk.all=100&disk.free=50&disk.used=50&node.name=test-node'
  5. Perform same request with different node UUID and different node.url. Ensure you get a different shard_id in the response
    curl -v --header "Gitlab-Shell-Api-Request: $YOURJWT" 'http://localhost:3000/api/v4/internal/search/zoekt/00000000-00000000-00000000-00000001/tasks?node.url=http://localhost:1235&disk.all=100&disk.free=50&disk.used=50&node.name=test-node'

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #424116 (closed)

Edited by John Mason

Merge request reports