| |
@@ -274,7 +274,8 @@
|
| |
raise
|
| |
|
| |
def add_edit_component(self, package, collection, owner, description=None,
|
| |
- qacontact=None, cclist=None, print_fas_names=False):
|
| |
+ qacontact=None, cclist=None, print_fas_names=False,
|
| |
+ retired=False):
|
| |
'''Add or update a component to have the values specified.
|
| |
'''
|
| |
# Turn the cclist into something usable by bugzilla
|
| |
@@ -339,6 +340,8 @@
|
| |
data['initialcclist'] = initial_cc_emails
|
| |
break
|
| |
|
| |
+ data["is_active"] = not retired
|
| |
+
|
| |
if data:
|
| |
# Changes occurred. Submit a request to change via xmlrpc
|
| |
data['product'] = self.config['products'][collection]
|
| |
@@ -414,20 +417,28 @@
|
| |
)
|
| |
print(f"[NOCHANGE] {package}/{bz_product_name}")
|
| |
else:
|
| |
+ bz_product_name = self.config['products'][collection].get('bz_product_name', collection)
|
| |
+ if retired:
|
| |
+ if self.config['verbose']:
|
| |
+ print(f"[NOADD] {bz_product_name}/{package}")
|
| |
+ return
|
| |
+
|
| |
# Add component
|
| |
data = {
|
| |
- 'product': self.config['products'][collection].get('bz_product_name', collection),
|
| |
+ 'product': bz_product_name,
|
| |
'component': package,
|
| |
'description': description or 'NA',
|
| |
'initialowner': owner_email,
|
| |
- 'initialqacontact': qacontact_email
|
| |
+ 'initialqacontact': qacontact_email,
|
| |
+ 'is_active': not retired,
|
| |
}
|
| |
if initial_cc_emails:
|
| |
data['initialcclist'] = initial_cc_emails
|
| |
|
| |
if self.config["verbose"]:
|
| |
- print('[ADDCOMP] %s/%s' % (data["product"], data["component"]))
|
| |
- for key in ["initialowner", "description", "initialqacontact", "initialcclist"]:
|
| |
+ print(f"[ADDCOMP] {bz_product_name}/{package}")
|
| |
+ for key in ["initialowner", "description", "initialqacontact",
|
| |
+ "initialcclist", "is_active"]:
|
| |
if print_fas_names and key in ('initialowner',
|
| |
'initialqacontact',
|
| |
'initialcclist'):
|
| |
@@ -739,11 +750,15 @@
|
| |
project['products'] = list(products)
|
| |
|
| |
products_poc = {}
|
| |
+ products_retired = {}
|
| |
for product in products:
|
| |
owner = project["poc"]
|
| |
# Check if the project is retired in PDC, and if so set assignee to orphan.
|
| |
if self._is_retired(product, project):
|
| |
owner = 'orphan'
|
| |
+ products_retired[product] = True
|
| |
+ else:
|
| |
+ products_retired[product] = False
|
| |
|
| |
# Check if the Bugzilla ticket assignee has been manually overridden
|
| |
override_yaml = self._get_override_yaml(project, self.session)
|
| |
@@ -752,6 +767,7 @@
|
| |
owner = override_yaml[product]
|
| |
products_poc[product] = owner
|
| |
project['products_poc'] = products_poc
|
| |
+ project["products_retired"] = products_retired
|
| |
|
| |
self.pagure_projects[idx] = project
|
| |
|
| |
@@ -883,6 +899,7 @@
|
| |
qacontact=None,
|
| |
cclist=project['watchers'],
|
| |
print_fas_names=self.args.print_fas_names,
|
| |
+ retired=project["products_retired"][product],
|
| |
)
|
| |
except ValueError as e:
|
| |
# A username didn't have a bugzilla address
|
| |
When a package is retired, we want to de-active it in bugzilla which
makes it no longer visible in the list of packages against which one
can fill a bug.
Fixes https://pagure.io/fedora-infrastructure/issue/7690
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr