mirror of
https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot
synced 2024-11-22 03:52:37 +01:00
Fixes for new wiki handler
- Adding more debug stuff so we know what's going on - Making the cron work 4 times a day instead of one
This commit is contained in:
parent
78cde6376b
commit
0dc6cadee3
2 changed files with 6 additions and 3 deletions
2
cron
2
cron
|
@ -1,4 +1,4 @@
|
||||||
15 * * * * jsub -once -N column_mover python3 /data/project/phabbot/phabbot/column_mover.py /data/project/phabbot/phabbot/creds.json 3600 >/dev/null 2>&1
|
15 * * * * jsub -once -N column_mover python3 /data/project/phabbot/phabbot/column_mover.py /data/project/phabbot/phabbot/creds.json 3600 >/dev/null 2>&1
|
||||||
10 * * * * jsub -once -N patch_for_review python3 /data/project/phabbot/phabbot/patchforreview_remover.py /data/project/phabbot/phabbot/creds.json 3600 >/dev/null 2>&1
|
10 * * * * jsub -once -N patch_for_review python3 /data/project/phabbot/phabbot/patchforreview_remover.py /data/project/phabbot/phabbot/creds.json 3600 >/dev/null 2>&1
|
||||||
5 * * * * jlocal bash /data/project/phabbot/phabbot/updater.sh >/dev/null 2>&1
|
5 * * * * jlocal bash /data/project/phabbot/phabbot/updater.sh >/dev/null 2>&1
|
||||||
10 22 * * * jsub -once -N new_wikis_handler python3 /data/project/phabbot/phabbot/new_wikis_handler.py /data/project/phabbot/phabbot/creds.json 10000000 >/dev/null 2>&1
|
10 22,4,10,16 * * * jsub -once -N new_wikis_handler python3 /data/project/phabbot/phabbot/new_wikis_handler.py /data/project/phabbot/phabbot/creds.json 10000000 >/dev/null 2>&1
|
||||||
|
|
|
@ -65,18 +65,22 @@ def create_apache_config_subticket(parts, task_details):
|
||||||
def hande_task(phid):
|
def hande_task(phid):
|
||||||
global final_text
|
global final_text
|
||||||
final_text = ''
|
final_text = ''
|
||||||
add_text('\n\n------\n**Pre-install automatic checklist:**')
|
|
||||||
task_details = client.taskDetails(phid)
|
task_details = client.taskDetails(phid)
|
||||||
|
print('Checking', task_details['id'])
|
||||||
|
add_text('\n\n------\n**Pre-install automatic checklist:**')
|
||||||
language_code = re.findall(r'\n- *?\*\*Language code:\*\* *?(\S+)', task_details['description'])
|
language_code = re.findall(r'\n- *?\*\*Language code:\*\* *?(\S+)', task_details['description'])
|
||||||
if not language_code:
|
if not language_code:
|
||||||
|
print('lang code not found, skipping')
|
||||||
return
|
return
|
||||||
language_code = language_code[0]
|
language_code = language_code[0]
|
||||||
url = re.findall(r'\n- *?\*\*Site URL:\*\* *?(\S+)', task_details['description'])
|
url = re.findall(r'\n- *?\*\*Site URL:\*\* *?(\S+)', task_details['description'])
|
||||||
if not url:
|
if not url:
|
||||||
|
print('url not found, skipping')
|
||||||
return
|
return
|
||||||
url = url[0]
|
url = url[0]
|
||||||
parts = url.split('.')
|
parts = url.split('.')
|
||||||
if len(parts) != 3 or parts[2] != 'org':
|
if len(parts) != 3 or parts[2] != 'org':
|
||||||
|
print('the url looks weird, skipping')
|
||||||
return
|
return
|
||||||
|
|
||||||
special = parts[1] == 'wikimedia'
|
special = parts[1] == 'wikimedia'
|
||||||
|
@ -133,7 +137,6 @@ def hande_task(phid):
|
||||||
else:
|
else:
|
||||||
core_lang = False
|
core_lang = False
|
||||||
add_text(' [] [[{}|Language configuration in mediawiki core]]'.format(core_messages_url))
|
add_text(' [] [[{}|Language configuration in mediawiki core]]'.format(core_messages_url))
|
||||||
|
|
||||||
path = 'mediawiki/extensions/WikimediaMessages/+/master/i18n/wikimediaprojectnames/en.json'
|
path = 'mediawiki/extensions/WikimediaMessages/+/master/i18n/wikimediaprojectnames/en.json'
|
||||||
wikimedia_messages_data = get_file_from_gerrit(path)
|
wikimedia_messages_data = get_file_from_gerrit(path)
|
||||||
wikimedia_messages_data = json.loads(wikimedia_messages_data)
|
wikimedia_messages_data = json.loads(wikimedia_messages_data)
|
||||||
|
|
Loading…
Reference in a new issue