jenkins: add owners tool to userid-validation flow
Run the 'owners' tool during the userid-validation so that
owners and reviewers are automatically added by Jenkins.
Fix a few minor issues with the 'owners' tool:
- Switch the 'push-args' option from BooleanOptionalAction since
this isn't supported in the Python version on the Jenkins
controller.
- Handle empty 'matchers' statements.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib496c5874a532299ecf821345c8c25d87a21f3f1
diff --git a/tools/owners b/tools/owners
index acae840..d35fe5f 100755
--- a/tools/owners
+++ b/tools/owners
@@ -68,7 +68,7 @@
self.owners: Set[str] = set(owners.get("owners") or [])
self.reviewers: Set[str] = set(owners.get("reviewers") or [])
- for e in owners.get("matchers", []):
+ for e in owners.get("matchers", None) or []:
if "exact" in e:
self.__exact(files, e)
elif "partial_regex" in e:
@@ -140,7 +140,8 @@
)
parser_reviewers.add_argument(
"--push-args",
- action=argparse.BooleanOptionalAction,
+ default=False,
+ action='store_true',
help="Format as git push options",
)
parser_reviewers.add_argument(