-
Notifications
You must be signed in to change notification settings - Fork 6
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 ability to get all keys matching a specific pattern. Added functions to construct the service and template keys #94
feat: adding ability to get all keys matching a specific pattern. Added functions to construct the service and template keys #94
Conversation
…ed functions to construct the service and template keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor correction requested for renaming regex parameter to some other matching name. Also, the test might not correspond to the usage expectations.
|
||
|
||
def service_cache_key(service_id): | ||
return f"service-{service_id}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
tests/test_redis_client.py
Outdated
|
||
|
||
def test_should_call_get_cache_keys_by_pattern_if_enabled(mocked_redis_client): | ||
assert mocked_redis_client.get_cache_keys_by_pattern("test-key-*") == [b"test-1243", b"test-23423423"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the parameter is a regular expression, I would not expect these keys to get returned as they would not fix test-key-*
. A proper regex for the expected keys would be test-[\d]+
. My impression is that the parameter format correspond more to a glob than a regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're probably right. It turns our I do not need this function anyways to make it work. So I removed it
Summary | Résumé
To reduce duplication I added additional functions to generate the template and service key patterns.
Test instructions | Instructions pour tester la modification
Run unit tests !
Help requested | Aide requise
N/A
Reviewer checklist | Liste de vérification du réviseur
This is a suggested checklist of questions reviewers might ask during their
review | Voici une suggestion de liste de vérification comprenant des questions
que les réviseurs pourraient poser pendant leur examen :
langues officielles?
une baisse de la quantité de code couvert par les tests automatisés?
fonctionnalité existante?
que ça devrait être divisé en de plus petites demandes de tirage (« pull
requests ») afin de réduire le risque lié aux modifications?
modification de la politique de confidentialité?
préoccupations liées à la sécurité?
façon importante la performance?
risque d’utiliser des dépendances ajoutées?
setup, etc.) | Faudra-t-il mettre à jour la documentation à la suite de ce
changement (fichier README, etc.)?