api_rate_limits(gh) if opts.externals: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES+EXTERNAL_CATEGORIES: for lab in LABEL_TYPES: all_labels[cat+"-"+lab]=LABEL_TYPES[lab] for repo_name in EXTERNAL_REPOS: setRepoLabels (gh, repo_name, all_labels, opts.dryRun) if opts.cmssw: all_labels = COMMON_LABELS for lab in COMPARISON_LABELS: all_labels[lab] = COMPARISON_LABELS[lab] for lab in CMSSW_BUILD_LABELS: all_labels[lab] = CMSSW_BUILD_LABELS[lab] for cat in COMMON_CATEGORIES+CMSSW_CATEGORIES.keys(): for lab in LABEL_TYPES: all_labels[cat+"-"+lab]=LABEL_TYPES[lab] for repo_name in CMSSW_REPOS: setRepoLabels (gh, repo_name, all_labels, opts.dryRun) if opts.cmsdist: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES+CMSSW_CATEGORIES.keys(): for lab in LABEL_TYPES: all_labels[cat+"-"+lab]=LABEL_TYPES[lab] for repo_name in CMSDIST_REPOS: setRepoLabels (gh, repo_name, all_labels, opts.dryRun) if opts.users: from glob import glob
api_rate_limits(gh) if opts.externals: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES + EXTERNAL_CATEGORIES: for lab in LABEL_TYPES: all_labels[cat + "-" + lab] = LABEL_TYPES[lab] for repo_name in EXTERNAL_REPOS: setRepoLabels(gh, repo_name, all_labels, opts.dryRun) if opts.cmssw: all_labels = COMMON_LABELS for lab in COMPARISON_LABELS: all_labels[lab] = COMPARISON_LABELS[lab] for lab in CMSSW_BUILD_LABELS: all_labels[lab] = CMSSW_BUILD_LABELS[lab] for cat in COMMON_CATEGORIES + CMSSW_CATEGORIES.keys(): for lab in LABEL_TYPES: all_labels[cat + "-" + lab] = LABEL_TYPES[lab] for repo_name in CMSSW_REPOS: setRepoLabels(gh, repo_name, all_labels, opts.dryRun) if opts.cmsdist: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES + CMSSW_CATEGORIES.keys(): for lab in LABEL_TYPES: all_labels[cat + "-" + lab] = LABEL_TYPES[lab] for repo_name in CMSDIST_REPOS: setRepoLabels(gh, repo_name, all_labels, opts.dryRun) if opts.users: from glob import glob
parser.add_option("-a", "--all", dest="all", action="store_true", help="Process all CMS repository i.e. externals and cmssw", default=False) opts, args = parser.parse_args() if opts.all: opts.externals = True opts.cmssw = True elif (not opts.externals) and (not opts.cmssw) and (not opts.users): parser.error("Too few arguments, please use either -e, -c, or -u") import repo_config gh = Github(login_or_token=open(expanduser(repo_config.GH_TOKEN)).read().strip()) api_rate_limits(gh) if opts.cmssw or opts.externals: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES+EXTERNAL_CATEGORIES+list(CMSSW_CATEGORIES.keys()): for lab in LABEL_TYPES: all_labels[cat+"-"+lab]=LABEL_TYPES[lab] for lab in COMPARISON_LABELS: all_labels[lab] = COMPARISON_LABELS[lab] if opts.externals: for repo_name in EXTERNAL_REPOS: setRepoLabels (gh, repo_name, all_labels, opts.dryRun, ignore=CMSSW_REPOS) if opts.cmssw: for lab in CMSSW_BUILD_LABELS: all_labels[lab] = CMSSW_BUILD_LABELS[lab] specs = get_config_map_properties() for s in specs: if 'DISABLED' in s: continue
if opts.all: opts.externals = True opts.cmssw = True elif (not opts.externals) and (not opts.cmssw) and (not opts.users): parser.error("Too few arguments, please use either -e, -c, or -u") import repo_config from os import environ gh = Github(login_or_token=environ['GITHUBTOKEN']) api_rate_limits(gh) if opts.cmssw or opts.externals: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES + EXTERNAL_CATEGORIES + list( CMSSW_CATEGORIES.keys()): for lab in LABEL_TYPES: all_labels[cat + "-" + lab] = LABEL_TYPES[lab] for lab in COMPARISON_LABELS: all_labels[lab] = COMPARISON_LABELS[lab] if opts.externals: for repo_name in EXTERNAL_REPOS: setRepoLabels(gh, repo_name, all_labels, opts.dryRun, ignore=CMSSW_REPOS) if opts.cmssw: for lab in CMSSW_BUILD_LABELS:
parser.add_option("-a", "--all", dest="all", action="store_true", help="Process all CMS repository i.e. externals and cmssw", default=False) opts, args = parser.parse_args() if opts.all: opts.externals = True opts.cmssw = True elif (not opts.externals) and (not opts.cmssw) and (not opts.users): parser.error("Too few arguments, please use either -e, -c, or -u") import repo_config gh = Github(login_or_token=open(expanduser(repo_config.GH_TOKEN)).read().strip()) api_rate_limits(gh) if opts.cmssw or opts.externals: all_labels = COMMON_LABELS for cat in COMMON_CATEGORIES+EXTERNAL_CATEGORIES+CMSSW_CATEGORIES.keys(): for lab in LABEL_TYPES: all_labels[cat+"-"+lab]=LABEL_TYPES[lab] for lab in COMPARISON_LABELS: all_labels[lab] = COMPARISON_LABELS[lab] if opts.externals: for repo_name in EXTERNAL_REPOS: setRepoLabels (gh, repo_name, all_labels, opts.dryRun, ignore=CMSSW_REPOS) if opts.cmssw: for lab in CMSSW_BUILD_LABELS: all_labels[lab] = CMSSW_BUILD_LABELS[lab] specs = get_config_map_properties() for s in specs: if 'DISABLED' in s: continue