Skip to content

Commit

Permalink
Add support for name and version to bump release
Browse files Browse the repository at this point in the history
  • Loading branch information
lcarva committed Jun 24, 2016
1 parent fadf55d commit d590fd9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
1 change: 0 additions & 1 deletion inputs/prod_inner.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
},
{
"args": {
"target": "{{KOJI_TARGET}}",
"hub": "{{KOJI_HUB}}"
},
"name": "bump_release"
Expand Down
6 changes: 2 additions & 4 deletions osbs/build/build_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,13 @@ def render_bump_release(self):
if not self.dj.dock_json_has_plugin_conf(phase, plugin):
return

target = self.spec.koji_target.value
hub = self.spec.kojihub.value
if not (target and hub):
logger.info('removing %s from request as koji info not specified',
if not hub:
logger.info('removing %s from request as koji hub not specified',
plugin)
self.dj.remove_plugin(phase, plugin)
return

self.dj.dock_json_set_arg(phase, plugin, 'target', target)
self.dj.dock_json_set_arg(phase, plugin, 'hub', hub)

def render_koji_promote(self, use_auth=None):
Expand Down
22 changes: 4 additions & 18 deletions tests/build/test_build_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ def test_render_prod_request_with_repo(self, architecture, build_image, build_im
get_plugin(plugins, "prebuild_plugins",
"stop_autorebuild_if_disabled")

assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "target") == "koji-target"
assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "hub") == "http://hub/"

Expand Down Expand Up @@ -364,8 +362,6 @@ def test_render_prod_request(self, proxy):
get_plugin(plugins, "prebuild_plugins",
"stop_autorebuild_if_disabled")

assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "target") == koji_target
assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "hub") == "http://hub/"

Expand Down Expand Up @@ -540,8 +536,6 @@ def test_render_prod_with_secret_request(self):
get_plugin(plugins, "prebuild_plugins",
"stop_autorebuild_if_disabled")

assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "target") == "koji-target"
assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "hub") == "http://hub/"

Expand Down Expand Up @@ -891,8 +885,6 @@ def test_render_with_yum_repourls(self):
get_plugin(plugins, "prebuild_plugins",
"stop_autorebuild_if_disabled")

assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "target") == "koji-target"
assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "hub") == "http://hub/"

Expand All @@ -909,12 +901,11 @@ def test_render_with_yum_repourls(self):
with pytest.raises(NoSuchPluginException):
get_plugin(plugins, "exit_plugins", "sendmail")

@pytest.mark.parametrize(('hub', 'target', 'disabled'), [
('http://hub/', 'koji-target', False),
(None, 'koji-target', True),
('http://hub/', None, True),
@pytest.mark.parametrize(('hub', 'disabled'), [
('http://hub/', False),
(None, True),
])
def test_render_bump_release(self, hub, target, disabled):
def test_render_bump_release(self, hub, disabled):
kwargs = {
'git_uri': TEST_GIT_URI,
'git_ref': TEST_GIT_REF,
Expand All @@ -934,9 +925,6 @@ def test_render_bump_release(self, hub, target, disabled):
if hub:
kwargs['kojihub'] = hub

if target:
kwargs['koji_target'] = target

build_request = BuildRequest(INPUTS_PATH)
build_request.set_params(**kwargs)
build_json = build_request.render()
Expand All @@ -948,8 +936,6 @@ def test_render_bump_release(self, hub, target, disabled):
get_plugin(plugins, "prebuild_plugins", "bump_release")

else:
assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "target") == target
assert plugin_value_get(plugins, "prebuild_plugins", "bump_release",
"args", "hub") == hub

Expand Down

0 comments on commit d590fd9

Please sign in to comment.