Provide INCIDENT_REPO and INCIDENT_PATCH to openqa
This commit is contained in:
parent
900b80e6d4
commit
a49886fd9e
@ -93,6 +93,7 @@ class Update(object):
|
|||||||
|
|
||||||
# start with a colon so it looks cool behind 'Build' :/
|
# start with a colon so it looks cool behind 'Build' :/
|
||||||
s['BUILD'] = ':' + req.reqid + '.' + self.request_name(req)
|
s['BUILD'] = ':' + req.reqid + '.' + self.request_name(req)
|
||||||
|
s['INCIDENT_REPO'] = '%s/%s/%s/' % (self.repo_prefix(), src_prj.replace(':', ':/'), dst_prj.replace(':', '_'))
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
@ -122,11 +123,14 @@ class Update(object):
|
|||||||
|
|
||||||
class SUSEUpdate(Update):
|
class SUSEUpdate(Update):
|
||||||
|
|
||||||
|
def repo_prefix(self):
|
||||||
|
return 'http://download.suse.de/ibs'
|
||||||
|
|
||||||
def settings(self, src_prj, dst_prj, packages, req=None):
|
def settings(self, src_prj, dst_prj, packages, req=None):
|
||||||
settings = super(SUSEUpdate, self).settings(src_prj, dst_prj, packages, req)
|
settings = super(SUSEUpdate, self).settings(src_prj, dst_prj, packages, req)
|
||||||
|
|
||||||
repo = 'http://download.suse.de/ibs/%s/%s/' % (src_prj.replace(':', ':/'), dst_prj.replace(':', '_'))
|
# backward compat
|
||||||
settings['MINIMAL_TEST_REPO'] = repo
|
settings['MINIMAL_TEST_REPO'] = settings['INCIDENT_REPO']
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
|
|
||||||
@ -172,6 +176,9 @@ class openSUSEUpdate(Update):
|
|||||||
if lastgood_prefix:
|
if lastgood_prefix:
|
||||||
settings['LATEST_GOOD_UPDATES_BUILD'] = "%d-%d" % (lastgood_prefix, lastgood_suffix)
|
settings['LATEST_GOOD_UPDATES_BUILD'] = "%d-%d" % (lastgood_prefix, lastgood_suffix)
|
||||||
|
|
||||||
|
def repo_prefix(self):
|
||||||
|
return 'http://download.opensuse.org/repositories'
|
||||||
|
|
||||||
def settings(self, src_prj, dst_prj, packages, req=None):
|
def settings(self, src_prj, dst_prj, packages, req=None):
|
||||||
settings = super(openSUSEUpdate, self).settings(src_prj, dst_prj, packages, req)
|
settings = super(openSUSEUpdate, self).settings(src_prj, dst_prj, packages, req)
|
||||||
|
|
||||||
@ -188,8 +195,8 @@ class openSUSEUpdate(Update):
|
|||||||
settings['INSTALL_PACKAGES'] = ' '.join(set([p.name for p in packages]))
|
settings['INSTALL_PACKAGES'] = ' '.join(set([p.name for p in packages]))
|
||||||
settings['VERIFY_PACKAGE_VERSIONS'] = ' '.join(['{} {}-{}'.format(p.name, p.version, p.release) for p in packages])
|
settings['VERIFY_PACKAGE_VERSIONS'] = ' '.join(['{} {}-{}'.format(p.name, p.version, p.release) for p in packages])
|
||||||
|
|
||||||
settings['ZYPPER_ADD_REPOS'] = 'http://download.opensuse.org/repositories/%s/%s/' % (src_prj.replace(':', ':/'), dst_prj.replace(':', '_'))
|
settings['ZYPPER_ADD_REPOS'] = settings['INCIDENT_REPO']
|
||||||
settings['ADDONURL'] = settings['ZYPPER_ADD_REPOS']
|
settings['ADDONURL'] = settings['INCIDENT_REPO']
|
||||||
|
|
||||||
settings['ISO'] = 'openSUSE-Leap-42.1-DVD-x86_64.iso'
|
settings['ISO'] = 'openSUSE-Leap-42.1-DVD-x86_64.iso'
|
||||||
|
|
||||||
@ -408,6 +415,7 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
self.update_test_builds = dict()
|
self.update_test_builds = dict()
|
||||||
|
|
||||||
def prepare_review(self):
|
def prepare_review(self):
|
||||||
|
return
|
||||||
for prj, u in TARGET_REPO_SETTINGS[self.openqa.baseurl].items():
|
for prj, u in TARGET_REPO_SETTINGS[self.openqa.baseurl].items():
|
||||||
self.trigger_build_for_target(prj, u)
|
self.trigger_build_for_target(prj, u)
|
||||||
|
|
||||||
@ -421,6 +429,7 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
packages = []
|
packages = []
|
||||||
|
patch_id = None
|
||||||
# patchinfo collects the binaries and is build for an
|
# patchinfo collects the binaries and is build for an
|
||||||
# unpredictable architecture so we need iterate over all
|
# unpredictable architecture so we need iterate over all
|
||||||
url = osc.core.makeurl(
|
url = osc.core.makeurl(
|
||||||
@ -442,14 +451,21 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
# can't use arch here as the patchinfo mixes all
|
# can't use arch here as the patchinfo mixes all
|
||||||
# archs
|
# archs
|
||||||
packages.append(Package(m.group('name'), m.group('version'), m.group('release')))
|
packages.append(Package(m.group('name'), m.group('version'), m.group('release')))
|
||||||
|
elif binary.attrib['filename'] == 'updateinfo.xml':
|
||||||
|
url = osc.core.makeurl(
|
||||||
|
self.apiurl,
|
||||||
|
('build', a.src_project, a.tgt_project.replace(':', '_'), arch, a.src_package, 'updateinfo.xml'))
|
||||||
|
ui = ET.parse(osc.core.http_GET(url)).getroot()
|
||||||
|
patch_id = ui.find('.//id').text
|
||||||
|
|
||||||
if not packages:
|
if not packages:
|
||||||
raise Exception("no packages found")
|
raise Exception("no packages found")
|
||||||
|
|
||||||
self.logger.debug('found packages %s', ' '.join(set([p.name for p in packages])))
|
self.logger.debug('found packages %s and patch id %s', ' '.join(set([p.name for p in packages])), patch_id)
|
||||||
|
|
||||||
for update in PROJECT_OPENQA_SETTINGS[a.tgt_project]:
|
for update in PROJECT_OPENQA_SETTINGS[a.tgt_project]:
|
||||||
settings = update.settings(a.src_project, a.tgt_project, packages, req)
|
settings = update.settings(a.src_project, a.tgt_project, packages, req)
|
||||||
|
settings['INCIDENT_PATCH'] = patch_id
|
||||||
if settings is not None:
|
if settings is not None:
|
||||||
update.calculate_lastest_good_updates(self.openqa, settings)
|
update.calculate_lastest_good_updates(self.openqa, settings)
|
||||||
|
|
||||||
@ -570,7 +586,7 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
'version': s['VERSION'],
|
'version': s['VERSION'],
|
||||||
'arch': s['ARCH'],
|
'arch': s['ARCH'],
|
||||||
'flavor': s['FLAVOR'],
|
'flavor': s['FLAVOR'],
|
||||||
'build': self.update_test_builds[prj],
|
'build': self.update_test_builds.get(prj, 'UNKNOWN'),
|
||||||
'scope': 'relevant',
|
'scope': 'relevant',
|
||||||
})['jobs']
|
})['jobs']
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user