From 4a13ebcdcfe63eb8725004c4ac1b451906c57455 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 18 2017 09:07:41 +0000 Subject: Adjust the pagure_mirror hook to include a last_log field In this field we will save the output of the last git push to help our users diagnose potential issues in the syncing process. --- diff --git a/pagure/hooks/mirror_hook.py b/pagure/hooks/mirror_hook.py index 144043d..7261fdd 100644 --- a/pagure/hooks/mirror_hook.py +++ b/pagure/hooks/mirror_hook.py @@ -49,6 +49,7 @@ class MirrorTable(BASE): public_key = sa.Column(sa.Text, nullable=True) target = sa.Column(sa.Text, nullable=True) + last_log = sa.Column(sa.Text, nullable=True) project = relation( 'Project', remote_side=[Project.id], @@ -74,6 +75,10 @@ class MirrorForm(wtf.Form): 'Public SSH key', [wtforms.validators.Optional()] ) + last_log = wtforms.TextAreaField( + 'Log of the last sync:', + [wtforms.validators.Optional()] + ) DESCRIPTION = ''' @@ -90,7 +95,7 @@ class MirrorHook(BaseHook): form = MirrorForm db_object = MirrorTable backref = 'mirror_hook' - form_fields = ['active', 'target', 'public_key'] + form_fields = ['active', 'target', 'public_key', 'last_log'] @classmethod def install(cls, project, dbobj):