Merge pull request #1562 from coolo/uniq_requests
openqa-maintenance: Make sure we don't go through requests twice
This commit is contained in:
commit
432237a2a8
@ -496,16 +496,18 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
'latest': '1'
|
'latest': '1'
|
||||||
})['jobs']
|
})['jobs']
|
||||||
|
|
||||||
# for SUSE we use mesh for openSUSE we limit the jobs to open release requests
|
# for SUSE we use mesh, for openSUSE we limit the jobs to open release requests
|
||||||
def check_opensuse_incidents(self):
|
def check_opensuse_incidents(self):
|
||||||
requests = []
|
requests = dict() # collecting unique requests
|
||||||
self.wait_for_build = set()
|
self.wait_for_build = set()
|
||||||
for prj in self.tgt_repo[self.openqa.baseurl].keys():
|
for prj in self.tgt_repo[self.openqa.baseurl].keys():
|
||||||
requests += self.ids_project(prj, 'maintenance_release')
|
for r in self.ids_project(prj, 'maintenance_release'):
|
||||||
|
requests[r.reqid] = r
|
||||||
|
|
||||||
# to be stored in settings
|
# to be stored in settings
|
||||||
issues = dict()
|
issues = dict()
|
||||||
for req in requests:
|
for req in sorted(requests.keys()):
|
||||||
|
req = requests[req]
|
||||||
types = set([a.type for a in req.actions])
|
types = set([a.type for a in req.actions])
|
||||||
if 'maintenance_release' not in types:
|
if 'maintenance_release' not in types:
|
||||||
continue
|
continue
|
||||||
@ -514,15 +516,18 @@ class OpenQABot(ReviewBot.ReviewBot):
|
|||||||
if len(src_prjs) != 1:
|
if len(src_prjs) != 1:
|
||||||
raise Exception("can't handle maintenance_release from different incidents")
|
raise Exception("can't handle maintenance_release from different incidents")
|
||||||
build = src_prjs.pop()
|
build = src_prjs.pop()
|
||||||
tgt_prjs = set([a.tgt_project for a in req.actions])
|
incident_id = build.split(':')[-1]
|
||||||
for prj in tgt_prjs:
|
tgt_prjs = set()
|
||||||
|
for a in req.actions:
|
||||||
|
prj = a.tgt_project
|
||||||
# ignore e.g. Backports
|
# ignore e.g. Backports
|
||||||
if prj not in self.project_settings:
|
if prj not in self.project_settings:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
incident_id = build.split(':')[-1]
|
|
||||||
self.test_job({'project': build, 'id': incident_id, 'channels': [prj]})
|
|
||||||
issues.setdefault(prj, set()).add(incident_id)
|
issues.setdefault(prj, set()).add(incident_id)
|
||||||
|
tgt_prjs.add(prj)
|
||||||
|
|
||||||
|
self.test_job({'project': build, 'id': incident_id, 'channels': list(tgt_prjs)})
|
||||||
|
|
||||||
for prj in self.tgt_repo[self.openqa.baseurl].keys():
|
for prj in self.tgt_repo[self.openqa.baseurl].keys():
|
||||||
s = self.tgt_repo[self.openqa.baseurl][prj]['settings']
|
s = self.tgt_repo[self.openqa.baseurl][prj]['settings']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user