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

Added a user allow list to ignore abuse metrics, avoid race conditions in abuse metrics #4885

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

rafeerahman
Copy link
Contributor

@rafeerahman rafeerahman commented Jul 18, 2024

This PR fixes MPP-3720, MPP-3806.

Description

Adds atomic transaction and row locking for updating abuse metrics.

Also adds an 'allow' list so that our e2e test accounts do not get flagged.

Screenshot (if applicable)

Not applicable.

Checklist (Definition of Done)

  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • Customer Experience team has seen or waived a demo of functionality.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • I've added or updated relevant docs in the docs/ directory
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.
  • All UI revisions follow the coding standards, and use Protocol tokens where applicable (see /frontend/src/styles/tokens.scss).
  • Commits in this PR are minimal and have descriptive commit messages.
  • l10n changes have been submitted to the l10n repository, if any.

@rafeerahman rafeerahman requested a review from jwhitlock July 19, 2024 14:55
@rafeerahman rafeerahman self-assigned this Jul 19, 2024
Copy link
Member

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

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

Thanks @rafeerahman!

).astimezone(UTC)
midnight_utc_tomorow = midnight_utc_today + timedelta(days=1)
abuse_metric = (
self.user.abusemetrics_set.select_for_update()
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -929,5 +929,8 @@ def set_index_cache_control_headers(
# django-ftl settings
AUTO_RELOAD_BUNDLES = False # Requires pyinotify

# accounts that should not have abuse metrics
ALLOWED_ACCOUNTS = ["[email protected]"]
Copy link
Member

Choose a reason for hiding this comment

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

Normally we'd load this from the environment, but we can do that when we first need it.

@rafeerahman rafeerahman added this pull request to the merge queue Jul 19, 2024
Merged via the queue into main with commit 0f2e8ff Jul 19, 2024
29 checks passed
@rafeerahman rafeerahman deleted the MPP-3720-MPP-3806 branch July 19, 2024 17:07
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