#346 Add --fail-fast functionality.
Merged 3 years ago by cqi. Opened 3 years ago by cqi.

file modified
+8 -1
@@ -1951,7 +1951,8 @@ 

              commit_hash or self.commithash)

  

      def build(self, skip_tag=False, scratch=False, background=False,

-               url=None, chain=None, arches=None, sets=False, nvr_check=True):

+               url=None, chain=None, arches=None, sets=False, nvr_check=True,

+               fail_fast=False):

          """Initiate a build.  Available options are:

  

          skip_tag: Skip the tag action after the build
@@ -1971,6 +1972,9 @@ 

          nvr_check: A boolean; locally construct NVR and submit a build only if

                     NVR doesn't exist in a build system

  

+         fail_fast: Perform the build in fast failure mode, which will cause the

+         entire build to fail if any subtask/architecture build fails.

+ 

          This function submits the task to koji and returns the taskID

  

          It is up to the client to wait or watch the task.
@@ -2022,6 +2026,9 @@ 

          if background:

              cmd.append('--background')

              priority = 5  # magic koji number :/

+         if fail_fast:

+             opts['fail_fast'] = True

+             cmd.append('--fail-fast')

          if arches:

              if not scratch:

                  raise rpkgError('Cannot override arches for non-scratch '

file modified
+12 -3
@@ -493,6 +493,9 @@ 

          self.build_parser_common.add_argument(

              '--background', action='store_true', default=False,

              help='Run the build at a low priority')

+         self.build_parser_common.add_argument(

+             '--fail-fast', action='store_true', default=False,

+             help='Fail the build immediately if any arch fails')

  

      def register_rpm_common(self):

          """Create a common parser for rpm commands"""
@@ -1457,9 +1460,15 @@ 

          nvr_check = True

          if hasattr(self.args, 'nvr_check'):

              nvr_check = self.args.nvr_check

-         task_id = self.cmd.build(self.args.skip_tag, self.args.scratch,

-                                  self.args.background, url, chain, arches,

-                                  sets, nvr_check)

+         task_id = self.cmd.build(skip_tag=self.args.skip_tag,

+                                  scratch=self.args.scratch,

+                                  background=self.args.background,

+                                  url=url,

+                                  chain=chain,

+                                  arches=arches,

+                                  sets=sets,

+                                  nvr_check=nvr_check,

+                                  fail_fast=self.args.fail_fast)

  

          # Log out of the koji session

          self.cmd.kojisession.logout()

Fixes #331
Merges: #332

Signed-off-by: Jason Tibbitts tibbs@math.uh.edu
Signed-off-by: Chenxiong Qi cqi@redhat.com

Two updates:

  • patch is associated with issue in commit message.
  • put argument fail_fast at the end of method build, which is suggested by Ondrej.

rebased onto a5cf4b51d7210ebb2abcc16320e83d4c4062ca92

3 years ago

rebased onto 24b70abd9e435dfa7ba3d69be14851602bd8c7b2

3 years ago

Looks good to me. If you add Merges: #332 to the commit message, that PR will be automatically closed as merged when this one is.

rebased onto 018a423

3 years ago

Commit message is updated. Going to merge. Thanks. :)

Pull-Request has been merged by cqi

3 years ago