#8182 Remove rebuild_strategy for branching
Merged 5 years ago by mohanboddu. Opened 5 years ago by mohanboddu.
mohanboddu/releng branching-modules  into  master

@@ -219,11 +219,25 @@ 

                      url = url.replace('#', '?#')

  

                      # Module build

-                     data = json.dumps({

-                         'scmurl': url,

-                         'branch': stream,

-                         'rebuild_strategy': 'all'

-                     })

+                     # For mass rebuild we need to rebuild all modules again

+                     # For mass branching, since we can reuse already existing

+                     # modules, we dont need rebuild_strategy = all option.

+                     # This saves time and resources

+                     if process == build:

+                         data = json.dumps({

+                             'scmurl': url,

+                             'branch': stream,

+                             'rebuild_strategy': 'all'

+                         })

+                     elif process == branch:

+                         data = json.dumps({

+                             'scmurl': url,

+                             'branch': stream,

+                         })

+                     else:

+                         print("Please select either build or branch for the process type")

+                         sys.exit(1)

+ 

                      rv = requests.post('https://mbs.fedoraproject.org/module-build-service/2/module-builds/', data=data, headers=headers)

                      if rv.ok:

                          print('Building {} module for stream {}'.format(name,stream))

Ack. Although you could avoid some code repetition by assigning the shared values to a dictionary first and later just extend it in the branching codepath.

Pull-Request has been merged by mohanboddu

5 years ago
Metadata