From 313908293f6735aaae5c1419e076f1264e59abd3 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 4 Mar 2022 11:27:12 +0100 Subject: [PATCH] pkglistgen: Deprecate scope 'all' Within gocd we run each job on its own worker and don't rely on builtin loop. So no need to care for a remote config --- gocd/pkglistgen.opensuse.gocd.yaml | 12 ++++++------ gocd/pkglistgen.opensuse.gocd.yaml.erb | 2 ++ osclib/conf.py | 13 ------------- pkglistgen/cli.py | 13 ++++++------- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/gocd/pkglistgen.opensuse.gocd.yaml b/gocd/pkglistgen.opensuse.gocd.yaml index 7c057cf8..10063eae 100644 --- a/gocd/pkglistgen.opensuse.gocd.yaml +++ b/gocd/pkglistgen.opensuse.gocd.yaml @@ -49,22 +49,22 @@ pipelines: - repo-checker tasks: - script: | - python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:PowerPC --only-release-packages - python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:PowerPC + python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:PowerPC -s target --only-release-packages + python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:PowerPC -s target openSUSE_Factory_zSystems: resources: - repo-checker tasks: - script: | - python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:zSystems --only-release-packages - python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:zSystems + python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:zSystems -s target --only-release-packages + python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:zSystems -s target openSUSE_Factory_RISCV: resources: - repo-checker tasks: - script: | - python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:RISCV --only-release-packages - python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:RISCV + python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:RISCV -s target --only-release-packages + python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Factory:RISCV -s target Update.Repos.Factory: group: Factory.pkglistgen lock_behavior: unlockWhenFinished diff --git a/gocd/pkglistgen.opensuse.gocd.yaml.erb b/gocd/pkglistgen.opensuse.gocd.yaml.erb index 8aa43d37..2cbe2795 100644 --- a/gocd/pkglistgen.opensuse.gocd.yaml.erb +++ b/gocd/pkglistgen.opensuse.gocd.yaml.erb @@ -22,6 +22,8 @@ pipelines: if project.size > 1 options=" -s #{project[1]}" name = name + "_#{project[1]}" + else + options=" -s target" end -%> <%= name %>: diff --git a/osclib/conf.py b/osclib/conf.py index ad49b10f..b9c3afc0 100644 --- a/osclib/conf.py +++ b/osclib/conf.py @@ -94,7 +94,6 @@ DEFAULT = { # No special packages since they will pass through SLE first. 'splitter-special-packages': '', 'pkglistgen-archs': 'x86_64', - 'pkglistgen-scopes': 'target rings staging', 'pkglistgen-locales-from': 'openSUSE.product', 'pkglistgen-delete-kiwis-rings': 'openSUSE-ftp-ftp-x86_64.kiwi openSUSE-cd-mini-x86_64.kiwi', 'pkglistgen-delete-kiwis-staging': 'openSUSE-ftp-ftp-x86_64.kiwi openSUSE-cd-mini-x86_64.kiwi', @@ -145,18 +144,6 @@ DEFAULT = { 'repo_checker-project-skip': 'True', '_priority': '101', }, - r'openSUSE:(?PJump:(?P[\d.]+))$': { - 'product': 'openSUSE.product', - 'openqa': 'https://openqa.opensuse.org', - 'lock-ns': 'openSUSE', - 'main-repo': 'standard', - 'pseudometa_package': 'openSUSE:%(project)s:Staging/dashboard', - 'download-baseurl': 'http://download.opensuse.org/distribution/leap/%(version)s/', - 'download-baseurl-update': 'http://download.opensuse.org/update/leap/%(version)s/', - 'pkglistgen-archs': 'x86_64 aarch64 ppc64le s390x', - 'pkglistgen-scopes': 'target', - 'pkglistgen-locales-from': 'openSUSE.product', - }, # Allows devel projects to utilize tools that require config, but not # complete StagingAPI support. r'(?P.*$)': { diff --git a/pkglistgen/cli.py b/pkglistgen/cli.py index 31a57f3e..7b9f70ae 100755 --- a/pkglistgen/cli.py +++ b/pkglistgen/cli.py @@ -5,6 +5,8 @@ import cmdln import os import re + +from outcome import Value import ToolBase import traceback import logging @@ -17,7 +19,7 @@ from pkglistgen.update_repo_handler import update_project class CommandLineInterface(ToolBase.CommandLineInterface): - SCOPES = ['all', 'target', 'rings', 'staging'] + SCOPES = ['target', 'rings', 'staging'] def __init__(self, *args, **kwargs): ToolBase.CommandLineInterface.__init__(self, args, kwargs) @@ -64,8 +66,9 @@ class CommandLineInterface(ToolBase.CommandLineInterface): opts.project = match.group(1) elif not opts.project: raise ValueError('project is required') - elif not opts.scope: - opts.scope = ['all'] + + if not opts.scope: + raise Value('--scope or --staging required') apiurl = conf.config['apiurl'] Config(apiurl, opts.project) @@ -85,10 +88,6 @@ class CommandLineInterface(ToolBase.CommandLineInterface): if apiurl.find('opensuse.org') > 0: os.environ['OBS_NAME'] = 'build.opensuse.org' - # special case for all - if opts.scope == ['all']: - opts.scope = target_config.get('pkglistgen-scopes', 'target').split(' ') - self.error_occured = False def solve_project(project, scope):