Add error alert for Elasticsearch version incompatible
What does this MR do and why?
Related to #362007 (closed)
Add an error alert when the Elasticsearch version is incompatible with a supported version
Screenshots or screen recordings
Alert
Note: the Reindex required
message is due to the index not being created in the 6.8 version of Elasticsearch. Users would not see this message when the version is not compatible. I've opened up #362161 (closed) to address this.
No Alert
How to set up and validate locally
- Validate that Elasticsearch is enabled in gdk
- Start a docker container running an incompatible version of Elasticsearch. Note that I used ports 9202 here since gdk already uses 9200. Also I'm running docker using minikube, so I'm using the minikube ip address below. You will need to use whatever ip address is available for the docker container you run.
docker run --rm --name es6.8.23 -p 9202:9200 -p 9302:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" elasticsearch:6.8.23
- open the rails console and update the elasticsearch url
Gitlab::CurrentSettings.update(elasticsearch_url: 'http://192.168.205.8:9202')
- load the admin settings page for Advanced Search: http://gdk.test:3000/admin/application_settings/advanced_search
- Verify that the version alert shows up (may have to refresh a few times due to caching)
- open the rails console and update the elasticsearch url (back to a supported version which should be running already in gdk)
Gitlab::CurrentSettings.update(elasticsearch_url: 'http://localhost:9200')
- load the admin settings page for Advanced Search: http://gdk.test:3000/admin/application_settings/advanced_search
- Verify that the version alert does not show up (may have to refresh a few times due to caching)
- stop the elasticsearch server in gdk:
gdk stop elasticsearch
- load the admin settings page for Advanced Search: http://gdk.test:3000/admin/application_settings/advanced_search
- Verify that the version alert does not show up (may have to refresh a few times due to caching) and that the page loads
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.
Edited by Terri Chu