def parse_args(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-v', '--verbose', help="Increase verbosity level, specify multiple times to increase verbosity", action='count', default=1) parser.add_argument('-n', '--dry-run', action='store_true', help="Only do read-only or simulate actions, does not release TumbleSLE") parser.add_argument('--dry-run-rsync', action='store_true', help="Execute rsync with dry-run. Should be specified additionally to '--dry-run'") parser.add_argument('--openqa-host', help="openQA host to retrieve results from", default='https://openqa.opensuse.org') parser.add_argument('--group-id', help="Group id to search in from openQA host", default=19) parser.add_argument('--product', help="The product name to act upon, must be equivalent to --group-id and must match entry in config file (if any).", default="Leap 42.2") parser.add_argument('--check-build', help="""If specified, checks specified build number (integer) instead of 'last' finished.""", default='last') parser.add_argument('--check-against-build', help="""If specified, checks against specified build number (integer). Specify 'release_info' for reading release info file from destination folder, see '--release-file' and '--dest'. Specify 'tagged' for last tagged on group overview page within openQA""", default='release_info') parser.add_argument('--run-once', action='store_true', help="Only run once, not continuously") parser.add_argument('--config-path', help="Path to config file with whitelist.", default=CONFIG_PATH) parser.add_argument('--whitelist', help="Whitelist entries as for the config file (comma separated). Additional to config file entries", default='') parser.add_argument('--src', help="""Source directory for rsync call pointing to factory subdir within openQA. Make sure to end the path with '/'. Can be anything rsync understands""", default='/var/lib/openqa/factory/') parser.add_argument('--dest', help="""Target directory for rsync call where to put TumbleSLE assets. Make sure to end the path with '/'. Can be anything rsync understands but must be local.""", default='/srv/www/tumblesle/') parser.add_argument('--match', help="Globbing pattern that has to be matched when searching for builds as well as when syncing assets on release", default='open*-42.2*x86_64*') parser.add_argument('--match-hdds', help="Additional globbing pattern to '--match' for hdd images as they are named differently more often than not", default=None) parser.add_argument('--release-file', help="""Name of release file including the build number. This file is read from the path specified by '--dest' and is written back to it.""", default='.release_info') parser.add_argument('--sleeptime', help="Time to sleep between runs in seconds. Has no effect with '--run-once'", default=240) parser.add_argument('--post-release-hook', help="Specify application path for a post-release hook which is called after every successful release", default=None) add_load_save_args(parser) return parser.parse_args()
def parse_args(): parser = argparse.ArgumentParser(description=__doc__, formatter_class=CustomFormatter) parser.add_argument( '-v', '--verbose', help= "Increase verbosity level, specify multiple times to increase verbosity", action='count', default=1) parser.add_argument( '-n', '--no-progress', action='store_true', help="Be terse and only output the report, no progress indication") parser.add_argument( '-s', '--output-state-results', action='store_true', help= 'Additional plain text output of arch-specific state results, e.g. all NEW_ISSUE; on for "verbose" mode' ) parser.add_argument('--host', default='https://openqa.opensuse.org', help='openQA host to access') parser.add_argument( '-j', '--job-groups', help= """Only handle selected job group(s), comma separated, e.g. \'openSUSE Tumbleweed Gnome\'. A regex also works, e.g. \'openSUSE Tumbleweed\' or \'(Gnome|KDE)\'.""" ) parser.add_argument( '-J', '--job-group-urls', help= """Only handle selected job group(s) specified by URL, comma separated. Overwrites "--host" argument. Skips parsing on main page and can actually save some seconds.""" ) builds = parser.add_mutually_exclusive_group() builds.add_argument('-b', '--builds', help="""Select explicit builds, comma separated. Specify as unambigous search terms, e.g. build number, the full string, etc. Only works with single job-group/job-group-urls. Default 'last' and 'previous'.""") builds.add_argument( '-B', '--against-reviewed', metavar='BUILD', help= """Compare specified build against last reviewed (as found in comments section). E.g. if the last reviewed job was '0123' and you want to compare build '0128' against '0123', specify just '0128' and the last reviewed job is found from the comments section if the comment is sticking to the template format for review comments. Special argument 'last' will compare the last finished build against the last reviewed one.""" ) parser.add_argument( '-T', '--verbose-test', help= 'Increase test result verbosity level, specify multiple times to increase verbosity', action='count', default=1) parser.add_argument( '-r', '--bugrefs', action='store_true', help= """Parse \'bugrefs\' from test results comments and triage issues accordingly. See https://progress.opensuse.org/projects/openqav3/wiki/Wiki#Show-bug-or-label-icon-on-overview-if-labeled-gh550 for details about bugrefs in openQA""") parser.add_argument( '-R', '--query-issue-status', action='store_true', help= """Query issue trackers for the issues found and report on their status and assignee. Implies "-r/--bugrefs" and needs configuration file {} with credentials, see '--query-issue-status-help'.""" .format(CONFIG_PATH)) parser.add_argument( '--query-issue-status-help', action='store_true', help= """Shows help how to setup '--query-issue-status' configuration file.""" ) parser.add_argument( '--report-links', action='store_true', help= """Generate issue reporting links into report. Needs configuration file for product mapping, see '--query-issue-status-help'.""") parser.add_argument( '-a', '--arch', help='Only single architecture, e.g. \'x86_64\', not all') parser.add_argument('-f', '--filter', help='Filter for \'closed\' or \'unassigned\' issues.') parser.add_argument( '--running-threshold', default=0, help= 'Percentage of jobs that may still be running for the build to be considered \'finished\' anyway' ) parser.add_argument('--no-empty-sections', action='store_false', default=True, dest='show_empty', help='Only show sections in report with content') parser.add_argument('--include-softfails', action='store_true', default=False, help="""Also include softfails in reports. Not included by default as less important and there is no carry over for soft fails, i.e. there are no bugrefs attached to these failures in most cases but they should already carry bug references by other means anyway.""") add_load_save_args(parser) args = parser.parse_args() if args.query_issue_status_help: print(CONFIG_USAGE) print("Expected file path: {}".format(CONFIG_PATH)) sys.exit(0) return args
def parse_args(): parser = argparse.ArgumentParser(description=__doc__, formatter_class=CustomFormatter) parser.add_argument('-v', '--verbose', help="Increase verbosity level, specify multiple times to increase verbosity", action='count', default=1) parser.add_argument('-n', '--no-progress', action='store_true', help="Be terse and only output the report, no progress indication") parser.add_argument('-s', '--output-state-results', action='store_true', help='Additional plain text output of arch-specific state results, e.g. all NEW_ISSUE; on for "verbose" mode') parser.add_argument('--host', default='https://openqa.opensuse.org', help='openQA host to access') parser.add_argument('-j', '--job-groups', help="""Only handle selected job group(s), comma separated, e.g. \'openSUSE Tumbleweed Gnome\'. A regex also works, e.g. \'openSUSE Tumbleweed\' or \'(Gnome|KDE)\'.""") parser.add_argument('-J', '--job-group-urls', help="""Only handle selected job group(s) specified by URL, comma separated. Overwrites "--host" argument. Skips parsing on main page and can actually save some seconds.""") builds = parser.add_mutually_exclusive_group() builds.add_argument('-b', '--builds', help="""Select explicit builds, comma separated. Specify as unambigous search terms, e.g. build number, the full string, etc. Only works with single job-group/job-group-urls. Default 'last' and 'previous'.""") builds.add_argument('-B', '--against-reviewed', metavar='BUILD', help="""Compare specified build against last reviewed (as found in comments section). E.g. if the last reviewed job was '0123' and you want to compare build '0128' against '0123', specify just '0128' and the last reviewed job is found from the comments section if the comment is sticking to the template format for review comments. Special argument 'last' will compare the last finished build against the last reviewed one.""") parser.add_argument('-T', '--verbose-test', help='Increase test result verbosity level, specify multiple times to increase verbosity', action='count', default=1) parser.add_argument('-r', '--bugrefs', action='store_true', help="""Parse \'bugrefs\' from test results comments and triage issues accordingly. See https://progress.opensuse.org/projects/openqav3/wiki/Wiki#Show-bug-or-label-icon-on-overview-if-labeled-gh550 for details about bugrefs in openQA""") parser.add_argument('-R', '--query-issue-status', action='store_true', help="""Query issue trackers for the issues found and report on their status and assignee. Implies "-r/--bugrefs" and needs configuration file {} with credentials, see '--query-issue-status-help'.""".format(CONFIG_PATH)) parser.add_argument('--query-issue-status-help', action='store_true', help="""Shows help how to setup '--query-issue-status' configuration file.""") parser.add_argument('--report-links', action='store_true', help="""Generate issue reporting links into report. Needs configuration file for product mapping, see '--query-issue-status-help'.""") parser.add_argument('-a', '--arch', help='Only single architecture, e.g. \'x86_64\', not all') parser.add_argument('-f', '--filter', help='Filter for \'closed\' or \'unassigned\' issues.') parser.add_argument('--running-threshold', default=0, help='Percentage of jobs that may still be running for the build to be considered \'finished\' anyway') parser.add_argument('--no-empty-sections', action='store_false', default=True, dest='show_empty', help='Only show sections in report with content') parser.add_argument('--include-softfails', action='store_true', default=False, help="""Also include softfails in reports. Not included by default as less important and there is no carry over for soft fails, i.e. there are no bugrefs attached to these failures in most cases but they should already carry bug references by other means anyway.""") add_load_save_args(parser) args = parser.parse_args() if args.query_issue_status_help: print(CONFIG_USAGE) print("Expected file path: {}".format(CONFIG_PATH)) sys.exit(0) return args
def parse_args(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument( "-v", "--verbose", help="Increase verbosity level, specify multiple times to increase verbosity", action="count", default=1, ) parser.add_argument( "-n", "--dry-run", action="store_true", help="Only do read-only or simulate actions, does not release TumbleSLE" ) parser.add_argument( "--dry-run-rsync", action="store_true", help="Execute rsync with dry-run. Should be specified additionally to '--dry-run'", ) parser.add_argument( "--openqa-host", help="openQA host to retrieve results from", default="https://openqa.opensuse.org" ) parser.add_argument("--group-id", help="Group id to search in from openQA host", default=19) parser.add_argument( "--product", help="The product name to act upon, must be equivalent to --group-id and must match entry in config file (if any).", default="Leap 42.2", ) parser.add_argument( "--check-build", help="""If specified, checks specified build number (integer) instead of 'last' finished.""", default="last", ) parser.add_argument( "--check-against-build", help="""If specified, checks against specified build number (integer). Specify 'release_info' for reading release info file from destination folder, see '--release-file' and '--dest'. Specify 'tagged' for last tagged on group overview page within openQA""", default="release_info", ) parser.add_argument("--run-once", action="store_true", help="Only run once, not continuously") parser.add_argument("--config-path", help="Path to config file with whitelist.", default=CONFIG_PATH) parser.add_argument( "--whitelist", help="Whitelist entries as for the config file (comma separated). Additional to config file entries", default="", ) parser.add_argument( "--src", help="""Source directory for rsync call pointing to factory subdir within openQA. Make sure to end the path with '/'. Can be anything rsync understands""", default="/var/lib/openqa/factory/", ) parser.add_argument( "--dest", help="""Target directory for rsync call where to put TumbleSLE assets. Make sure to end the path with '/'. Can be anything rsync understands but must be local.""", default="/srv/www/tumblesle/", ) parser.add_argument( "--match", help="Globbing pattern that has to be matched when searching for builds as well as when syncing assets on release", default="open*-42.2*x86_64*", ) parser.add_argument( "--match-hdds", help="Additional globbing pattern to '--match' for hdd images as they are named differently more often than not", default=None, ) parser.add_argument( "--release-file", help="""Name of release file including the build number. This file is read from the path specified by '--dest' and is written back to it.""", default=".release_info", ) parser.add_argument( "--sleeptime", help="Time to sleep between runs in seconds. Has no effect with '--run-once'", default=240 ) parser.add_argument( "--post-release-hook", help="Specify application path for a post-release hook which is called after every successful release", default=None, ) parser.add_argument( "--seen-maxlen", type=int, help="""The length of the 'seen' buffer for notifications. Any AMQP notification is stored in a FIFO and before sending it is checked if the notification was already sent out recently with same content. Together with '--sleeptime' the interval under which the same message would be resent can be configured, e.g. maxlen*sleeptime = minimum time of reappearence (s)""", default=500, ) add_load_save_args(parser) return parser.parse_args()