Skip to content

Commit

Permalink
Fix wait repo command for Koji 1.35
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Verga <[email protected]>
(cherry picked from commit 099b1a5)
  • Loading branch information
mattiaverga authored and mergify[bot] committed Oct 25, 2024
1 parent 4ed326c commit 27e493b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bodhi-client/bodhi/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ def _generate_wait_repo_command(override: munch.Munch, client: bindings.BodhiCli
if 'release_id' in override.build:
release = client.get_releases(ids=[override.build.release_id])['releases'][0]
return ('koji', 'wait-repo', f'{release.dist_tag}-build',
f'--build={override.build.nvr}')
f'--build={override.build.nvr}', '--request')
return None


Expand Down
2 changes: 1 addition & 1 deletion bodhi-client/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
Use the following to ensure the override is active:
\t$ koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25
\t$ koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25 --request
"""

Expand Down
25 changes: 14 additions & 11 deletions bodhi-client/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ def test_with_release_id(self, mocker, mocked_client_class):

echo.assert_called_once_with(
'\n\nUse the following to ensure the override is active:\n\n\t$ koji '
'wait-repo f25-build --build=python-pyramid-1.5.6-3.fc25\n')
'wait-repo f25-build --build=python-pyramid-1.5.6-3.fc25 --request\n')
c.send_request.assert_called_once_with('releases/', verb='GET',
params={'ids': [15]})

Expand Down Expand Up @@ -1324,11 +1324,12 @@ def _send_request(*args, **kwargs):

assert result.exit_code == 0
expected_output = (
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25\n\n'.format(
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25 '
'--request\n\n'.format(
client_test_data.EXPECTED_OVERRIDE_STR_OUTPUT))
assert result.output == expected_output
call.assert_called_once_with(
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25'),
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25', '--request'),
stderr=-1, stdout=-1)

def test_wait_flag(self, mocked_client_class, mocker):
Expand All @@ -1353,11 +1354,12 @@ def _send_request(*args, **kwargs):

assert result.exit_code == 0
expected_output = (
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25\n\n'.format(
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25 '
'--request\n\n'.format(
client_test_data.EXPECTED_OVERRIDE_STR_OUTPUT))
assert result.output == expected_output
call.assert_called_once_with(
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25'),
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25', '--request'),
stderr=-1, stdout=-1)

def test_wait_flag_fail(self, mocked_client_class, mocker):
Expand All @@ -1382,12 +1384,12 @@ def _send_request(*args, **kwargs):

assert result.exit_code == 42
expected_output = (
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25\n\n'
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25 --request\n\n'
'WARNING: ensuring active override failed for js-tag-it-2.0-1.fc25\n')
expected_output = expected_output.format(client_test_data.EXPECTED_OVERRIDE_STR_OUTPUT)
assert result.output == expected_output
call.assert_called_once_with(
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25'),
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25', '--request'),
stderr=-1, stdout=-1)

def test_create_multiple_overrides(self, mocked_client_class):
Expand Down Expand Up @@ -2032,11 +2034,12 @@ def _send_request(*args, **kwargs):

assert result.exit_code == 0
expected_output = (
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25\n\n'.format(
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25 '
'--request\n\n'.format(
client_test_data.EXPECTED_OVERRIDE_STR_OUTPUT))
assert result.output == expected_output
call.assert_called_once_with(
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25'),
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25', '--request'),
stderr=-1, stdout=-1)

def test_wait_flag_fail(self, mocked_client_class, mocker):
Expand All @@ -2060,12 +2063,12 @@ def _send_request(*args, **kwargs):

assert result.exit_code == 24
expected_output = (
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25\n\n'
'{}\n\nRunning koji wait-repo f25-build --build=js-tag-it-2.0-1.fc25 --request\n\n'
'WARNING: ensuring active override failed for js-tag-it-2.0-1.fc25\n')
expected_output = expected_output.format(client_test_data.EXPECTED_OVERRIDE_STR_OUTPUT)
assert result.output == expected_output
call.assert_called_once_with(
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25'),
('koji', 'wait-repo', 'f25-build', '--build=js-tag-it-2.0-1.fc25', '--request'),
stderr=-1, stdout=-1)


Expand Down
2 changes: 1 addition & 1 deletion bodhi-server/bodhi/server/templates/override.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h5 class="fw-bold d-flex align-items-center">
<%doc>
FIXME: Add a Release.build_tag column to the model?
</%doc>
<pre class="font-size-09 bg-transparent mb-0 ps-0 pt-0"><code><small>$ koji wait-repo ${override.build.release.dist_tag}-build --build=${override.build.nvr}</small></code></pre>
<pre class="font-size-09 bg-transparent mb-0 ps-0 pt-0"><code><small>$ koji wait-repo ${override.build.release.dist_tag}-build --build=${override.build.nvr} --request</small></code></pre>
</div>
%endif

Expand Down

0 comments on commit 27e493b

Please sign in to comment.