#4423 Include a small introduction text to email on loading files
Merged 5 years ago by pingou. Opened 5 years ago by pingou.

file modified
+8 -1
@@ -308,7 +308,14 @@ 

      file_list = set(get_files_to_load(project.fullname, commits, abspath))

      n = len(file_list)

      _log.info("LOADJSON: %s files to process" % n)

-     mail_body = []

+     mail_body = [

+         "Good Morning",

+         "",

+         "This is the log of loading all the files pushed in the git repo into",

+         "the database. It should ignore files that are not JSON files, this",

+         "is fine.",

+         "",

+     ]

  

      for idx, filename in enumerate(sorted(file_list)):

          _log.info(

@@ -332,6 +332,11 @@ 

          )

          calls = [

              call(

+                 u'Good Morning\n\n'

+                 u'This is the log of loading all the files pushed in the git '

+                 u'repo into\n'

+                 u'the database. It should ignore files that are not JSON files,'

+                 u' this\nis fine.\n\n'

                  u'Loading: file1 -- 1/2 ... ... Done\n'

                  u'Loading: file2 -- 2/2 ... ... Done',

                  u'Issue import report',
@@ -380,6 +385,11 @@ 

  

          calls = [

              call(

+                 u'Good Morning\n\n'

+                 u'This is the log of loading all the files pushed in the git '

+                 u'repo into\n'

+                 u'the database. It should ignore files that are not JSON files,'

+                 u' this\nis fine.\n\n'

                  u'Loading: file1 -- 1/2 ... ... FAILED\n',

                  u'Issue import report',

                  u'bar@pingou.com'
@@ -805,6 +815,11 @@ 

          up_pr.assert_not_called()

          calls = [

              call(

+                 u'Good Morning\n\n'

+                 u'This is the log of loading all the files pushed in the git '

+                 u'repo into\n'

+                 u'the database. It should ignore files that are not JSON files,'

+                 u' this\nis fine.\n\n'

                  u'Loading: %s -- 1/1 ... ... Done' % issue.uid,

                  u'Issue import report',

                  u'bar@pingou.com'

Basically, this introduce the rest of the email which will contain
the log about loading the JSON files pushed to the git repositories
to the DB, thus allowing to update tickets/PRs from the git repos.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

rebased onto 253d95f72ee93671a00767af50767dbea1f9d49a

5 years ago

rebased onto b776534d9db82a17b63dfebc52d9b18d4c20f496

5 years ago

rebased onto 6b7c8d8

5 years ago

@lenkaseg for example this PR passes CI w/o the black fixes :s

Thanks for the review :)

Pull-Request has been merged by pingou

5 years ago