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

feat: adding guard rails to content query association setter to prevent large negative deltas #829

Conversation

alex-sheehan-edx
Copy link
Contributor

https://2u-internal.atlassian.net/browse/ENT-8778

Post-review

  • Squash commits into discrete sets of changes
  • Ensure that once the changes have been deployed to stage, prod is manually deployed

@alex-sheehan-edx alex-sheehan-edx requested a review from a team May 8, 2024 21:14
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch 4 times, most recently from 47cead6 to 18a6d80 Compare May 9, 2024 17:35
enterprise_catalog/settings/base.py Outdated Show resolved Hide resolved
enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
Comment on lines 866 to 867
f"content metadata set of length of {new_relations_size} when it previous had a content "
f"metadata set length of:{existing_relations_size}. The updated is prevented"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we log the percentage diff and the threshold we're working with?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the percent dif is just new / old. But I'm fine with logging the threshold.

@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch 2 times, most recently from 349be9f to e40c725 Compare May 9, 2024 21:56
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch 2 times, most recently from f12f5ee to 727e8cd Compare May 10, 2024 16:10
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch from 727e8cd to a4decba Compare May 10, 2024 16:27
Copy link
Contributor

@iloveagent57 iloveagent57 left a comment

Choose a reason for hiding this comment

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

This is a good idea, and the ADR is very useful, thank you!

enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
enterprise_catalog/apps/catalog/models.py Show resolved Hide resolved

@override_settings(DISCOVERY_CATALOG_QUERY_CACHE_TIMEOUT=0)
@mock.patch('enterprise_catalog.apps.api_client.discovery.DiscoveryApiClient')
def test_associate_content_metadata_with_query_guardrails(self, mock_client):
Copy link
Contributor

Choose a reason for hiding this comment

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

great job on a thorough test!

enterprise_catalog/apps/catalog/models.py Outdated Show resolved Hide resolved
enterprise_catalog/settings/base.py Outdated Show resolved Hide resolved
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch from a4decba to 07d8d93 Compare May 10, 2024 18:34
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch 2 times, most recently from 2ac6d18 to 11a15ab Compare May 10, 2024 18:41
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-8778-content-query-association-guard-rails branch from 11a15ab to f2e9eca Compare May 10, 2024 19:07
@alex-sheehan-edx alex-sheehan-edx merged commit 343fd5b into master May 10, 2024
5 checks passed
@alex-sheehan-edx alex-sheehan-edx deleted the asheehan-edx/ENT-8778-content-query-association-guard-rails branch May 10, 2024 19:30
irfanuddinahmad pushed a commit that referenced this pull request Jul 24, 2024
…ery-association-guard-rails

feat: adding guard rails to content query association setter to prevent large negative deltas
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.

3 participants