#691 option for notifications in untagBuildBypass
Merged 5 years ago by mikem. Opened 6 years ago by tkopecek.
tkopecek/koji issue690  into  master

file modified
+7 -3
@@ -9249,7 +9249,7 @@ 

          context.session.assertPerm('admin')

          add_external_rpm(rpminfo, external_repo, strict=strict)

  

-     def tagBuildBypass(self, tag, build, force=False):

+     def tagBuildBypass(self, tag, build, force=False, notify=True):

          """Tag a build without running post checks or notifications

  

          This is a short circuit function for imports.
@@ -9261,6 +9261,8 @@ 

          """

          context.session.assertPerm('admin')

          _tag_build(tag, build, force=force)

+         if notify:

+             tag_notification(True, None, tag, build, context.session.user_id)

  

      def tagBuild(self, tag, build, force=False, fromtag=None):

          """Request that a build be tagged
@@ -9347,8 +9349,8 @@ 

              tag_notification(False, None, tag, build, user_id, False, "%s: %s" % (exctype, value))

              raise

  

-     def untagBuildBypass(self, tag, build, strict=True, force=False):

-         """Untag a build without any checks or notifications

+     def untagBuildBypass(self, tag, build, strict=True, force=False, notify=True):

+         """Untag a build without any checks

  

          Admins only. Intended for syncs/imports.

  
@@ -9356,6 +9358,8 @@ 

          No return value"""

          context.session.assertPerm('admin')

          _untag_build(tag, build, strict=strict, force=force)

+         if notify:

+             tag_notification(True, None, tag, build, context.session.user_id)

  

      def moveBuild(self, tag1, tag2, build, force=False):

          """Move a build from tag1 to tag2

This also changes the default behavior. Previous bypass tag operations did not notify. I believe there are a number of rel-eng scripts that perform mass tagging and I think that quieting notifications is part of the reasons.

But maybe it is better to make the change an notify by default. I'm not sure, but I think we should check with some users before we do this.

Also, seems like we ought to make the same change to tagBuildBypass if we're going this way.

rebased onto f4b532eb4df3c52d0b8aac9a8e2c994b314e96eb

6 years ago

I've added fix also for tagBuild and sent a question to koji-devel.

I don't think the bypass calls should notify in the failure case. This could lead to some some repetitive messages in some cases.

rebased onto b667f73

5 years ago

Ok, I think it should work, rebased and updated.

:thumbsup:

merging with a docstring fix

Commit 8290719 fixes this pull-request

Pull-Request has been merged by mikem

5 years ago