-
Notifications
You must be signed in to change notification settings - Fork 12
Add suffix option #4
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
Conversation
Lee-W
left a comment
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.
Thanks for your contribution! I leave some discussion regarding the try catch block. Also, I'll try to apply new tools in this repo. You might need to pull the latest version from this repo after that.
11342a9 to
e6ba004
Compare
|
The PR is ready for review again except one coding style error This updated PR includes:
The implementation of the test cases has a lot of improvement space. It was implemented on top of the data structure that is out of scope. We may want to use this imperfect test as a foundation for the possible refactoring in the future rather than a very large code change for review (this PR is large enough, right? ; ) ) Verify This PRBy More Tests Were Performedpytest tox Render and send the mails |
Lee-W
left a comment
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.
Thanks for your contribution! It's a huge improvement in our existing codebase. I like the tox integration to the project.
I already fix the Github action. Two of our tests fail. You can view them here.
As for the Imports are incorrectly sorted. discussion, we use isort to sort our imports. You can use inv style.reformat to reformat the codebase. Aside from following what pep8 suggests, it sort libraries in the same group in alphabetic order.
I did not notice the last part of message regarding to the test part. Surely, we can fix them later if you deem they are too huge to fix in this pull request
b1d9753 to
0b3b698
Compare
Lee-W
left a comment
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.
Other than the failed tests, there's no major change needed. Once they're fix, we can merge this PR. 🎉
0b3b698 to
a19516a
Compare
We already have flake8 check via invoke and only one flake8 configuration in one place will make the code easier to maintain.
By removing the ephemeral files we may avoid false positive testing result in the future, because the runner may not generate expected files for each regression test.
c32921c to
189e475
Compare
|
Besides CI, sending rendered emails via gmail was also performed (again) |
Lee-W
left a comment
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.
I add some nitpicks that you can ignore in this PR. However, I think importing functions in tests is a major one.
Also, I don't quite get your comment here. Is it an example of how we should run the program?
send_mail.py
Outdated
|
|
||
| import click | ||
|
|
||
| from tests.utils import send_mail_debug_dump_path |
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.
It seems to me that our program should not depend on our test files. Even duplication seems to be a better solution to me. One of the reasons is that after we make this project a package, it won't pack tests into it. @tai271828 What do you think?
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.
Fair, hahahahahaha
tests/utils.py
Outdated
| all_mail_names = [] | ||
| for mail in mails: | ||
| all_mail_names.append(os.path.basename(mail)) | ||
|
|
||
| return all_mail_names |
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.
I prefer using list comprehension for simply iterations. i.e. return [os.path.basename(mail) for mail in mails]
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.
+1. We should always insist list comprehension. This is suggested in "fluent python".
Lee-W
left a comment
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.
Thanks for all the hard-working! Let's merge it!
By adding suffix option we could then appending suffix to the original email subject. This will help us separate the corresponding threads of gmail. Gmail is happy to group emails with the same subjects, but in the scenario of how the sponsorship team organizes the emails, the sponsorship team would like to handle each email separately rather than folding them in the same thread.
Steps to Test This PR
The following steps are also performed and verified.
The Rendered Contents Are The Same
And diff the files in
mails_to_sentExpected Result
No difference shown by the diff command.
Send The Rendered Emails
Expected Result
The receivers could get the email with the render contents.
More Information
Please note I did not upload the corresponding testing json files because #1 has not merged. Touching the same json files will raise conflicts. I could upload them later after #1 is merged.