Skip to content

Commit

Permalink
Merge branch 'master' into pcheck-fix-push
Browse files Browse the repository at this point in the history
  • Loading branch information
DimStar77 authored Oct 3, 2024
2 parents 6530c10 + 96def08 commit f87a440
Show file tree
Hide file tree
Showing 38 changed files with 1,929 additions and 730 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
run: |
for f in $(find . -maxdepth 1 -type f -executable -print); do
# skip completely broken scripts or those without --help
[[ " ./checknewer.py ./repo2fileprovides.py ./openqa-maintenance.py ./docker_publisher.py ./publish_distro ./findfileconflicts ./write_repo_susetags_file.pl ./issue-diff.py ./generate-release-packages ./verify-build-and-generatelists " =~ "$f" ]] || "$f" --help
[[ " ./checknewer.py ./repo2fileprovides.py ./openqa-maintenance.py ./docker_publisher.py ./publish_distro ./findfileconflicts ./write_repo_susetags_file.pl ./issue-diff.py ./generate-release-packages ./verify-build-and-generatelists ./slfo-packagelist-uploader.py" =~ "$f" ]] || "$f" --help
done
linters:
Expand Down
6 changes: 6 additions & 0 deletions ReviewBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from osclib.core import devel_project_fallback
from osclib.core import group_members
from osclib.core import maintainers_get
from osclib.core import package_role_expand
from osclib.core import request_action_key
from osclib.core import request_age
from osclib.memoize import memoize
Expand Down Expand Up @@ -404,6 +405,11 @@ def devel_project_review_needed(self, request, project, package):
author = request.creator
maintainers = set(maintainers_get(self.apiurl, project, package))

if len(maintainers) == 0:
devel_project, devel_package = devel_project_fallback(self.apiurl, project, package)
if devel_package:
maintainers = set(package_role_expand(self.apiurl, devel_project, devel_package))

if author in maintainers:
return False

Expand Down
19 changes: 17 additions & 2 deletions check_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from osclib.core import package_kind
from osclib.core import create_add_role_request
from osclib.core import package_role_expand
from osclib.core import source_file_load
from osclib.core import project_pseudometa_package
from osc.core import show_package_meta, show_project_meta
from osc.core import get_request_list
from urllib.error import HTTPError
Expand Down Expand Up @@ -61,6 +63,7 @@ def target_project_config(self, project: str) -> None:
self.devel_baseproject: str = config.get('check-source-devel-baseproject', '')
self.allow_source_in_sle = str2bool(config.get('check-source-allow-source-in-sle', 'True'))
self.sle_project_to_check = config.get('check-source-sle-project', '')
self.slfo_packagelist_to_check = config.get('check-source-slfo-packagelist-file', '')
self.allow_valid_source_origin = str2bool(config.get('check-source-allow-valid-source-origin', 'False'))
self.valid_source_origins: Set[str] = set(config.get('check-source-valid-source-origins', '').split(' '))
self.add_devel_project_review = str2bool(config.get('check-source-add-devel-project-review', 'False'))
Expand Down Expand Up @@ -147,11 +150,23 @@ def check_source_submission(
self.review_messages['declined'] = f'May not modify a non-source package of type {kind}'
return False

if not self.allow_source_in_sle and self.sle_project_to_check:
if entity_exists(self.apiurl, self.sle_project_to_check, target_package):
if not self.allow_source_in_sle:
if self.sle_project_to_check and entity_exists(self.apiurl, self.sle_project_to_check, target_package):
self.review_messages['declined'] = ("SLE-base package, please submit to the corresponding SLE project."
"Or let us know the reason why needs to rebuild SLE-base package.")
return False
if self.slfo_packagelist_to_check:
pseudometa_project, pseudometa_package = project_pseudometa_package(self.apiurl, target_project)
if pseudometa_project and pseudometa_package:
metafile = ET.fromstring(source_file_load(self.apiurl, pseudometa_project, pseudometa_package,
self.slfo_packagelist_to_check))
slfo_pkglist = [package.attrib['name'] for package in metafile.findall('package')]
if target_package in slfo_pkglist:
self.review_messages['declined'] = ("Please create a new feature request "
f"https://code.opensuse.org/leap/features/issues for updating {target_package} "
"from SLFO (SLES, SL Micro). Alternatively, please provide "
"a reason for forking and rebuilding an existing SLFO package in Leap.")
return False

if self.ensure_source_exist_in_baseproject and self.devel_baseproject:
if not entity_exists(self.apiurl, self.devel_baseproject, target_package) and source_project not in self.valid_source_origins:
Expand Down
5 changes: 3 additions & 2 deletions dashboard/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ def openqa_summary(self):
fetcher.add('openSUSE:Factory:PowerPC', nick='Power',
download_url='http://download.opensuse.org/ports/ppc/tumbleweed/iso/',
openqa_group='openSUSE Tumbleweed PowerPC', openqa_version='Tumbleweed', openqa_groupid=4)
fetcher.add('openSUSE:Factory:RISCV', nick='Risc V',
download_url='http://download.opensuse.org/ports/riscv/tumbleweed/iso/')
fetcher.add('openSUSE:Factory:RISCV', nick='RISC-V',
download_url='http://download.opensuse.org/ports/riscv/tumbleweed/iso/',
openqa_group='openSUSE Tumbleweed RISC-V', openqa_version='Tumbleweed', openqa_groupid=125)
fetcher.add('openSUSE:Factory:zSystems', nick='System Z',
download_url='http://download.opensuse.org/ports/zsystems/tumbleweed/iso/',
openqa_group='openSUSE Tumbleweed s390x', openqa_version='Tumbleweed', openqa_groupid=34)
Expand Down
2 changes: 1 addition & 1 deletion dist/ci/testenv-tumbleweed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN zypper in -y osc python3-pytest python3-httpretty python3-pyxdg python3-PyYA
python3-influxdb python3-pytest-cov libxml2-tools curl python3-flake8 python3-requests \
shadow vim vim-data strace git sudo patch unzip which cpio gawk openSUSE-release openSUSE-release-ftp \
perl-Net-SSLeay perl-Text-Diff perl-XML-Simple perl-XML-Parser build \
obs-service-download_files obs-service-format_spec_file obs-scm-bridge
obs-service-download_files obs-service-format_spec_file obs-scm-bridge python3-GitPython
RUN useradd tester -d /code/tests/home

COPY run_as_tester /usr/bin
Expand Down
15 changes: 15 additions & 0 deletions dist/package/openSUSE-release-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ Requires: osclib = %{version}
Requires: python3-requests
Requires: python3-solv
Requires: zstd
%if 0%{?suse_version} > 1500
# slfo-packagelist-uploader.py
Requires: python3-GitPython
%endif
# we use the same user as repo-checker
PreReq: openSUSE-release-tools-repo-checker
BuildArch: noarch
Expand Down Expand Up @@ -316,6 +320,12 @@ OSC plugin for the staging workflow, see `osc staging --help`.

%prep
%setup -q
# slfo-packagelist-uploader requires python-GitPython but 15.6 providing
# python311-GitPython only, therefore do not ship slfo-packagelist-uploader
# in 15.6 since python3-GitPython is not available
%if 0%{?suse_version} <= 1500
rm slfo-packagelist-uploader.py
%endif

%build
%make_build
Expand Down Expand Up @@ -428,6 +438,7 @@ exit 0
%exclude %{_datadir}/%{source_dir}/project-installcheck.py
%exclude %{_datadir}/%{source_dir}/suppkg_rebuild.py
%exclude %{_datadir}/%{source_dir}/skippkg-finder.py
%exclude %{_datadir}/%{source_dir}/slfo-packagelist-uploader.py
%exclude %{_datadir}/%{source_dir}/osclib
%exclude %{_datadir}/%{source_dir}/osc-cycle.py
%exclude %{_datadir}/%{source_dir}/osc-origin.py
Expand Down Expand Up @@ -456,6 +467,10 @@ exit 0

%files check-source
%{_bindir}/osrt-check_source
%if 0%{?suse_version} > 1500
%{_bindir}/osrt-slfo-packagelist-uploader
%{_datadir}/%{source_dir}/slfo-packagelist-uploader.py
%endif
%{_datadir}/%{source_dir}/check_source.py

%files docker-publisher
Expand Down
4 changes: 3 additions & 1 deletion docker_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class DockerImagePublisherRegistry(DockerImagePublisher):
'armv7l': ("arm", "v7"),
'aarch64': ("arm64", "v8"),
'ppc64le': ("ppc64le", None),
's390x': ("s390x", None)}
's390x': ("s390x", None),
'riscv64': ("riscv64", None)}

def __init__(self, dhc, tag, aliases=[]):
"""Construct a DIPR by passing a DockerRegistryClient instance as dhc
Expand Down Expand Up @@ -374,6 +375,7 @@ def run():
'armv6l': DockerImageFetcherOBS(url="https://build.opensuse.org/public/build/openSUSE:Containers:Tumbleweed/containers/armv6l/opensuse-tumbleweed-image:docker", maintenance_release=True), # noqa: E501
'ppc64le': DockerImageFetcherOBS(url="https://build.opensuse.org/public/build/openSUSE:Containers:Tumbleweed/containers/ppc64le/opensuse-tumbleweed-image:docker", maintenance_release=True), # noqa: E501
's390x': DockerImageFetcherOBS(url="https://build.opensuse.org/public/build/openSUSE:Containers:Tumbleweed/containers/s390x/opensuse-tumbleweed-image:docker", maintenance_release=True), # noqa: E501
'riscv64': DockerImageFetcherOBS(url="https://build.opensuse.org/public/build/openSUSE:Containers:Tumbleweed/containers/riscv64/opensuse-tumbleweed-image:docker", maintenance_release=True), # noqa: E501
},
'publisher': DockerImagePublisherRegistry(drc_tw, "latest"),
},
Expand Down
66 changes: 0 additions & 66 deletions gocd/alp.target.gocd.yaml

This file was deleted.

76 changes: 0 additions & 76 deletions gocd/checkers.alp.gocd.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
format_version: 3
pipelines:
ALP.Dolomite.Project:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 0 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-repo-checker
stages:
- Run:
timeout: 30
approval: manual
jobs:
ALP.Dolomite:
resources:
- repo-checker
tasks:
- script: ./project-installcheck.py -A https://api.suse.de --debug check --store SUSE:ALP:Products:Dolomite:1.0:Staging/dashboard --no-rebuild SUSE:ALP:Products:Dolomite:1.0
ALP.Dolomite.Staging.Bot.Regular:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 0 * ? * *
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
stages:
- Run:
approval:
type: manual
jobs:
Run:
timeout: 30
resources:
- staging-bot
tasks:
- script: |-
set -e
tempdir=$(mktemp -d)
mkdir -p $tempdir/.osc-plugins
ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 rebuild
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 list --supersede
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 select --non-interactive --merge --try-strategies
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 unselect --cleanup
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 repair --cleanup
rm -rf $tempdir
ALP.Source.Standard.1_0.Staging.Bot.Regular:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
Expand Down Expand Up @@ -88,27 +33,6 @@ pipelines:
osc -A https://api.suse.de staging -p SUSE:ALP:Source:Standard:1.0 unselect --cleanup
osc -A https://api.suse.de staging -p SUSE:ALP:Source:Standard:1.0 repair --cleanup
rm -rf $tempdir
ALP.Dolomite.Staging.Bot.Report:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 */3 * ? * *
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
stages:
- Run:
approval:
type: manual
jobs:
Run:
timeout: 30
resources:
- staging-bot
tasks:
- script: ./staging-report.py --debug -A https://api.suse.de -p SUSE:ALP:Products:Dolomite:1.0
ALP.Source.Standard.1_0.Staging.Bot.Report:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
Expand Down
76 changes: 0 additions & 76 deletions gocd/checkers.alp.gocd.yaml.erb
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
format_version: 3
pipelines:
ALP.Dolomite.Project:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 0 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-repo-checker
stages:
- Run:
timeout: 30
approval: manual
jobs:
ALP.Dolomite:
resources:
- repo-checker
tasks:
- script: ./project-installcheck.py -A https://api.suse.de --debug check --store SUSE:ALP:Products:Dolomite:1.0:Staging/dashboard --no-rebuild SUSE:ALP:Products:Dolomite:1.0
ALP.Dolomite.Staging.Bot.Regular:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 0 * ? * *
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
stages:
- Run:
approval:
type: manual
jobs:
Run:
timeout: 30
resources:
- staging-bot
tasks:
- script: |-
set -e
tempdir=$(mktemp -d)
mkdir -p $tempdir/.osc-plugins
ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir

osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 rebuild
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 list --supersede
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 select --non-interactive --merge --try-strategies
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 unselect --cleanup
osc -A https://api.suse.de staging -p SUSE:ALP:Products:Dolomite:1.0 repair --cleanup
rm -rf $tempdir
ALP.Source.Standard.1_0.Staging.Bot.Regular:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
Expand Down Expand Up @@ -88,27 +33,6 @@ pipelines:
osc -A https://api.suse.de staging -p SUSE:ALP:Source:Standard:1.0 unselect --cleanup
osc -A https://api.suse.de staging -p SUSE:ALP:Source:Standard:1.0 repair --cleanup
rm -rf $tempdir
ALP.Dolomite.Staging.Bot.Report:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 */3 * ? * *
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
stages:
- Run:
approval:
type: manual
jobs:
Run:
timeout: 30
resources:
- staging-bot
tasks:
- script: ./staging-report.py --debug -A https://api.suse.de -p SUSE:ALP:Products:Dolomite:1.0
ALP.Source.Standard.1_0.Staging.Bot.Report:
group: ALP.Checkers
lock_behavior: unlockWhenFinished
Expand Down
Loading

0 comments on commit f87a440

Please sign in to comment.