mirror of
https://gitlab.wikimedia.org/ladsgroup/Phabricator-maintenance-bot
synced 2024-12-05 02:12:39 +01:00
Merge branch 'new-addWiki' into 'master'
Update suggested commands for the new addWiki.php See merge request ladsgroup/Phabricator-maintenance-bot!16
This commit is contained in:
commit
eaf75ce919
1 changed files with 7 additions and 39 deletions
|
@ -255,20 +255,6 @@ def handle_ticket_for_wikistats(task_details, db_name):
|
|||
'PHID-PROJ-6sht6g4xpdii4c4bga2i' # VPS-project-Wikistats
|
||||
], task_details['phid'], 'Add %s to wikistats' % db_name)
|
||||
|
||||
|
||||
def get_dummy_wiki(shard, family):
|
||||
if family == "wiktionary":
|
||||
return {
|
||||
"s3": "aawiki",
|
||||
"s5": "mhwiktionary",
|
||||
}.get(shard, "?????")
|
||||
else:
|
||||
return {
|
||||
"s3": "aawiki",
|
||||
"s5": "muswiki"
|
||||
}.get(shard, "?????")
|
||||
|
||||
|
||||
def create_patch_for_wikimedia_messages(
|
||||
db_name, english_name, url, lang, bug_id):
|
||||
if not english_name:
|
||||
|
@ -428,34 +414,16 @@ def get_db_name(wiki_spec, parts):
|
|||
def add_create_instructions(parts, shard, language_code, db_name, task_tid):
|
||||
add_text('\n-------')
|
||||
add_text('**Step by step commands**:')
|
||||
dummy_wiki = get_dummy_wiki(shard, parts[1])
|
||||
add_text('On deployment host:')
|
||||
add_text('`cd /srv/mediawiki-staging/`')
|
||||
add_text('`git fetch`')
|
||||
add_text('`git log -p HEAD..@{u}`')
|
||||
add_text('`git rebase`')
|
||||
add_text('On maintenance host:')
|
||||
add_text('`scap pull`')
|
||||
addwiki_path = 'mwscript extensions/WikimediaMaintenance/addWiki.php'
|
||||
add_text(
|
||||
'`{addwiki_path} --wiki={dummy} {lang} {family} {db} {url}`'.format(
|
||||
addwiki_path=addwiki_path,
|
||||
dummy=dummy_wiki,
|
||||
lang=language_code,
|
||||
family=parts[1],
|
||||
db=db_name,
|
||||
url='.'.join(parts)))
|
||||
|
||||
add_text('On deployment host:')
|
||||
add_text('`scap sync-world "Creating {db_name} ({phab})"`'.format(
|
||||
db_name=db_name, phab=task_tid))
|
||||
|
||||
add_text('On maintenance host:')
|
||||
add_text('`{search_path} --wiki={dbname} --cluster=all 2>&1 | tee {log}`'.format(
|
||||
search_path='mwscript extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php',
|
||||
dbname=db_name,
|
||||
log='/tmp/{dbname}.UpdateSearchIndexConfig.log'.format(dbname=db_name),
|
||||
))
|
||||
addwiki_path = 'mwscript extensions/WikimediaMaintenance/addWiki.php'
|
||||
add_text(
|
||||
'`{addwiki_path} --wiki={db}`'.format(
|
||||
addwiki_path=addwiki_path,
|
||||
db=db_name))
|
||||
|
||||
add_text('On deployment host:')
|
||||
add_text('`scap update-interwiki-cache`')
|
||||
|
@ -483,7 +451,7 @@ def update_task_report(task_details):
|
|||
final_text))
|
||||
|
||||
|
||||
def hande_task(task_details):
|
||||
def handle_task(task_details):
|
||||
global final_text
|
||||
final_text = ''
|
||||
print('Checking T%s' % task_details['id'])
|
||||
|
@ -548,7 +516,7 @@ def main():
|
|||
for phid in client.getTasksWithProject(
|
||||
open_create_wikis_phid, statuses=['open']):
|
||||
task_details = client.taskDetails(phid)
|
||||
hande_task(task_details)
|
||||
handle_task(task_details)
|
||||
update_task_report(task_details)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue