| |
@@ -114,6 +114,7 @@
|
| |
|
| |
|
| |
class BugzillaProxy:
|
| |
+
|
| |
def __init__(self, bz_server, username, password, config, pre_cache_users=True):
|
| |
self.bz_xmlrpc_server = bz_server
|
| |
self.username = username
|
| |
@@ -168,31 +169,30 @@
|
| |
raise
|
| |
if self.config["verbose"]:
|
| |
print(f" ERROR {e}")
|
| |
- print(" - Query failed, going to try again in 20 seconds")
|
| |
- # Wait 20 seconds and try again
|
| |
- time.sleep(20)
|
| |
+ print(" - Query failed, going to try again in 10 seconds")
|
| |
+ # Wait 10 seconds and try again
|
| |
+ time.sleep(10)
|
| |
return raw_data
|
| |
|
| |
if self.config["bugzilla"]["compat_api"] == "getcomponentsdetails":
|
| |
# Old API -- in python-bugzilla. But with current server, this
|
| |
# gives ProxyError
|
| |
for collection, product in self.config["products"].items():
|
| |
- bz_product_name = product.get("bz_product_name", collection)
|
| |
self.product_cache[collection] = self.server.getcomponentsdetails(
|
| |
- bz_product_name
|
| |
+ collection
|
| |
)
|
| |
elif self.config["bugzilla"]["compat_api"] == "component.get":
|
| |
# Way that's undocumented in the partner-bugzilla api but works
|
| |
# currently
|
| |
chunk = self.config["bugzilla"]["req_segment"]
|
| |
for collection, product in self.config["products"].items():
|
| |
- bz_product_name = product.get("bz_product_name", collection)
|
| |
+
|
| |
# restrict the list of info returned to only the packages of
|
| |
# interest
|
| |
pkglist = [
|
| |
project["name"]
|
| |
for project in pagure_projects
|
| |
- if bz_product_name in project["products"]
|
| |
+ if collection in project["products"]
|
| |
]
|
| |
product_info_by_pkg = {}
|
| |
estimated_size = math.ceil(len(pkglist) / chunk)
|
| |
@@ -200,13 +200,13 @@
|
| |
# Format that bugzilla will understand. Strip None's that
|
| |
# segment() pads out the final data segment() with
|
| |
query = [
|
| |
- {"product": bz_product_name, "component": p}
|
| |
+ {"product": collection, "component": p}
|
| |
for p in pkg_segment
|
| |
if p is not None
|
| |
]
|
| |
if self.config["verbose"]:
|
| |
print(
|
| |
- f" - Querying product `{bz_product_name}`, "
|
| |
+ f" - Querying product `{collection}`, "
|
| |
f"query {cnt} of {estimated_size}"
|
| |
)
|
| |
raw_data = _query_component(query)
|
| |
@@ -384,9 +384,6 @@
|
| |
e.args = ("ProtocolError", e.errcode, e.errmsg)
|
| |
raise
|
| |
|
| |
- bz_product_name = self.config["products"][collection].get(
|
| |
- "bz_product_name", collection
|
| |
- )
|
| |
|
| |
# Set the qacontact_email and name
|
| |
default_qa_contact_email = self.config["default_qa_contact_email"]
|
| |
@@ -431,7 +428,7 @@
|
| |
|
| |
if data:
|
| |
# Changes occurred. Submit a request to change via xmlrpc
|
| |
- data["product"] = bz_product_name
|
| |
+ data["product"] = collection
|
| |
data["component"] = package
|
| |
|
| |
if self.config["verbose"]:
|
| |
@@ -535,21 +532,21 @@
|
| |
new_poc=owner_email,
|
| |
prev_poc=product[pkg_key]["initialowner"],
|
| |
name=package,
|
| |
- product=bz_product_name,
|
| |
+ product=collection,
|
| |
print_fas_names=print_fas_names,
|
| |
)
|
| |
else:
|
| |
if self.config.get("print-no-change"):
|
| |
- print(f"[NOCHANGE] {package}/{bz_product_name}")
|
| |
+ print(f"[NOCHANGE] {package}/{collection}")
|
| |
else:
|
| |
if retired:
|
| |
if self.config["verbose"]:
|
| |
- print(f"[NOADD] {bz_product_name}/{package} (is retired)")
|
| |
+ print(f"[NOADD] {collection}/{package} (is retired)")
|
| |
return
|
| |
|
| |
# Add component
|
| |
data = {
|
| |
- "product": bz_product_name,
|
| |
+ "product": collection,
|
| |
"component": package,
|
| |
"description": description or "NA",
|
| |
"initialowner": owner_email,
|
| |
@@ -579,12 +576,12 @@
|
| |
else:
|
| |
value = initial_cc_fasnames
|
| |
print(
|
| |
- f"[ADDCOMP] {bz_product_name}/{package}"
|
| |
+ f"[ADDCOMP] {collection}/{package}"
|
| |
f" {key} set to FAS name(s) `{value}`"
|
| |
)
|
| |
else:
|
| |
print(
|
| |
- f"[ADDCOMP] {bz_product_name}/{package}"
|
| |
+ f"[ADDCOMP] {collection}/{package}"
|
| |
f" {key} set to {data.get(key)}"
|
| |
)
|
| |
|
| |
@@ -940,11 +937,16 @@
|
| |
if project["namespace"] not in self.env["pdc_types"]:
|
| |
project["branches"] = []
|
| |
project["products"] = []
|
| |
- self.errors["configuration"].append(
|
| |
- f'Namespace `{project["namespace"]}` not found in the pdc_type '
|
| |
- f'configuration key, project {project["namespace"]}/{project["name"]} '
|
| |
- "ignored"
|
| |
- )
|
| |
+ error = f'Namespace `{project["namespace"]}` not found in the pdc_type ' \
|
| |
+ f'configuration key -- ignoring it'
|
| |
+ if not error in self.errors["configuration"]:
|
| |
+ self.errors["configuration"].append(error)
|
| |
+ if self.env["verbose"]:
|
| |
+ print(
|
| |
+ f'Namespace `{project["namespace"]}` not found in the pdc_type '
|
| |
+ f'configuration key, project {project["namespace"]}/{project["name"]} '
|
| |
+ "ignored"
|
| |
+ )
|
| |
continue
|
| |
|
| |
pdc_type = self.env["pdc_types"][project["namespace"]]
|
| |
@@ -1159,7 +1161,10 @@
|
| |
if self.env["verbose"] or self.env["dryrun"]:
|
| |
print("*" * 80)
|
| |
print("\n".join(report))
|
| |
- if not self.env["dryrun"]:
|
| |
+
|
| |
+ # Do not send the email in dryrun or when the error only relates to
|
| |
+ # configuration (which will always happen for flatpaks and tests)
|
| |
+ if not self.env["dryrun"] and tuple(self.errors) != ("configuration",):
|
| |
self.send_email(
|
| |
self.env["email"]["from"],
|
| |
self.env["email"]["notify_admins"],
|
| |
Fixes https://pagure.io/fedora-infrastructure/issue/9252