|
17 | 17 | import yaml # For converting .cc-metadata.yml to Python dictionary
|
18 | 18 |
|
19 | 19 | # Local/library specific
|
20 |
| -from get_labels import get_labels |
| 20 | +from get_labels import get_labels, get_groups |
21 | 21 | from set_labels import set_labels
|
| 22 | +from validate_issues import validate_issues |
22 | 23 | from utils import get_cc_organization, set_up_github_client
|
23 | 24 | import branch_protections
|
24 | 25 | import log
|
@@ -62,6 +63,9 @@ def setup():
|
62 | 63 | action="store_true",
|
63 | 64 | help="skip labels update",
|
64 | 65 | )
|
| 66 | + ap.add_argument( |
| 67 | + "--skip-issues", action="store_true", help="skip issue labels check" |
| 68 | + ) |
65 | 69 | args = ap.parse_args()
|
66 | 70 | return args
|
67 | 71 |
|
@@ -97,6 +101,15 @@ def set_repo_labels(args, repos):
|
97 | 101 | logger.log(log.SUCCESS, "done.")
|
98 | 102 |
|
99 | 103 |
|
| 104 | +def validate_issue_labels(args, repos): |
| 105 | + if args.skip_issues: |
| 106 | + return |
| 107 | + logger.log(logging.INFO, "Checking issues...") |
| 108 | + groups = get_groups() |
| 109 | + validate_issues(repos, groups) |
| 110 | + logger.log(log.SUCCESS, "done.") |
| 111 | + |
| 112 | + |
100 | 113 | def is_engineering_project(repo):
|
101 | 114 | try:
|
102 | 115 | contents = repo.get_contents(".cc-metadata.yml")
|
@@ -160,6 +173,7 @@ def main():
|
160 | 173 | logger.log(logging.INFO, "Starting normalization")
|
161 | 174 | repos = get_select_repos(args)
|
162 | 175 | set_repo_labels(args, repos)
|
| 176 | + validate_issue_labels(args, repos) |
163 | 177 | update_branches(args, repos)
|
164 | 178 |
|
165 | 179 |
|
|
0 commit comments