support delete requests
we track the target package to download the toignore tracking
This commit is contained in:
parent
b8cd627da1
commit
3b14b96a66
@ -262,13 +262,19 @@ def _check_repo_group(self, id_, requests, opts):
|
|||||||
for rq in packs:
|
for rq in packs:
|
||||||
if fetched[rq.request_id]:
|
if fetched[rq.request_id]:
|
||||||
continue
|
continue
|
||||||
# we need to call it to fetch the good repos to download
|
i = set()
|
||||||
# but the return value is of no interest right now.
|
if rq.action_type == 'delete':
|
||||||
self.checkrepo.is_buildsuccess(rq)
|
# for delete requests we only care for toignore
|
||||||
i = self._check_repo_download(rq, opts)
|
i = self._check_repo_toignore(rq, opts)
|
||||||
if rq.error:
|
else:
|
||||||
print 'ERROR (ALREADY ACEPTED?):', rq.error
|
# we need to call it to fetch the good repos to download
|
||||||
rq.updated = True
|
# but the return value is of no interest right now.
|
||||||
|
self.checkrepo.is_buildsuccess(rq)
|
||||||
|
i = self._check_repo_download(rq, opts)
|
||||||
|
if rq.error:
|
||||||
|
print 'ERROR (ALREADY ACEPTED?):', rq.error
|
||||||
|
rq.updated = True
|
||||||
|
|
||||||
toignore.update(i)
|
toignore.update(i)
|
||||||
|
|
||||||
# Detect cycles into the current Factory graph after we update the
|
# Detect cycles into the current Factory graph after we update the
|
||||||
|
@ -57,6 +57,8 @@ class Request(object):
|
|||||||
self.error = None
|
self.error = None
|
||||||
self.build_excluded = False
|
self.build_excluded = False
|
||||||
self.is_cached = False
|
self.is_cached = False
|
||||||
|
self.action_type = 'submit' # assume default
|
||||||
|
self.downloads = []
|
||||||
|
|
||||||
if element:
|
if element:
|
||||||
self.load(element)
|
self.load(element)
|
||||||
@ -66,11 +68,16 @@ class Request(object):
|
|||||||
self.request_id = int(element.get('id'))
|
self.request_id = int(element.get('id'))
|
||||||
|
|
||||||
action = element.find('action')
|
action = element.find('action')
|
||||||
self.src_project = action.find('source').get('project')
|
self.action_type = action.get('type')
|
||||||
self.src_package = action.find('source').get('package')
|
source = action.find('source')
|
||||||
self.revision = action.find('source').get('rev')
|
if source is not None:
|
||||||
self.tgt_project = action.find('target').get('project')
|
self.src_project = source.get('project')
|
||||||
self.tgt_package = action.find('target').get('package')
|
self.src_package = source.get('package')
|
||||||
|
self.revision = source.get('rev')
|
||||||
|
target = action.find('target')
|
||||||
|
if target is not None:
|
||||||
|
self.tgt_project = target.get('project')
|
||||||
|
self.tgt_package = target.get('package')
|
||||||
|
|
||||||
# The groups are in the CheckRepo object.
|
# The groups are in the CheckRepo object.
|
||||||
self.group = self.request_id
|
self.group = self.request_id
|
||||||
@ -290,20 +297,21 @@ class CheckRepo(object):
|
|||||||
self.change_review_state(request_id, 'declined', message=msg)
|
self.change_review_state(request_id, 'declined', message=msg)
|
||||||
return requests
|
return requests
|
||||||
|
|
||||||
# Accept requests that are not SUBMIT type.
|
rq = Request(element=request)
|
||||||
# XXX TODO - DELETE requests need to be managed here too.
|
|
||||||
action = actions[0]
|
if rq.action_type != 'submit' and rq.action_type != 'delete':
|
||||||
action_type = action.get('type')
|
msg = 'Unchecked request type %s' % rq.action_type
|
||||||
if action_type != 'submit':
|
|
||||||
msg = 'Unchecked request type %s' % action_type
|
|
||||||
print 'ACCEPTED', msg
|
print 'ACCEPTED', msg
|
||||||
self.change_review_state(request_id, 'accepted', message=msg)
|
self.change_review_state(request_id, 'accepted', message=msg)
|
||||||
return requests
|
return requests
|
||||||
|
|
||||||
rq = Request(element=request)
|
|
||||||
rq.group = self.grouped.get(request_id, request_id)
|
rq.group = self.grouped.get(request_id, request_id)
|
||||||
requests.append(rq)
|
requests.append(rq)
|
||||||
|
|
||||||
|
if rq.action_type == 'delete':
|
||||||
|
# only track the target package
|
||||||
|
return requests
|
||||||
|
|
||||||
# Get source information about the SR:
|
# Get source information about the SR:
|
||||||
# - Source MD5
|
# - Source MD5
|
||||||
# - Entries (.tar.gz, .changes, .spec ...) and MD5
|
# - Entries (.tar.gz, .changes, .spec ...) and MD5
|
||||||
|
@ -231,6 +231,9 @@ class CycleDetector(object):
|
|||||||
def cycles(self, requests, project='openSUSE:Factory', repository='standard', arch='x86_64'):
|
def cycles(self, requests, project='openSUSE:Factory', repository='standard', arch='x86_64'):
|
||||||
"""Detect cycles in a specific repository."""
|
"""Detect cycles in a specific repository."""
|
||||||
|
|
||||||
|
# filter submit requests
|
||||||
|
requests = [ rq for rq in requests if rq.action_type == 'submit' ]
|
||||||
|
|
||||||
# Detect cycles - We create the full graph from _builddepinfo.
|
# Detect cycles - We create the full graph from _builddepinfo.
|
||||||
factory_graph = self._get_builddepinfo_graph(project, repository, arch)
|
factory_graph = self._get_builddepinfo_graph(project, repository, arch)
|
||||||
factory_cycles = factory_graph.cycles()
|
factory_cycles = factory_graph.cycles()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user