feat: course search "newest first" sort behind flag + Optimizely experiment#1511
Draft
macdiesel wants to merge 2 commits into
Draft
feat: course search "newest first" sort behind flag + Optimizely experiment#1511macdiesel wants to merge 2 commits into
macdiesel wants to merge 2 commits into
Conversation
…experiment Points the course search <Index> at the recency-sorted Algolia replica when the search_default_sort_newest enterprise waffle flag is enabled AND the Optimizely "newest" experiment variant is active for the user; falls back to the relevance index otherwise. Adds the ALGOLIA_RECENTLY_PUBLISHED_REPLICA_INDEX_NAME and EXPERIMENT_3 config vars + types. ENT-11384 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the enterprise-catalog rename (ENT-11386 alignment): the "newest courses first" sort now keys off the earliest course-run start of any status (the release date), not published runs only. Rename the config/env var and the index-name variable to match the backend: ALGOLIA_RECENTLY_PUBLISHED_REPLICA_INDEX_NAME -> ALGOLIA_RECENTLY_RELEASED_REPLICA_INDEX_NAME recentlyPublishedIndexName -> recentlyReleasedIndexName Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Points the course search
<Index>(SearchCourse.jsx) at the recency-sorted Algolia replica when both gates pass:search_default_sort_newestenterprise waffle flag is enabled (kill-switch, viauseEnterpriseFeatures), andisExperimentVariant(EXPERIMENT_3_ID, EXPERIMENT_3_VARIANT_2_ID)).Falls back to the relevance (primary) index otherwise, and is a safe no-op until
ALGOLIA_RECENTLY_PUBLISHED_REPLICA_INDEX_NAMEis configured. Adds the replica +EXPERIMENT_3config vars and their types.Testing
New
SearchCourse.test.jsx(4 cases: flag off, flagged-but-not-variant, flag+variant → replica, no-replica fallback) — 4 passed, eslint clean. Existing search-tree suites (Search,SearchSections,SearchPage, which renderSearchCourse) still pass → no regression. (The pre-existingtscerror atindex.tsx:15and a flaky parallel-run failure in the untouchedSearchUnavailableAlertwere confirmed independent of this change.)Rollout / ops
Set env
ALGOLIA_RECENTLY_PUBLISHED_REPLICA_INDEX_NAME,EXPERIMENT_3_ID,EXPERIMENT_3_VARIANT_2_ID, and create the Optimizely Web experiment (control vs "newest" variant) in the dashboard.Related (rollout order)
ENT-11384.
🤖 Generated with Claude Code