#4625 Send notification when a branch is created
Merged 2 years ago by pingou. Opened 2 years ago by fbo.

file modified
+15 -5
@@ -330,7 +330,7 @@ 

                          refname,

                          oldrev,

                      )

-                     print("Deleting a tag, so we won't run the " "pagure hook")

+                     print("Deleting a tag, so we won't run the pagure hook")

                  elif refname.startswith("refs/heads/"):

                      refname = refname.replace("refs/heads/", "")

                      send_action_notification(
@@ -343,13 +343,11 @@ 

                          refname,

                          oldrev,

                      )

-                     print(

-                         "Deleting a branch, so we won't run the " "pagure hook"

-                     )

+                     print("Deleting a branch, so we won't run the pagure hook")

                  else:

                      print(

                          "Deleting %s, so we wont run the pagure hook nor "

-                         "send notifications"

+                         "send notifications" % refname

                      )

                  continue

              elif set(oldrev) == set(["0"]):
@@ -366,6 +364,18 @@ 

                          refname,

                          newrev,

                      )

+                 if refname.startswith("refs/heads/"):

+                     refname = refname.replace("refs/heads/", "")

+                     send_action_notification(

+                         session,

+                         "branch",

+                         "creation",

+                         project,

+                         repodir,

+                         username,

+                         refname,

+                         newrev,

+                     )

              elif pagure.lib.git.is_forced_push(oldrev, newrev, repodir):

                  forced = True

                  base = pagure.lib.git.get_base_revision(

no initial comment

Is this sending notifications on private repos? We should not

Not sure to follow, have I changed something in the existing logic ?

pretty please pagure-ci rebuild

2 years ago

Now it passed, we have something up on the ci pipeline

Let's keep the prints there are informational for the users (the broken string can be fixed though :))

rebased onto 9e3e5011390fc41feb96284fac316fc8a8869f14

2 years ago

pretty please pagure-ci rebuild

2 years ago

Let's rebase and get this in :)

rebased onto 2a442ac2091c00ecbf64ca746e6ab8b1c5c4fef7

2 years ago

Let's try another rebase to see if the tests remain red?

rebased onto 0bb745a

2 years ago

Pull-Request has been merged by pingou

2 years ago