Commit 6079f24e authored by Brennen Bearnes's avatar Brennen Bearnes
Browse files

use project prefix for issue/wiki allowlist

parent 218b9801
......@@ -29,10 +29,11 @@ def get_projects():
# For background, see:
# - https://phabricator.wikimedia.org/T264231
# - https://phabricator.wikimedia.org/T290612
#
# For research repos specifically:
# - https://phabricator.wikimedia.org/T304614
issue_wiki_allowlist = [
"repos/research/knowledge-gaps",
"repos/research/article-quality",
"repos/research/research-ml"
"repos/research/",
]
for project in get_projects():
......@@ -40,8 +41,13 @@ for project in get_projects():
changed = False
allow = False
for prefix in issue_wiki_allowlist:
if project_path.startswith(prefix):
allow = True
if project.issues_access_level != 'disabled':
if project_path in issue_wiki_allowlist:
if allow:
print(project_path, '- temporarily allowing issues')
else:
project.issues_access_level = 'disabled'
......@@ -49,7 +55,7 @@ for project in get_projects():
changed = True
if project.wiki_access_level != 'disabled':
if project_path in issue_wiki_allowlist:
if allow:
print(project_path, '- temporarily allowing wikis')
else:
print(project_path, '- disabling wiki access')
......@@ -77,7 +83,7 @@ for project in get_projects():
if changed:
print (project_path, '- saving new settings')
# project.save()
project.save()
time.sleep(.5)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment