Compare commits

...

1 Commits

Author SHA1 Message Date
f5daf72598 fix: fix update_zuul_project_config script
Some of the previous changes broken update_zuul_project_config part of
the script responsible for verifying required zuul template is present.
It is verifying that, but mistankengly not raising a flag that update is
required.
2023-04-04 12:02:53 +02:00
2 changed files with 9 additions and 2 deletions

View File

@ -4,4 +4,4 @@
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
flake8 flake8>=6.0

View File

@ -149,8 +149,9 @@ def process_repositories(args, service):
"-hc-int-jobs" if args.environment == "internal" else "-hc-jobs" "-hc-int-jobs" if args.environment == "internal" else "-hc-jobs"
) )
for doc in data.docs_by_service_type(service["service_type"]): for doc in data.docs_by_service_type(service["service_type"]):
logging.debug(f"Analyzing document {doc}") logging.info("Analyzing document %s" % doc)
if not doc.get("type"): if not doc.get("type"):
logging.debug("Skipping unsupported type")
continue continue
if doc["type"] == "dev": if doc["type"] == "dev":
doc_type = "dev-guide" doc_type = "dev-guide"
@ -158,7 +159,11 @@ def process_repositories(args, service):
doc_type = doc["type"] doc_type = doc["type"]
template_name = f"{doc_type}{job_suffix}" template_name = f"{doc_type}{job_suffix}"
if doc_type in ["api-ref", "umn", "dev-guide"]: if doc_type in ["api-ref", "umn", "dev-guide"]:
logging.debug(
"Ensuring required zuul template %s is present" % template_name)
if template_name not in zuul_templates: if template_name not in zuul_templates:
logging.debug("Adding template %s" % template_name)
zuul_config_updated = True
zuul_templates.append(template_name) zuul_templates.append(template_name)
else: else:
job_name = f"build-otc-{doc['service_type']}-{doc_type}" job_name = f"build-otc-{doc['service_type']}-{doc_type}"
@ -245,6 +250,8 @@ def process_repositories(args, service):
head=branch_name, head=branch_name,
), ),
) )
else:
logging.info("No update is necessary")
def main(): def main():