Merged
Conversation
| # A follow up pr will update the next line and populate | ||
| # the new resource_category field. | ||
| "resource_type_group": FilterConfig("resource_category"), | ||
| "resource_type_group": FilterConfig("resource_type_group"), |
There was a problem hiding this comment.
Bug: Removing the resource_category fallback field before a full re-index completes will cause searches filtering by resource_type_group to return incomplete results.
Severity: HIGH
Suggested Fix
Ensure that a full re-index of the search data is completed and the new index is live before deploying this code change. This will guarantee all documents have the resource_type_group field, preventing incomplete search results. Alternatively, delay the removal of the resource_category fallback logic until the re-index is confirmed to be finished in production.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: learning_resources_search/constants.py#L99
Potential issue: The code removes a temporary workaround that duplicated
`resource_type_group` data into the `resource_category` field. If this change is
deployed before a full OpenSearch re-index is completed, existing documents will not
have the `resource_type_group` field. When a user filters by `resource_type_group`, the
term query will not match these older documents, leading to silently incomplete search
results. This is a deployment-dependent issue; the bug manifests if the deployment
precedes the completion of the data migration.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
Anastasia Beglova