Implement user-facing error message for missing Elasticsearch API keys for local copies of the site
What does this MR do and why?
WHAT
This MR does two things,
- Displays UI error message in production site if CI/CD variables for
ELASTIC_CLOUD_ID,ELASTIC_KEYandELASTIC_INDEXare missing. -
make viewcommand will now checkELASTIC_CLOUD_ID,ELASTIC_KEYandELASTIC_INDEXBEFORE updating icons, building frontend, and serving Hugo server and print out an INFO message.
WHY
- A UI error message is useful for users in production. Especially if we had accidentally removed a required Elasticsearch config variable.
- The local
make viewprinting an INFO message with specifics on missing config/s is useful if the developer is trying to do local search; so that a developer running the site locally gets an early warning/info before site is fully compiled.
Screenshots or screen recordings
Production error handling for missing Elasticsearch config:
| Before | After |
|---|---|
![]() |
![]() |
![]() |
![]() |
Local "error" handling for missing Elasticsearch config:
How to set up and validate locally
- Checkout this branch.
- Run
unset ELASTIC_KEYto remove it from terminal. You can also unsetELASTIC_INDEXandELASTIC_CLOUD_IDas well to check those. - Run
make viewon the same terminal. - Search in the landing page and it should show the same as the first "After" screenshot in the table.
- Search in the /search/ page and it should show the same as the second screenshot.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Closes #151 (closed)
Edited by Hiru Fernando




