Improve Zoekt API code and specs
The following discussions from !116650 (merged) should be addressed:
-
@splattael started a discussion: (+2 comments) Question Since this feature is behind two feature flags (#388519) do we want to add a check if zoekt is enabled for the passed project/namespace?
🤔 -
@splattael started a discussion: Suggestion Thoughts on using
non_existing_record_id
instead?let(:project_id) { non_existing_record_id }
See https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#general-guidelines
-
@splattael started a discussion: let(:shard_id) { non_existing_record_id }
-
@splattael started a discussion: let(:shard_id) { non_existing_record_id }
-
@splattael started a discussion: let(:namespace_id) { non_existing_record_id }
-
@splattael started a discussion: let(:shard_id) { non_existing_record_id }
-
@splattael started a discussion: let(:namespace_id) { non_existing_record_id }
-
@splattael started a discussion: Question (non-blocking)
On self-managed, without feature flag enabled, when an admin calls the endpoint it'd return
200 OK
indicating that the repo is no reindexed. According to https://gitlab.com/gitlab-org/gitlab/-/blob/04ce462c85c8d05770966a0e084451c6d532299c/ee/app/workers/zoekt/indexer_worker.rb#L17, it's a silent no-op (no warnings) and not very clear to admins why reindexing was not performed.Thoughts on returning
404 Not found
(or whatever we do for APIs in those cases) instead if feature flag is disabled?🤔 Follow-up is fine though.