#4012 Drop unused argument and avoid updating twice a request repo
Merged 5 years ago by pingou. Opened 5 years ago by pingou.

file modified
+1 -1
@@ -43,7 +43,7 @@ 

          project=project,

          topic=topic,

          msg=msg,

-         redis=None,  # web-hook notification are handled separately

+         webhook=False,  # web-hook notification are handled separately

      )

  

  

file modified
+2 -1
@@ -1988,7 +1988,8 @@ 

                      notification=True,

                  )

                  session.commit()

-         pagure.lib.git.update_git(request, repo=request.project)

+         else:

+             pagure.lib.git.update_git(request, repo=request.project)

  

      if with_diff:

          return (diff_commits, diff)

file modified
+2 -2
@@ -98,7 +98,7 @@ 

          _log.exception("Error sending stomp message")

  

  

- def log(project, topic, msg, redis=None):

+ def log(project, topic, msg, webhook=True):

      """ This is the place where we send notifications to user about actions

      occuring in pagure.

      """
@@ -117,7 +117,7 @@ 

      ):

          stomp_publish(topic, msg)

  

-     if redis and project and not project.private:

+     if webhook and project and not project.private:

          pagure.lib.tasks_services.webhook_notification.delay(

              topic=topic,

              msg=msg,

file modified
-29
@@ -420,7 +420,6 @@ 

                  project=issue.project.to_json(public=True),

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

      # TODO: we should notify the SSE server even on update of the ticket
@@ -526,7 +525,6 @@ 

                      tags=added_tags,

                      agent=user_obj.username,

                  ),

-                 redis=REDIS,

              )

  

          # Send notification for the event-source server
@@ -553,7 +551,6 @@ 

                      tags=added_tags,

                      agent=user_obj.username,

                  ),

-                 redis=REDIS,

              )

  

          # Send notification for the event-source server
@@ -602,7 +599,6 @@ 

                      project=issue.project.to_json(public=True),

                      agent=user_obj.username,

                  ),

-                 redis=REDIS,

              )

  

          # Send notification for the event-source server
@@ -639,7 +635,6 @@ 

                      project=issue.project.to_json(public=True),

                      agent=user_obj.username,

                  ),

-                 redis=REDIS,

              )

          issue.last_updated = datetime.datetime.utcnow()

  
@@ -678,7 +673,6 @@ 

                  project=request.project.to_json(public=True),

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

          return "Request reset"
@@ -707,7 +701,6 @@ 

                  project=request.project.to_json(public=True),

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

          return "Request assigned"
@@ -742,7 +735,6 @@ 

                      added_dependency=issue_blocked.id,

                      agent=user_obj.username,

                  ),

-                 redis=REDIS,

              )

  

          # Send notification for the event-source server
@@ -802,7 +794,6 @@ 

                      removed_dependency=parent_del,

                      agent=user_obj.username,

                  ),

-                 redis=REDIS,

              )

  

          # Send notification for the event-source server
@@ -874,7 +865,6 @@ 

              tags=removed_tags,

              agent=user_obj.username,

          ),

-         redis=REDIS,

      )

  

      return msgs
@@ -919,7 +909,6 @@ 

                  tags=removed_tags,

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

          # Send notification for the event-source server
@@ -940,7 +929,6 @@ 

                  tags=removed_tags,

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

          # Send notification for the event-source server
@@ -1054,7 +1042,6 @@ 

              new_tag_color=new_tag_color,

              agent=user_obj.username,

          ),

-         redis=REDIS,

      )

  

      return msgs
@@ -1175,7 +1162,6 @@ 

                  new_access=access,

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

          return "User access updated"
@@ -1200,7 +1186,6 @@ 

              access=access,

              agent=user_obj.username,

          ),

-         redis=REDIS,

      )

  

      return "User added"
@@ -1278,7 +1263,6 @@ 

                  new_access=access,

                  agent=user,

              ),

-             redis=REDIS,

          )

  

          return "Group access updated"
@@ -1303,7 +1287,6 @@ 

              access=access,

              agent=user,

          ),

-         redis=REDIS,

      )

  

      return "Group added"
@@ -1400,7 +1383,6 @@ 

          msg=dict(

              pullrequest=request.to_json(public=True), agent=user_obj.username

          ),

-         redis=REDIS,

      )

  

      if (
@@ -1460,7 +1442,6 @@ 

                  "comment": comment.to_json(public=True),

                  "agent": user_obj.username,

              },

-             redis=REDIS,

          )

  

      if REDIS and not parent.project.private:
@@ -1539,7 +1520,6 @@ 

              flag=pr_flag.to_json(public=True),

              agent=user_obj.username,

          ),

-         redis=REDIS,

      )

  

      return ("Flag %s" % action, pr_flag.uid)
@@ -1597,7 +1577,6 @@ 

              flag=c_flag.to_json(public=True),

              agent=user_obj.username,

          ),

-         redis=REDIS,

      )

  

      return ("Flag %s" % action, c_flag.uid)
@@ -1840,7 +1819,6 @@ 

                  project=issue.project.to_json(public=True),

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

      return issue
@@ -1868,7 +1846,6 @@ 

                  project=issue.project.to_json(public=True),

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

      session.commit()
@@ -1940,7 +1917,6 @@ 

          msg=dict(

              pullrequest=request.to_json(public=True), agent=user_obj.username

          ),

-         redis=REDIS,

      )

  

      # Send notification to the CI server
@@ -2112,7 +2088,6 @@ 

                  fields=list(set(edit)),

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

      if REDIS and edit and not issue.project.private:
@@ -2193,7 +2168,6 @@ 

                  fields=update,

                  agent=user_obj.username,

              ),

-             redis=REDIS,

          )

  

          if "pull_request_access_only" in update:
@@ -3247,7 +3221,6 @@ 

          msg=dict(

              pullrequest=request.to_json(public=True), agent=user_obj.username

          ),

-         redis=REDIS,

      )

  

  
@@ -3296,7 +3269,6 @@ 

              merged=merged,

              agent=user_obj.username,

          ),

-         redis=REDIS,

      )

  

  
@@ -3960,7 +3932,6 @@ 

                  fields=edits,

                  agent=user.username,

              ),

-             redis=REDIS,

          )

          msg = 'Group "%s" (%s) edited' % (group.display_name, group.group_name)

  

@@ -326,7 +326,7 @@ 

              self.assertIn(

                  'User added', output_text)

  

-         mock_log.assert_called_with(ANY, topic='project.user.added', msg=ANY, redis=ANY)

+         mock_log.assert_called_with(ANY, topic='project.user.added', msg=ANY)

  

      @patch('pagure.decorators.admin_session_timedout')

      def test_add_group_project_when_user_mngt_off(self, ast):

no initial comment

rebased onto d7ee9f3d4326cbd39b2640066f68523eec294a7b

5 years ago

rebased onto 1ed1ef8

5 years ago

Pretty please pagure-ci rebuild

ok the tests are passing locally and I'm pretty sure jenkins' failure aren't related to these changes.
I'm going to merge them as is as I need them in another PR.

Thanks for your review @cverna !

Pull-Request has been merged by pingou

5 years ago