Skip to content

Conditionally run Algolia search in review apps

Sarah German requested to merge sarahg/algolia-review-apps into main

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:

  1. Adds a CI rule to build the review app with Algolia if the branch name contains the string algolia
  2. 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:

On the review app, we now query the the gitlab_testing Algolia index:

image

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.

Edited by Sarah German

Merge request reports