1
0
Fork 0
mirror of https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot synced 2024-12-22 10:30:53 +01:00

Create subtask for wikireplicas view creation

This commit is contained in:
Francesco Negri 2024-12-20 12:34:13 +01:00
parent 3af446ee71
commit b138bf3873

View file

@ -54,6 +54,7 @@ class PostCreationHandler(object):
self._check_cx, self._check_cx,
self._check_analytics, self._check_analytics,
self._check_pywikibot, self._check_pywikibot,
self._check_wikireplicas,
self._check_wikidata, self._check_wikidata,
] ]
self.handlers = [ self.handlers = [
@ -61,6 +62,7 @@ class PostCreationHandler(object):
self._handle_cx, self._handle_cx,
self._handle_analytics, self._handle_analytics,
self._handle_pywikibot, self._handle_pywikibot,
self._handle_wikireplicas,
self._handle_wikidata, self._handle_wikidata,
self._handle_wikistats, self._handle_wikistats,
self._handle_incubator, self._handle_incubator,
@ -185,6 +187,11 @@ class PostCreationHandler(object):
self.post_ticket_phid, self.post_ticket_phid,
'Add support for {} to Pywikibot'.format(self.db_name)) 'Add support for {} to Pywikibot'.format(self.db_name))
def _check_wikireplicas(self):
url = 'https://replag.toolforge.org/'
wikireplicas_replag_page = requests.get().text
self.add_checklist(url, 'Wiki Replicas', self.db_name in wikireplicas_replag_page)
def _check_wikidata(self): def _check_wikidata(self):
url = 'https://www.wikidata.org/w/api.php' url = 'https://www.wikidata.org/w/api.php'
wikidata_help_page = requests.get(url, params={ wikidata_help_page = requests.get(url, params={
@ -193,6 +200,13 @@ class PostCreationHandler(object):
}).text }).text
self.add_checklist(url, 'Wikidata', self.db_name in wikidata_help_page) self.add_checklist(url, 'Wikidata', self.db_name in wikidata_help_page)
def _handle_wikireplicas(self):
client.createSubtask(
'Follow the procedure at https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Wiki_Replicas#Adding_a_wiki', [
'PHID-PROJ-d3h5oaspnvdwfjklmivl/', # cloud-services-team
'PHID-PROJ-bj6y6ks7ampcwcignhce' # Data-Services
], self.post_ticket_phid, '[wikireplicas] Create views for new wiki {}'.format(self.db_name))
def _handle_wikidata(self): def _handle_wikidata(self):
client.createSubtask( client.createSubtask(
'Per https://wikitech.wikimedia.org/wiki/Add_a_wiki once the wiki has been created', 'Per https://wikitech.wikimedia.org/wiki/Add_a_wiki once the wiki has been created',
@ -247,7 +261,6 @@ def handle_subticket_for_cloud(task_details, db_name, wiki_status):
client.createSubtask("The new wiki's visibility will be: **%s**." % wiki_status, [ client.createSubtask("The new wiki's visibility will be: **%s**." % wiki_status, [
'PHID-PROJ-hwibeuyzizzy4xzunfsk', # DBA 'PHID-PROJ-hwibeuyzizzy4xzunfsk', # DBA
'PHID-PROJ-bj6y6ks7ampcwcignhce' # Data services
], task_details['phid'], 'Prepare and check storage layer for ' + db_name) ], task_details['phid'], 'Prepare and check storage layer for ' + db_name)
def handle_ticket_for_wikistats(task_details, db_name): def handle_ticket_for_wikistats(task_details, db_name):