Skip to content

Improve NOTES.txt

Dmitry Gruzd requested to merge update-notes-template into main

What does this MR do and why?

This MR updates NOTES.txt to make it more robust. For example, we replace a hard-coded gitlab-zoekt-0 with a dynamic template gitlab-zoekt.notesDefaultPodName. Also, we replace the search term we use gitaly with gitlab-zoekt-indexer-update to reduce the number of hits so that it doesn't fill the entire screen when you execute the command

Screenshots or screen recordings

Before

Click to expand
NAME: gitlab-zoekt
LAST DEPLOYED: Thu Nov 16 18:12:05 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Index a repo:
   With new indexer:
   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://127.0.0.1:8080/indexer/index'

   With legacy indexer:
   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"CloneUrl":"https://gitlab.com/gitlab-org/gitlab-development-kit.git","RepoId":74823}' 'http://127.0.0.1:8080/index'

2. Search:
   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"Q":"gitaly"}' 'http://127.0.0.1:8080/api/search'

3. Search with gateway service URL:

   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"Q":"gitaly"}' 'http://gitlab-zoekt-gateway.default.svc.cluster.local:8080/api/search'

4. Index with gateway service URL:

   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://gitlab-zoekt-gateway.default.svc.cluster.local:8080/indexer/index'

   Please note that you need a Gitaly instance to actually index a repository. The example above can be used to verify that you can the indexer even though it errors out with 'cannot find a default branch'.

5. You can also reach a specific replica through service URL:

   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"Q":"gitaly"}' 'http://gitlab-zoekt-gateway.default.svc.cluster.local:8080/nodes/gitlab-zoekt-0.gitlab-zoekt.default.svc.cluster.local/api/search'

After

Click to expand
NAME: gitlab-zoekt
LAST DEPLOYED: Thu Nov 16 18:12:39 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Index a repo:
   With new indexer:
   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://127.0.0.1:8080/indexer/index'

   With legacy indexer:
   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"CloneUrl":"https://gitlab.com/gitlab-org/gitlab-development-kit.git","RepoId":74823}' 'http://127.0.0.1:8080/index'

2. Search:
   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"Q":"gitlab-zoekt-indexer-update"}' 'http://127.0.0.1:8080/api/search'

3. Search with gateway service URL:

   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"Q":"gitlab-zoekt-indexer-update"}' 'http://gitlab-zoekt-gateway:8080/api/search'

4. Index with gateway service URL:

   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://gitlab-zoekt-gateway:8080/indexer/index'

   Please note that you need a Gitaly instance to actually index a repository. The example above can be used to verify that you can the indexer even though it errors out with 'cannot find a default branch'.

5. You can also reach a specific replica through service URL:

   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"Q":"gitlab-zoekt-indexer-update"}' 'http://gitlab-zoekt-gateway:8080/nodes/gitlab-zoekt-0.gitlab-zoekt.default.svc.cluster.local/api/search'

Diff

Click to expand
diff --git a/output.txt b/output.txt
index 8e92e2c..bb8fd37 100644
--- a/output.txt
+++ b/output.txt
@@ -1,5 +1,5 @@
 NAME: gitlab-zoekt
-LAST DEPLOYED: Thu Nov 16 18:12:05 2023
+LAST DEPLOYED: Thu Nov 16 18:12:39 2023
 NAMESPACE: default
 STATUS: deployed
 REVISION: 1
@@ -7,24 +7,24 @@ TEST SUITE: None
 NOTES:
 1. Index a repo:
    With new indexer:
-   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://127.0.0.1:8080/indexer/index'
+   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://127.0.0.1:8080/indexer/index'
 
    With legacy indexer:
-   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"CloneUrl":"https://gitlab.com/gitlab-org/gitlab-development-kit.git","RepoId":74823}' 'http://127.0.0.1:8080/index'
+   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"CloneUrl":"https://gitlab.com/gitlab-org/gitlab-development-kit.git","RepoId":74823}' 'http://127.0.0.1:8080/index'
 
 2. Search:
-   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"Q":"gitaly"}' 'http://127.0.0.1:8080/api/search'
+   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"Q":"gitlab-zoekt-indexer-update"}' 'http://127.0.0.1:8080/api/search'
 
 3. Search with gateway service URL:
 
-   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"Q":"gitaly"}' 'http://gitlab-zoekt-gateway.default.svc.cluster.local:8080/api/search'
+   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"Q":"gitlab-zoekt-indexer-update"}' 'http://gitlab-zoekt-gateway:8080/api/search'
 
 4. Index with gateway service URL:
 
-   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://gitlab-zoekt-gateway.default.svc.cluster.local:8080/indexer/index'
+   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"GitalyConnectionInfo":{"Address":"tcp://gitaly.host:2305","Storage":"default","Path":"@hashed/a/b/c.git"},"RepoId":7,"FileSizeLimit":2097152,"Timeout":"10m"}' 'http://gitlab-zoekt-gateway:8080/indexer/index'
 
    Please note that you need a Gitaly instance to actually index a repository. The example above can be used to verify that you can the indexer even though it errors out with 'cannot find a default branch'.
 
 5. You can also reach a specific replica through service URL:
 
-   $ kubectl exec gitlab-zoekt-0 -- curl -s -XPOST -d '{"Q":"gitaly"}' 'http://gitlab-zoekt-gateway.default.svc.cluster.local:8080/nodes/gitlab-zoekt-0.gitlab-zoekt.default.svc.cluster.local/api/search'
+   $ kubectl exec gitlab-zoekt-0 -- curl -s -d '{"Q":"gitlab-zoekt-indexer-update"}' 'http://gitlab-zoekt-gateway:8080/nodes/gitlab-zoekt-0.gitlab-zoekt.default.svc.cluster.local/api/search'

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Dmitry Gruzd

Merge request reports

Loading