#432 override build_arch_can_fail settings
Merged 2 years ago by mikem. Opened 3 years ago by tkopecek.
tkopecek/koji issue413  into  master

file modified
+4 -3

@@ -870,7 +870,8 @@ 

          #(initBuild raises an exception if there is a conflict)

          try:

              self.extra_information = { "src": src, "data": data, "target": target }

-             srpm,rpms,brmap,logs = self.runBuilds(srpm, build_tag, archlist, repo_info['id'])

+             srpm,rpms,brmap,logs = self.runBuilds(srpm, build_tag, archlist,

+                     repo_info['id'], fail_fast=self.opts.get('fail_fast'))

  

              if opts.get('scratch'):

                  #scratch builds do not get imported

@@ -1013,7 +1014,7 @@ 

          return 'noarch'

  

  

-     def runBuilds(self, srpm, build_tag, archlist, repo_id):

+     def runBuilds(self, srpm, build_tag, archlist, repo_id, fail_fast=True):

          self.logger.debug("Spawning jobs for arches: %r" % (archlist))

          subtasks = {}

          keep_srpm = True

@@ -1030,7 +1031,7 @@ 

          self.logger.debug("Waiting on subtasks...")

  

          # wait for subtasks to finish

-         failany = not getattr(self.options, 'build_arch_can_fail', False)

+         failany = not (getattr(self.options, 'build_arch_can_fail', False) and fail_fast)

          results = self.wait(subtasks.values(), all=True, failany=failany)

  

          # finalize import

file modified
+1

@@ -88,4 +88,5 @@ 

  ;serverca = /etc/kojid/serverca.crt

  

  ;if set to True, failing subtask will not automatically cancel other siblings

+ ;in such case it could be overriden by user 'koji build --fail-slow' option

  ;build_arch_can_fail = False

file modified
+4 -1

@@ -409,6 +409,9 @@ 

      parser.add_option("--quiet", action="store_true",

                        help=_("Do not print the task information"), default=options.quiet)

      parser.add_option("--arch-override", help=_("Override build arches"))

+     parser.add_option("--fail-slow", action="store_false", dest="fail_fast", default=True,

+                       help=_("Override builder's build_arch_can_fail settings "

+                              "and doesn't cancel other subtasks if some fails"))

      parser.add_option("--repo-id", type="int", help=_("Use a specific repo"))

      parser.add_option("--noprogress", action="store_true",

                        help=_("Do not display progress of the upload"))

@@ -438,7 +441,7 @@ 

      opts = {}

      if build_opts.arch_override:

          opts['arch_override'] = parse_arches(build_opts.arch_override)

-     for key in ('skip_tag', 'scratch', 'repo_id'):

+     for key in ('skip_tag', 'scratch', 'repo_id', 'fail_fast'):

          val = getattr(build_opts, key)

          if val is not None:

              opts[key] = val

file modified
+20 -10

@@ -39,7 +39,7 @@ 

          source = 'srpm'

          task_id = 1

          args = [target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -91,7 +91,7 @@ 

          source = 'http://scm'

          task_id = 1

          args = [target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -198,6 +198,8 @@ 

    --quiet               Do not print the task information

    --arch-override=ARCH_OVERRIDE

                          Override build arches

+   --fail-slow           Override builder's build_arch_can_fail settings and

+                         doesn't cancel other subtasks if some fails

    --repo-id=REPO_ID     Use a specific repo

    --noprogress          Do not display progress of the upload

    --background          Run the build at a lower priority

@@ -281,7 +283,11 @@ 

          task_id = 1

          repo_id = 2

          args = ['--repo-id=' + str(repo_id), target, source]

-         opts = {'repo_id': repo_id, 'skip_tag': True}

+         opts = {

+             'repo_id': repo_id,

+             'skip_tag': True,

+             'fail_fast': True,

+         }

          priority = None

  

          self.session.build.return_value = task_id

@@ -475,7 +481,11 @@ 

              '--scratch',

              target,

              source]

-         opts = {'arch_override': arch_override, 'scratch': True}

+         opts = {

+             'arch_override': arch_override,

+             'scratch': True,

+             'fail_fast': True,

+         }

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -526,7 +536,7 @@ 

          task_id = 1

          args = ['--background', target, source]

          priority = 5

-         opts = {}

+         opts = {'fail_fast': True}

  

          self.session.getBuildTarget.return_value = target_info

          self.session.getTag.return_value = dest_tag_info

@@ -574,7 +584,7 @@ 

          source = 'srpm'

          task_id = 1

          args = [target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -625,7 +635,7 @@ 

          source = 'srpm'

          task_id = 1

          args = ['--noprogress', target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -679,7 +689,7 @@ 

          task_id = 1

          quiet = True

          args = ['--quiet', target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -729,7 +739,7 @@ 

          task_id = 1

          quiet = None

          args = ['--wait', target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info

@@ -782,7 +792,7 @@ 

          source = 'srpm'

          task_id = 1

          args = ['--nowait', target, source]

-         opts = {}

+         opts = {'fail_fast': True}

          priority = None

  

          self.session.getBuildTarget.return_value = target_info