From f6a392b56cf269b8f7e55c5d61738d6c91bce4ff Mon Sep 17 00:00:00 2001 From: Max Lin Date: Fri, 24 Sep 2021 00:31:19 +0800 Subject: [PATCH 1/3] skippkg-finder: add --alternative-project option overrides OPENSUSE_PROJECT for package checking Leap 15 Respin project doesn't have inherited packagelist, skippkg-finder should have to check origin project but upload the result to the working target project. Example: Checking openSUSE:Leap:15.3, upload data to openSUSE:Leap:15.3:Update:Respin --- skippkg-finder.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/skippkg-finder.py b/skippkg-finder.py index 7ddb3328..c9e0d4e0 100755 --- a/skippkg-finder.py +++ b/skippkg-finder.py @@ -25,15 +25,18 @@ DEFAULT_REPOSITORY = 'standard' META_PACKAGE = '000package-groups' class SkippkgFinder(object): - def __init__(self, opensuse_project, sle_project, print_only, verbose): + def __init__(self, opensuse_project, sle_project, alternative_project, print_only, verbose): + self.upload_project = opensuse_project self.opensuse_project = opensuse_project + if alternative_project: + self.opensuse_project = alternative_project self.sle_project = sle_project self.print_only = print_only self.verbose = verbose self.apiurl = osc.conf.config['apiurl'] self.debug = osc.conf.config['debug'] - config = Config.get(self.apiurl, self.opensuse_project) + config = Config.get(self.apiurl, opensuse_project) # binary rpms of packages from `skippkg-finder-skiplist-ignores` # be found in the `package_binaries` thus format must to be like # SUSE:SLE-15:Update_libcdio.12032, PROJECT-NAME_PACKAGE-NAME @@ -128,7 +131,9 @@ class SkippkgFinder(object): pkgname.startswith('patchinfo.') or\ pkgname.startswith('skelcd-') or\ pkgname.startswith('installation-images') or\ - pkgname.endswith('-mini'): + pkgname.startswith('Leap-release') or\ + pkgname.endswith('-mini') or\ + '-mini.' in pkgname: continue # Ugly hack for package has dot in source package name # eg. go1.x incidents as the name would be go1.x.xxx @@ -315,7 +320,7 @@ class SkippkgFinder(object): attr = {'name': pkg} ET.SubElement(packagelist, 'package', attr) if not self.print_only: - source_file_ensure(self.apiurl, self.opensuse_project, META_PACKAGE, 'NON_FTP_PACKAGES.group', + source_file_ensure(self.apiurl, self.upload_project, META_PACKAGE, 'NON_FTP_PACKAGES.group', ET.tostring(skip_list, pretty_print=True, encoding='unicode'), 'Update the skip list') else: @@ -331,7 +336,7 @@ def main(args): print("Please pass --opensuse-project and --sle-project argument. See usage with --help.") quit() - uc = SkippkgFinder(args.opensuse_project, args.sle_project, args.print_only, args.verbose) + uc = SkippkgFinder(args.opensuse_project, args.sle_project, args.alternative_project, args.print_only, args.verbose) uc.crawl() @@ -346,6 +351,8 @@ if __name__ == '__main__': help='openSUSE project on buildservice') parser.add_argument('-s', '--sle-project', dest='sle_project', metavar='SLE_PROJECT', help='SLE project on buildservice') + parser.add_argument('-t', '--alternative-project', dest='alternative_project', metavar='ALTERNATIVE_PROJECT', + help='check the given project instead of OPENSUSE_PROJECT') parser.add_argument('-p', '--print-only', action='store_true', help='show the result instead of the uploading') parser.add_argument('-v', '--verbose', action='store_true', From 431d67e94fdbb32de51c337e50efae9455fc27d8 Mon Sep 17 00:00:00 2001 From: Max Lin Date: Fri, 24 Sep 2021 00:45:38 +0800 Subject: [PATCH 2/3] totest-manager: add openSUSE:Leap:15.3:Update:Respin --- gocd/totestmanager.gocd.yaml | 21 +++++++++++++++++++++ gocd/totestmanager.gocd.yaml.erb | 1 + 2 files changed, 22 insertions(+) diff --git a/gocd/totestmanager.gocd.yaml b/gocd/totestmanager.gocd.yaml index 21873174..79c6703e 100644 --- a/gocd/totestmanager.gocd.yaml +++ b/gocd/totestmanager.gocd.yaml @@ -231,6 +231,27 @@ pipelines: - script: |- install -D /home/go/config/openqa-client.conf /home/go/.config/openqa/client.conf scripts/totest-manager.py -A https://api.opensuse.org --debug run openSUSE:Leap:15.3:WSL + TTM.Leap_15.3_Update_Respin: + group: openSUSE.Checkers + lock_behavior: unlockWhenFinished + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-totest-manager + materials: + script: + git: https://github.com/openSUSE/openSUSE-release-tools.git + destination: scripts + timer: + spec: 0 */15 * ? * * + only_on_changes: false + stages: + - Run: + approval: manual + resources: + - staging-bot + tasks: + - script: |- + install -D /home/go/config/openqa-client.conf /home/go/.config/openqa/client.conf + scripts/totest-manager.py -A https://api.opensuse.org --debug run openSUSE:Leap:15.3:Update:Respin TTM.Leap_15.4: group: openSUSE.Checkers lock_behavior: unlockWhenFinished diff --git a/gocd/totestmanager.gocd.yaml.erb b/gocd/totestmanager.gocd.yaml.erb index 2540bbbb..21176001 100644 --- a/gocd/totestmanager.gocd.yaml.erb +++ b/gocd/totestmanager.gocd.yaml.erb @@ -12,6 +12,7 @@ pipelines: openSUSE:Leap:15.3:ARM:Images openSUSE:Leap:15.3:Images openSUSE:Leap:15.3:WSL + openSUSE:Leap:15.3:Update:Respin openSUSE:Leap:15.4 ) -%> TTM.<%= project.gsub('openSUSE:', '').gsub(':', '_') %>: From 0397656ec6dd3abb12329d92fc275e57eee625fb Mon Sep 17 00:00:00 2001 From: Max Lin Date: Fri, 24 Sep 2021 01:31:32 +0800 Subject: [PATCH 3/3] pkglistgen: add openSUSE:Leap:15.3:Update:Respin --- gocd/pkglistgen.opensuse.gocd.yaml | 28 +++++++++++++++++++++ gocd/pkglistgen.opensuse.gocd.yaml.erb | 34 +++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/gocd/pkglistgen.opensuse.gocd.yaml b/gocd/pkglistgen.opensuse.gocd.yaml index 3e950eac..bd5542a8 100644 --- a/gocd/pkglistgen.opensuse.gocd.yaml +++ b/gocd/pkglistgen.opensuse.gocd.yaml @@ -109,6 +109,29 @@ pipelines: tasks: - script: python3 ./skippkg-finder.py -A https://api.opensuse.org -o openSUSE:Leap:15.4 -s SUSE:SLE-15-SP4:GA - script: python3 ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Leap:15.4 -s target + Pkglistgen.openSUSE_Leap_15.3_Update_Respin: + group: Leap.pkglistgen + lock_behavior: unlockWhenFinished + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-staging-bot + timer: + spec: 0 40 * ? * * + only_on_changes: false + materials: + git: + git: https://github.com/openSUSE/openSUSE-release-tools.git + stages: + - pkglistgen: + approval: + type: manual + jobs: + openSUSE_Leap_15.3_Update_Respin_target: + resources: + - repo-checker + tasks: + - script: python3 ./skippkg-finder.py -A https://api.opensuse.org -o openSUSE:Leap:15.3:Update:Respin -t openSUSE:Leap:15.3:Update -s SUSE:SLE-15-SP3:Update + - script: python3 ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p openSUSE:Leap:15.3:Update:Respin -s target + Update.Repos.Leap: group: Leap.pkglistgen lock_behavior: unlockWhenFinished @@ -130,3 +153,8 @@ pipelines: - repo-checker tasks: - script: python3 ./pkglistgen.py --apiurl https://api.opensuse.org handle_update_repos openSUSE:Leap:15.4 + openSUSE_Leap_15.3_Update_Respin: + resources: + - repo-checker + tasks: + - script: python3 ./pkglistgen.py --apiurl https://api.opensuse.org handle_update_repos openSUSE:Leap:15.3:Update:Respin diff --git a/gocd/pkglistgen.opensuse.gocd.yaml.erb b/gocd/pkglistgen.opensuse.gocd.yaml.erb index 6d5eaccf..1e7e8cf5 100644 --- a/gocd/pkglistgen.opensuse.gocd.yaml.erb +++ b/gocd/pkglistgen.opensuse.gocd.yaml.erb @@ -84,6 +84,38 @@ pipelines: - script: python3 ./skippkg-finder.py -A https://api.opensuse.org -o openSUSE:Leap:15.4 -s SUSE:SLE-15-SP4:GA - script: python3 ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p <%= project[0] %><%= options %> <% end -%> + Pkglistgen.openSUSE_Leap_15.3_Update_Respin: + group: Leap.pkglistgen + lock_behavior: unlockWhenFinished + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-staging-bot + timer: + spec: 0 40 * ? * * + only_on_changes: false + materials: + git: + git: https://github.com/openSUSE/openSUSE-release-tools.git + stages: + - pkglistgen: + approval: + type: manual + jobs: +<% ['openSUSE:Leap:15.3:Update:Respin/target'].each do |project| + project=project.split('/') + name=project[0].gsub(':', '_') + if project.size > 1 + options=" -s #{project[1]}" + name = name + "_#{project[1]}" + end + -%> + <%= name %>: + resources: + - repo-checker + tasks: + - script: python3 ./skippkg-finder.py -A https://api.opensuse.org -o openSUSE:Leap:15.3:Update:Respin -t openSUSE:Leap:15.3:Update -s SUSE:SLE-15-SP3:Update + - script: python3 ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p <%= project[0] %><%= options %> +<% end -%> + Update.Repos.Leap: group: Leap.pkglistgen lock_behavior: unlockWhenFinished @@ -100,7 +132,7 @@ pipelines: approval: type: manual jobs: -<% %w(openSUSE:Leap:15.4).each do |project| -%> +<% %w(openSUSE:Leap:15.4 openSUSE:Leap:15.3:Update:Respin).each do |project| -%> <%= project.gsub(':', '_') %>: resources: - repo-checker