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

Rework callback logging #2078

Merged
merged 35 commits into from
May 23, 2024
Merged

Rework callback logging #2078

merged 35 commits into from
May 23, 2024

Conversation

jimleroyer
Copy link
Member

@jimleroyer jimleroyer commented Jan 16, 2024

Summary | Résumé

To get the callback logged when not only successful, I moved the callback level log to prior to the call. This removes the response status from that logging but that would get logged anyway via the error when it is logged as an error when an error is raised and caught.

This might not be that useful in production unfortunately because the latter does not have the logging level set to INFO: we wouldn't see this message to help us on support. But that will be useful when we do enable it temporarily or in other environments where we want to get this debugged more easily.

Release Instructions | Instructions pour le déploiement

None.

Necessary steps to perform before and after the deployment of these changes.
For example, emptying the cache on a feature that changes the cache data
structure in Redis could be mentioned.


Étapes nécessaires à exécuter avant et après le déploiement des changements
introduits par cette proposition. Par exemple, vider la cache suite à des
changements modifiant une structure de données de la cache pourrait être
mentionné.

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 :

  • Is the code maintainable? | Est-ce que le code peut être maintenu?
  • Have you tested it? | L’avez-vous testé?
  • Are there automated tests? | Y a-t-il des tests automatisés?
  • Does this cause automated test coverage to drop? | Est-ce que ça entraîne
    une baisse de la quantité de code couvert par les tests automatisés?
  • Does this break existing functionality? | Est-ce que ça brise une
    fonctionnalité existante?
  • Does this change the privacy policy? | Est-ce que ça entraîne une
    modification de la politique de confidentialité?
  • Does this introduce any security concerns? | Est-ce que ça introduit des
    préoccupations liées à la sécurité?
  • Does this significantly alter performance? | Est-ce que ça modifie de
    façon importante la performance?
  • What is the risk level of using added dependencies? | Quel est le degré de
    risque d’utiliser des dépendances ajoutées?
  • Should any documentation be updated as a result of this? (i.e. README
    setup, etc.) | Faudra-t-il mettre à jour la documentation à la suite de ce
    changement (fichier README, etc.)?

@jimleroyer jimleroyer requested a review from sastels January 16, 2024 22:02
service_callback_url,
response.status_code,
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want to log the response here if there's an error?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry @sastels for the long delayed response. I am revisiting this. From what I read here, an error seems to raise a RequestException and would then be logged as a warning, hence covering the response status. Most likely the status code would be contained within the e itself I assume. Do you think my read of the code makes sense here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, that's a good point 💯

@jimleroyer jimleroyer requested a review from sastels February 28, 2024 02:42
Copy link
Collaborator

@sastels sastels left a comment

Choose a reason for hiding this comment

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

LGTM, a good idea. :shipit: when the code style test is passing!

@jzbahrai
Copy link
Collaborator

Can we get this PR merged?

@jimleroyer jimleroyer merged commit dccea53 into main May 23, 2024
4 checks passed
@jimleroyer jimleroyer deleted the feat/rework-callback-logging branch May 23, 2024 21:14
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