-
Notifications
You must be signed in to change notification settings - Fork 293
Support release iteration value for assemble workflow rpm #1921
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,29 @@ | |
import logging | ||
from typing import IO | ||
|
||
|
||
class AssembleArgs: | ||
manifest: IO | ||
keep: bool | ||
|
||
def __init__(self) -> None: | ||
|
||
def check_positive(value) -> int: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this method private. |
||
int_value = int(value) | ||
if int_value <= 0: | ||
raise argparse.ArgumentTypeError(f"{value} is invalid, you must enter a positive integer") | ||
return str(int_value) | ||
|
||
parser = argparse.ArgumentParser(description="Assemble an OpenSearch Distribution") | ||
parser.add_argument("manifest", type=argparse.FileType("r"), help="Manifest file.") | ||
parser.add_argument("-b", "--base-url", dest="base_url", help="The base url to download the artifacts.") | ||
parser.add_argument( | ||
"-r", | ||
"--release-iteration", | ||
dest="release_iteration", | ||
type=check_positive, | ||
default="1", | ||
help="The release/iteration number of deb/rpm packages, allow multiple revision of same package version (e.g. 2.0.0-1, 2.0.0-2, 2.0.0-3)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revision -> revisions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Help missing period, is too long and has grammar issues. Just say "Release number." |
||
) | ||
parser.add_argument( | ||
"--keep", | ||
dest="keep", | ||
|
@@ -38,3 +52,4 @@ def __init__(self) -> None: | |
self.manifest = args.manifest | ||
self.keep = args.keep | ||
self.base_url = args.base_url | ||
self.release_iteration = args.release_iteration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add type for the input.
value: str
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not allow me to block non-positive inputs.