Trigger the repo runs independent of the reviews
Just use the generated build number while fetching openqa jobs. This way we can trigger test runs even if there are no incidents to review to verify the tests still work on maintained products
This commit is contained in:
parent
6560f67179
commit
cce9cf3c6a
@ -81,8 +81,14 @@ class ReviewBot(object):
|
|||||||
req.read(root)
|
req.read(root)
|
||||||
self.requests.append(req)
|
self.requests.append(req)
|
||||||
|
|
||||||
|
# function called before requests are reviewed
|
||||||
|
def prepare_review(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def check_requests(self):
|
def check_requests(self):
|
||||||
|
|
||||||
|
# give implementations a chance to do something before single requests
|
||||||
|
self.prepare_review()
|
||||||
for req in self.requests:
|
for req in self.requests:
|
||||||
self.logger.debug("checking %s"%req.reqid)
|
self.logger.debug("checking %s"%req.reqid)
|
||||||
good = self.check_one_request(req)
|
good = self.check_one_request(req)
|
||||||
|
@ -329,6 +329,11 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
self.logger.debug(self.do_comments)
|
self.logger.debug(self.do_comments)
|
||||||
|
|
||||||
self.commentapi = CommentAPI(self.apiurl)
|
self.commentapi = CommentAPI(self.apiurl)
|
||||||
|
self.update_test_builds = dict()
|
||||||
|
|
||||||
|
def prepare_review(self):
|
||||||
|
for prj, u in TARGET_REPO_SETTINGS.items():
|
||||||
|
self.trigger_build_for_target(prj, u)
|
||||||
|
|
||||||
def check_action_maintenance_release(self, req, a):
|
def check_action_maintenance_release(self, req, a):
|
||||||
# we only look at the binaries of the patchinfo
|
# we only look at the binaries of the patchinfo
|
||||||
@ -400,7 +405,7 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
# so we need to check for one known TEST first
|
# so we need to check for one known TEST first
|
||||||
# if that job doesn't contain the proper hash, we trigger a new one
|
# if that job doesn't contain the proper hash, we trigger a new one
|
||||||
# and then we know the build
|
# and then we know the build
|
||||||
def detect_build_for_target(self, u):
|
def trigger_build_for_target(self, prj, u):
|
||||||
today=date.today().strftime("%Y%m%d")
|
today=date.today().strftime("%Y%m%d")
|
||||||
repohash=self.calculate_repo_hash(u['repos'])
|
repohash=self.calculate_repo_hash(u['repos'])
|
||||||
s = u['settings']
|
s = u['settings']
|
||||||
@ -417,10 +422,11 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
buildnr = None
|
buildnr = None
|
||||||
for job in j:
|
for job in j:
|
||||||
if job['settings'].get('REPOHASH', '') == repohash:
|
if job['settings'].get('REPOHASH', '') == repohash:
|
||||||
# take the last in the row - it shouldn't matter though
|
# take the last in the row
|
||||||
buildnr = job['settings']['BUILD']
|
buildnr = job['settings']['BUILD']
|
||||||
|
self.update_test_builds[prj] = buildnr
|
||||||
if buildnr:
|
if buildnr:
|
||||||
return buildnr
|
return
|
||||||
|
|
||||||
# not found, then check for the next free build nr
|
# not found, then check for the next free build nr
|
||||||
for job in j:
|
for job in j:
|
||||||
@ -442,7 +448,7 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
s['BUILD'] = buildnr
|
s['BUILD'] = buildnr
|
||||||
s['REPOHASH'] = repohash
|
s['REPOHASH'] = repohash
|
||||||
self.openqa.openqa_request('POST', 'isos', data=s, retries=1)
|
self.openqa.openqa_request('POST', 'isos', data=s, retries=1)
|
||||||
return buildnr
|
self.update_test_builds[prj] = buildnr
|
||||||
|
|
||||||
def check_source_submission(self, src_project, src_package, src_rev, dst_project, dst_package):
|
def check_source_submission(self, src_project, src_package, src_rev, dst_project, dst_package):
|
||||||
ReviewBot.ReviewBot.check_source_submission(self, src_project, src_package, src_rev, dst_project, dst_package)
|
ReviewBot.ReviewBot.check_source_submission(self, src_project, src_package, src_rev, dst_project, dst_package)
|
||||||
@ -481,7 +487,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.detect_build_for_target(u),
|
'build': self.update_test_builds[prj],
|
||||||
'scope': 'relevant',
|
'scope': 'relevant',
|
||||||
})['jobs']
|
})['jobs']
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user