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
- 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'
- Perform same request and ensure the same
shard_id
as before is returned in response. - 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'
- Perform same request with different node UUID and different
node.url
. Ensure you get a differentshard_id
in the responsecurl -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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #424116 (closed)
Edited by John Mason