Conditionally run Algolia search in review apps
What does this MR do and why?
When we're doing development on Algolia-related features, we need to be able to run Algolia in review apps. As of !3053 (merged), we default to Lunr.js for review apps, like other self-hosted docs site installations.
This MR:
- Adds a CI rule to build the review app with Algolia if the branch name contains the string
algolia
- Refactors the
getAlgoliaCredentials
method to set the Algolia index name based on the environment. This will allow us to additionally test Algolia-side configuration changes if needed.
Closes #1277 (closed)
Screenshots, screen recordings, or links to review app
To test this, verify that Algolia search appears and can run a search in 3 places on the site:
- Homepage: https://sarahg-algolia-review-apps.docs.gitlab-review.app/
- An internal page (header navbar), like this: https://sarahg-algolia-review-apps.docs.gitlab-review.app/ee/user/admin_area/analytics/usage_trends.html
- Standalone search page: https://sarahg-algolia-review-apps.docs.gitlab-review.app/search/
On the review app, we now query the the gitlab_testing
Algolia index:
Once this merges, we can double-check that production continues to use the gitlab
index. Otherwise there isn't anything else to test with this change, as long as search is functioning.
How to set up and validate locally
n/a
Merge request 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 merge request.