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

new_wikis_handler: Do not assume wiki will be always created at s3

This commit is contained in:
Martin Urbanec 2020-08-02 18:45:41 +02:00
parent 3ab5adde3d
commit 7d1748b68d

View file

@ -65,6 +65,17 @@ def handle_subticket_for_cloud(ticket_phid, task_details, db_name):
def create_apache_config_subticket(parts, task_details): def create_apache_config_subticket(parts, task_details):
pass pass
def get_dummy_wiki(shard, family):
if family == "wiktionary":
return {
"s3": "aawiki"
}.get(shard, "?????")
else:
return {
#"s3": "aawiki",
"s5": "cebwiki" # TODO: Change this to muswiki once T259004 is done
}.get(shard, "?????")
def hande_task(phid): def hande_task(phid):
global final_text global final_text
@ -86,6 +97,13 @@ def hande_task(phid):
if len(parts) != 3 or parts[2] != 'org': if len(parts) != 3 or parts[2] != 'org':
print('the url looks weird, skipping') print('the url looks weird, skipping')
return return
shard = re.findall(r'\n- *?\*\*Shard:\*\* *?(\S+)', task_details['description'])[0]
shardDecided = shard != "TBD"
if shardDecided:
add_text(' [X] #DBA decided about the shard')
else:
add_text(' [] #DBA decided about the shard')
special = parts[1] == 'wikimedia' special = parts[1] == 'wikimedia'
dns_url = gerrit_path + 'operations/dns/+/master/templates/wikimedia.org' if special else gerrit_path + 'operations/dns/+/master/templates/helpers/langlist.tmpl' dns_url = gerrit_path + 'operations/dns/+/master/templates/wikimedia.org' if special else gerrit_path + 'operations/dns/+/master/templates/helpers/langlist.tmpl'
@ -183,7 +201,7 @@ def hande_task(phid):
wikimedia_messages_two_deployed = True wikimedia_messages_two_deployed = True
add_text(' [x] Wikimedia messages (interwiki search result) configuration (not needed)') add_text(' [x] Wikimedia messages (interwiki search result) configuration (not needed)')
if dns and apache and langdb and core_lang and wikimedia_messages_one and wikimedia_messages_one_deployed and wikimedia_messages_two and wikimedia_messages_two_deployed: if dns and apache and langdb and core_lang and wikimedia_messages_one and wikimedia_messages_one_deployed and wikimedia_messages_two and wikimedia_messages_two_deployed and shardDecided:
add_text('**The Wiki is ready to be created.**') add_text('**The Wiki is ready to be created.**')
else: else:
add_text('**The creation is blocked until these part are all done.**') add_text('**The creation is blocked until these part are all done.**')
@ -228,10 +246,7 @@ def hande_task(phid):
add_text(' [] Clean up old interwiki links') add_text(' [] Clean up old interwiki links')
add_text('\n-------') add_text('\n-------')
add_text('**Step by step commands**:') add_text('**Step by step commands**:')
if parts[1] == 'wiktionary': dummy_wiki = get_dummy_wiki("s3", parts[1])
dummy_wiki = 'aawiktionary'
else:
dummy_wiki = 'aawiki'
add_text('On deploy1001:') add_text('On deploy1001:')
add_text('`cd /srv/mediawiki-staging/`') add_text('`cd /srv/mediawiki-staging/`')
add_text('`git fetch`') add_text('`git fetch`')