Merge pull request #2992 from dirkmueller/bot_fixups

Revert temporary fixups, these are working now
This commit is contained in:
Dirk Mueller 2023-07-21 17:17:57 +02:00 committed by GitHub
commit fd88270cbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
#!/usr/bin/python3
from contextlib import suppress
import difflib
import glob
import os
@ -248,17 +247,12 @@ class CheckSource(ReviewBot.ReviewBot):
pathname=copath, server_service_files=True, expand_link=True)
os.rename(source_package, target_package)
shutil.rmtree(os.path.join(target_package, '.osc'))
# TODO(dmllr): Fix in the source checker
with suppress(FileNotFoundError):
os.remove(os.path.join(target_package, '.gitattributes'))
new_info = self.package_source_parse(source_project, source_package, source_revision, target_package)
filename = new_info.get('filename', '')
expected_name = target_package
if filename == '_preinstallimage':
expected_name = 'preinstallimage'
# TODO(dmllr): self.package_source_parse cannot handle scm_sync submissions, so skip the check for now
if not self.source_is_scm_staging_submission(source_project):
if not (filename.endswith('.kiwi') or filename == 'Dockerfile') and new_info['name'] != expected_name:
shutil.rmtree(copath)
self.review_messages['declined'] = "A package submitted as %s has to build as 'Name: %s' - found Name '%s'" % (