Skip to content

Task/removeoldkeys #373

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Task/removeoldkeys #373

wants to merge 2 commits into from

Conversation

jzbahrai
Copy link
Collaborator

Summary | Résumé

TODO: 1-3 sentence description of the changed you're proposing.

Related Issues | Cartes liées

Test instructions | Instructions pour tester la modification

TODO: Fill in test instructions for the reviewer.

Release Instructions | Instructions pour le déploiement

None.

Reviewer checklist | Liste de vérification du réviseur

  • This PR does not break existing functionality.
  • This PR does not violate GCNotify's privacy policies.
  • This PR does not raise new security concerns. Refer to our GC Notify Risk Register document on our Google drive.
  • This PR does not significantly alter performance.
  • Additional required documentation resulting of these changes is covered (such as the README, setup instructions, a related ADR or the technical documentation).

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 21:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the Redis annual limit functionality to the new “v2” structure by removing legacy keys, tests, and code paths. Key changes include:

  • Removal of legacy notification key constants and related test cases.
  • Updates to helper methods to exclusively use the v2 Redis key for notifications.
  • Version bumps in configuration files to reflect the changes.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/test_annual_limit.py Updates tests to use new v2 field names; removes legacy key assertions.
pyproject.toml Bumps project version from 53.2.4 to 53.2.5.
notifications_utils/clients/redis/annual_limit.py Removes legacy key logic and deprecated code paths; migrates to v2.
.github/actions/waffles/requirements.txt Updates dependency reference to align with the new version.
Comments suppressed due to low confidence (3)

tests/test_annual_limit.py:111

  • Consider explicitly testing valid v2 field names instead of using a placeholder like 'helloworld' to ensure proper coverage of expected behavior.
assert mock_annual_limit_client.get_notification_count(mocked_service_id, "helloworld") == 0

notifications_utils/clients/redis/annual_limit.py:134

  • Update the docstring and comments for this method to reflect that the legacy fallback has been removed and the method now only retrieves counts from the v2 key.
return 0 if not count else int(count.decode("utf-8"))

notifications_utils/clients/redis/annual_limit.py:167

  • Once migration is complete, remove any remaining TODO comments and legacy deletion code to simplify the reset logic and improve maintainability.
self._redis_client.delete_hash_fields(hashes=hashes, fields=NOTIFICATION_FIELDS)

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.

1 participant