1
0
Fork 0
mirror of https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot synced 2024-11-21 11:32:38 +01:00

new_wikis_handler: Adapt to the new paradigm of creating new wikis

Bug: T345230
This commit is contained in:
Amir Sarabadani 2023-10-15 22:30:16 +02:00
parent 801a5c7c98
commit 118444088f

View file

@ -69,6 +69,8 @@ class PostCreationHandler(object):
def handle(self):
for checker in self.checkers:
checker()
self.add_text(' [] Namespaces')
self.add_text(' [] Logos and wordmarks')
self.add_text(' [] Import from Incubator')
self.add_text(' [] Clean up old interwiki links')
self.add_text(' [] For content wikis: [[ https://meta.wikimedia.org/wiki/Stewards%27_noticeboard | ask the stewards ]] to add the wiki to the global bot policy wikiset')
@ -332,26 +334,21 @@ def handle_wikimedia_messages_one(
)
wikimedia_messages_data = get_file_from_gerrit(path)
wikimedia_messages_data = json.loads(wikimedia_messages_data)
if 'project-localized-name-' + db_name in wikimedia_messages_data:
wikimedia_messages_one = True
else:
wikimedia_messages_one = False
if not 'project-localized-name-' + db_name in wikimedia_messages_data:
english_name = wiki_spec.get('Project name (English)')
create_patch_for_wikimedia_messages(
db_name, english_name, url, language_code, task_tid)
add_checklist(gerrit_path + path,
'Wikimedia messages configuration', wikimedia_messages_one)
'Wikimedia messages configuration (optional)', True)
url = 'https://en.wikipedia.org/wiki/' + \
'MediaWiki:Project-localized-name-' + db_name
r = requests.get(url)
if 'Wikipedia does not have a' not in r.text:
wikimedia_messages_one_deployed = True
add_text(' [x] [[{}|deployed]]'.format(url))
else:
wikimedia_messages_one_deployed = False
add_text(' [] [[{}|deployed]]'.format(url))
add_text(' [x] [[{}|deployed]]'.format(url))
return wikimedia_messages_one and wikimedia_messages_one_deployed
return True
def handle_wikimedia_messages_two(db_name, parts):