Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADAPT-2326: Update Algolia to only index on prod builds. #190

Merged
merged 2 commits into from
Apr 21, 2021
Merged

Conversation

nplowman
Copy link

@nplowman nplowman commented Apr 21, 2021

READY FOR REVIEW

Summary

  • Prevents Algolia indexing from getting triggered on non-production builds.
  • The new method uses the deploy context environment variable provided by Netlify. (See Resources section)

Review By (Date)

  • Not urgent - before end of sprint.

Criticality

  • Moderate. Under the status quo without this fix, indexing is happening unnecessarily on preview builds.

Review Tasks

Setup tasks and/or behavior to test

The easiest way to validate this is to check the build logs on Netlify.

On the preview builds, you should now see a line like this:

3:12:37 PM: success index to Algolia - 0.002s - options.skipIndexing is true; skipping indexing

This one you can check by simply looking at the build log for this PR as I did.

We'll also want to make sure the indexing is still working on prod builds.
You should see a line like this in the logs on the production build after this ticket is merged:

3:20:14 PM: success index to Algolia - 3.201s - Done!

As an additional validation step, you can also check the Index logs on Algolia
https://www.algolia.com/apps/SA452GABN1/explorer/logs/Giving%20to%20Stanford

If the Gatsby plugin attempted to index during the build, you will see one or more log entries that have the 'x-aloglia-agent' flag, like this:
Screen Shot 2021-04-21 at 3 03 40 PM

This should show up on Production builds, and should NOT show up on Preview builds.

Front End Validation

  • Is the markup using the appropriate semantic tags and passes HTML validation?
  • Cross-browser testing has been performed?
  • Automated accessibility scans performed?
  • Manual accessibility tests performed?
  • Design is approved by @ user?

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

Resources

@nplowman nplowman requested a review from sherakama April 21, 2021 21:42
Copy link
Member

@sherakama sherakama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTG

@sherakama sherakama merged commit cbb846d into main Apr 21, 2021
@sherakama sherakama deleted the ADAPT-2326 branch April 21, 2021 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants