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

CHES Notifications & Logger Adjustment #2730

Merged
merged 10 commits into from
Oct 22, 2024

Conversation

dbarkowsky
Copy link
Collaborator

🎯 Summary

This is in response to the issue I had this morning with sending/resending notifications.
It turned out that my email in the database was not a real email from testing another ticket. This caused the CHES request to fail, but it wasn't very clear why it was doing so.

Changes

  • The logger now reports the stack if you log something that is of type Error.

    • e.g. Will show stack: logger.error(new Error('something went wrong'));
    • e.g. Won't show stack: logger.error('this is not type error');
  • If the API is not in its containerized form, it will also pretty print the logs for easier readability

    • e.g. image
  • If the response is bad in some way or empty, sendAsync should now return null, which just marks attempted notifications as Failed.

Testing

  • Manually set up the cause for an error. Easiest way is to set your email to a string like blank.
  • Trigger sending notifications through the resend option, submitting projects, changing statuses.
  • Check that log prints and notification is saved as Failed.

🔰 Checklist

  • I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

Copy link

🚀 Deployment Information

The Express API Image has been built with the tag: 2730. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the API deployment. For more updates please monitor Image Tags Page on Wiki.

Copy link

codeclimate bot commented Oct 21, 2024

Code Climate has analyzed commit ae31ff2 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 93.4%.

View more on Code Climate.

Copy link
Collaborator

@TaylorFries TaylorFries left a comment

Choose a reason for hiding this comment

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

Failed email log printing as expected, and notifications set to failed in project page.

@dbarkowsky dbarkowsky merged commit 6c9077c into main Oct 22, 2024
10 checks passed
@dbarkowsky dbarkowsky deleted the PIMS-1946-Cancel/Stop-Notifications branch October 22, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants