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

Mail Job Notification Plugin #5943

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

harvey0100
Copy link
Contributor

Gmail Plugin for Avocado allows results to be sent to any email. The Origin email though at this time has to come from a google account due to using App Passwords.

PIP package has also been created

Signed off by: Harvey Lynden hlynden@redhat.com

@harvey0100 harvey0100 added this to the #106 - Codename TBD milestone May 29, 2024
@harvey0100 harvey0100 self-assigned this May 29, 2024
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @harvey0100, thank you for your contribution. It is very welcome. I haven't looked at the code yet. But I can give you some comments which should help you to solve the CI failures:

  1. In your git config your email is harveylynden@gmail.com and not hlynden@redhat.com therefore the signedoff-check is failing. You need to change your git config and create a new commit with the proper sign.
  2. Some static checks are failing, please fix them base on the checks output. You can run those tests locally by setup.py test --select=static-checks, and it is recommended to run the tests before you push your changes.
  3. The Readme file has some syntax errors. Therefore, you have the Build Package failures.
  4. The Linux with Python 3.12.0 is not related to your PR and I have already created a fix for that in cannot import name 'packaging' from 'pkg_resources' fix #5942

I hope that it will help you. If you have any questions, don't hesitate to ask.

@harvey0100 harvey0100 force-pushed the GmailPlugin branch 7 times, most recently from 0c0e5cc to ff8c241 Compare June 10, 2024 09:28
Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

Hi @harvey0100,

Thanks for this! Please find my initial comments inline in the changes.

optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/avocado_job_mail.py Outdated Show resolved Hide resolved
optional_plugins/mail/avocado_job_mail.py Outdated Show resolved Hide resolved
optional_plugins/mail/setup.py Outdated Show resolved Hide resolved
@harvey0100 harvey0100 force-pushed the GmailPlugin branch 3 times, most recently from a4624f6 to eb973ff Compare June 14, 2024 14:49
@harvey0100 harvey0100 force-pushed the GmailPlugin branch 3 times, most recently from 39830c7 to 1298f15 Compare June 17, 2024 16:04
@harvey0100 harvey0100 changed the title Gmail Job Notification Plugin Mail Job Notification Plugin Jun 17, 2024
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @harvey0100, thank you very much for the CI fixes. I have more deeply looked at the code and I have a few proposals which IMO increase readability and maintainability of the code. Please let me know what do you think about it.

Also, can you please write a more detailed commit message. For example, you can use your PR description. Thanks.

optional_plugins/mail/MANIFEST.in Outdated Show resolved Hide resolved
optional_plugins/mail/VERSION Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/avocado_mail_result/mail_result.py Outdated Show resolved Hide resolved
optional_plugins/mail/avocado_mail_result/mail_result.py Outdated Show resolved Hide resolved
def _generate_test_summary(data, detail_level):
test_summary = []

def format_test_details(test):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason for this inner method, instead of calling Mail._format_test_details(test, advanced=detail_level) directly?

optional_plugins/mail/avocado_mail_result/mail_result.py Outdated Show resolved Hide resolved
optional_plugins/mail/avocado_mail_result/mail_result.py Outdated Show resolved Hide resolved
@harvey0100 harvey0100 force-pushed the GmailPlugin branch 2 times, most recently from 2ea1b49 to 7fcc607 Compare June 26, 2024 15:27
@harvey0100 harvey0100 force-pushed the GmailPlugin branch 3 times, most recently from 3d073a7 to 4a7f518 Compare June 28, 2024 09:26
Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

Hi @harvey0100 ,

There are a few bits missing to have this properly packaged as an RPM:

diff --git a/python-avocado.spec b/python-avocado.spec
index 4eae27dba..5f71e4f20 100644
--- a/python-avocado.spec
+++ b/python-avocado.spec
@@ -135,6 +135,9 @@ popd
 pushd optional_plugins/result_upload
 %py3_build
 popd
+pushd optional_plugins/mail
+%py3_build
+popd
 %if ! 0%{?rhel}
 pushd optional_plugins/spawner_remote
 %py3_build
@@ -175,6 +178,9 @@ popd
 pushd optional_plugins/result_upload
 %py3_install
 popd
+pushd optional_plugins/mail
+%py3_install
+popd
 %if ! 0%{?rhel}
 pushd optional_plugins/spawner_remote
 %py3_install
@@ -239,6 +245,7 @@ PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH \
 %exclude %{python3_sitelib}/avocado_varianter_pict*
 %exclude %{python3_sitelib}/avocado_varianter_cit*
 %exclude %{python3_sitelib}/avocado_result_upload*
+%exclude %{python3_sitelib}/avocado_result_mail*
 %exclude %{python3_sitelib}/avocado_framework_plugin_result_html*
 %exclude %{python3_sitelib}/avocado_framework_plugin_resultsdb*
 %exclude %{python3_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
@@ -247,6 +254,7 @@ PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH \
 %exclude %{python3_sitelib}/avocado_framework_plugin_golang*
 %exclude %{python3_sitelib}/avocado_framework_plugin_ansible*
 %exclude %{python3_sitelib}/avocado_framework_plugin_result_upload*
+%exclude %{python3_sitelib}/avocado_framework_plugin_result_mail*
 %exclude %{python3_sitelib}/avocado_framework_plugin_spawner_remote*
 %exclude %{python3_sitelib}/tests*

Please include these changes and let's see what packit gives us.

@harvey0100 harvey0100 force-pushed the GmailPlugin branch 5 times, most recently from 77d4734 to 8d79ddb Compare July 26, 2024 09:06
@harvey0100
Copy link
Contributor Author

Hi @harvey0100 ,

There are a few bits missing to have this properly packaged as an RPM:

diff --git a/python-avocado.spec b/python-avocado.spec
index 4eae27dba..5f71e4f20 100644
--- a/python-avocado.spec
+++ b/python-avocado.spec
@@ -135,6 +135,9 @@ popd
 pushd optional_plugins/result_upload
 %py3_build
 popd
+pushd optional_plugins/mail
+%py3_build
+popd
 %if ! 0%{?rhel}
 pushd optional_plugins/spawner_remote
 %py3_build
@@ -175,6 +178,9 @@ popd
 pushd optional_plugins/result_upload
 %py3_install
 popd
+pushd optional_plugins/mail
+%py3_install
+popd
 %if ! 0%{?rhel}
 pushd optional_plugins/spawner_remote
 %py3_install
@@ -239,6 +245,7 @@ PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH \
 %exclude %{python3_sitelib}/avocado_varianter_pict*
 %exclude %{python3_sitelib}/avocado_varianter_cit*
 %exclude %{python3_sitelib}/avocado_result_upload*
+%exclude %{python3_sitelib}/avocado_result_mail*
 %exclude %{python3_sitelib}/avocado_framework_plugin_result_html*
 %exclude %{python3_sitelib}/avocado_framework_plugin_resultsdb*
 %exclude %{python3_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
@@ -247,6 +254,7 @@ PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH \
 %exclude %{python3_sitelib}/avocado_framework_plugin_golang*
 %exclude %{python3_sitelib}/avocado_framework_plugin_ansible*
 %exclude %{python3_sitelib}/avocado_framework_plugin_result_upload*
+%exclude %{python3_sitelib}/avocado_framework_plugin_result_mail*
 %exclude %{python3_sitelib}/avocado_framework_plugin_spawner_remote*
 %exclude %{python3_sitelib}/tests*

Please include these changes and let's see what packit gives us.

Hi Cleber,

Thanks for the changes, I've implemented them and looks like the build is succeding! :)

Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

(waiving the codeclimate "failure")

@richtja richtja self-requested a review July 31, 2024 13:06
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @harvey0100, thank you for your updates. IMO it is almost finished, I have just few style comments.

optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/README.rst Outdated Show resolved Hide resolved
optional_plugins/mail/VERSION Outdated Show resolved Hide resolved
optional_plugins/mail/MANIFEST.in Outdated Show resolved Hide resolved
spell.ignore Outdated Show resolved Hide resolved
@harvey0100 harvey0100 force-pushed the GmailPlugin branch 2 times, most recently from 54b7d52 to adb7684 Compare August 12, 2024 09:47
@harvey0100
Copy link
Contributor Author

All changes have been applied that have been requested, request should be ready for merging.

@@ -0,0 +1 @@
include VERSION README.rst
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @harvey0100, still new line missing here. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll get there one day haha, IDE is now set to save all files with a new line :D - sorted now

Added sphinx target inside configuring.rst
Created symbolic link inside of documentation
Plugin name finalised
Altered towards comments

Signed-off-by: Harvey Lynden <hlynden@redhat.com>
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

After the updates it LGTM, thank you.

@richtja richtja merged commit d223935 into avocado-framework:master Aug 12, 2024
56 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants