Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add architecture filtering to osc release #1577

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions osc/_private/api_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def release(
project,
package,
repository,
architecture,
target_project,
target_repository,
set_release_to=None,
Expand All @@ -102,6 +103,7 @@ def release(
target_project,
target_package=None,
repository=repository,
architecture=architecture,
dest_repository=target_repository,
delayed=delayed,
)
Expand All @@ -114,6 +116,8 @@ def release(
url_query = {"cmd": "release"}
if repository:
url_query["repository"] = repository
if architecture:
url_query["arch"] = architecture
Comment on lines +119 to +120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment, because this is perfectly fine...
The if statement is superfluous now, because the latest osc code ignores any query parameters that are set to None.

if target_project:
url_query["target_project"] = target_project
if target_repository:
Expand Down
4 changes: 4 additions & 0 deletions osc/_private/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def format_msg_project_package_options(
dest_project=None,
dest_package=None,
repository=None,
architecture=None,
dest_repository=None,
**options,
):
Expand All @@ -34,6 +35,9 @@ def format_msg_project_package_options(
if dest_repository:
msg += f" repository '{dest_repository}'"

if architecture:
msg += f" architecture '{architecture}'"

msg_options = [key.replace("_", "-") for key, value in options.items() if value]
if msg_options:
msg_options.sort()
Expand Down
3 changes: 3 additions & 0 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3922,6 +3922,8 @@ def do_copypac(self, subcmd, opts, *args):
keep_link=opts.keep_link)
print(decode_it(r))

@cmdln.option('-a', '--arch', metavar='ARCH',
help='Release only binaries from the specified architecture')
@cmdln.option('-r', '--repo', metavar='REPO',
help='Release only binaries from the specified repository')
@cmdln.option('--target-project', metavar='TARGETPROJECT',
Expand Down Expand Up @@ -3954,6 +3956,7 @@ def do_release(self, subcmd, opts, *args):
project=project,
package=package,
repository=opts.repo,
architecture=opts.arch,
target_project=opts.target_project,
target_repository=opts.target_repository,
set_release_to=opts.set_release,
Expand Down
Loading