| |
@@ -3478,9 +3478,9 @@
|
| |
return resp
|
| |
|
| |
def module_submit_build(self, scm_url, branch, auth_method,
|
| |
- optional=None, oidc_id_provider=None,
|
| |
- oidc_client_id=None, oidc_client_secret=None,
|
| |
- oidc_scopes=None):
|
| |
+ buildrequires=None, requires=None, optional=None,
|
| |
+ oidc_id_provider=None, oidc_client_id=None,
|
| |
+ oidc_client_secret=None, oidc_scopes=None):
|
| |
"""
|
| |
Submit a module build to the MBS
|
| |
|
| |
@@ -3488,6 +3488,10 @@
|
| |
:param branch: a string of the module's branch
|
| |
:param str auth_method: a string of the authentication method used by
|
| |
the MBS.
|
| |
+ :param list buildrequires: a list of buildrequires in the format of
|
| |
+ 'name:stream' to override.
|
| |
+ :param list requires: a list of requires in the format of 'name:stream'
|
| |
+ to override.
|
| |
:param optional: an optional list of "key=value" to be passed in with
|
| |
the MBS build submission.
|
| |
:type optional: list[str]
|
| |
@@ -3514,10 +3518,22 @@
|
| |
raise rpkgError(
|
| |
'Optional arguments are not in the proper "key=value" format')
|
| |
|
| |
+ for dep_type, overrides in (('buildrequires', buildrequires),
|
| |
+ ('requires', requires)):
|
| |
+ for override in overrides or []:
|
| |
+ dep_name, dep_stream = override
|
| |
+ # Get the override key that MBS accepts (e.g.
|
| |
+ # buildrequire_overrides)
|
| |
+ key = '{0}_overrides'.format(dep_type[:-1])
|
| |
+ body.setdefault(key, {})
|
| |
+ body[key].setdefault(dep_name, [])
|
| |
+ body[key][dep_name].append(dep_stream)
|
| |
+
|
| |
conflicting_keys = set(body.keys()) & set(optional_dict.keys())
|
| |
if conflicting_keys:
|
| |
raise rpkgError('The following optional arguments conflict with other arguments: {0}'
|
| |
.format(', '.join(conflicting_keys)))
|
| |
+
|
| |
body.update(optional_dict)
|
| |
url = self.module_get_url(build_id=None, action='POST')
|
| |
resp = self.module_send_authorized_request(
|
| |
Addresses part of FACTORY-3084