From e246aef5f63619524a6adee58921f526bea715de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 29 Jun 2017 13:04:29 +0200 Subject: [PATCH] ostree: Add URL to repo to message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The message announcing new ostree commit contains hash of the commit, the ref it's for, but there is no information about where the repo actually is. This patch adds `repo_path` key into the message with URL of the repo and `local_repo_path` with path to the repo on local filesystem. Relates: https://pagure.io/pungi/issue/650 Signed-off-by: Lubomír Sedlář --- pungi/phases/ostree.py | 6 ++++-- tests/test_ostree_phase.py | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py index 42a0b8cc..1d763bfe 100644 --- a/pungi/phases/ostree.py +++ b/pungi/phases/ostree.py @@ -9,7 +9,7 @@ from kobo.threads import ThreadPool, WorkerThread from .base import ConfigGuardedPhase from .. import util from ..ostree.utils import get_ref_from_treefile, get_commitid_from_commitid_file -from ..util import get_repo_dicts +from ..util import get_repo_dicts, translate_path from ..wrappers import kojiwrapper, scm @@ -87,7 +87,9 @@ class OSTreeThread(WorkerThread): variant=variant.uid, arch=arch, ref=ref, - commitid=commitid) + commitid=commitid, + repo_path=translate_path(compose, config['ostree_repo']), + local_repo_path=config['ostree_repo']) self.pool.log_info('[DONE ] %s (task id: %s)' % (msg, task_id)) diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py index 33613533..9e7e2025 100644 --- a/tests/test_ostree_phase.py +++ b/tests/test_ostree_phase.py @@ -170,6 +170,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): get_dir_from_scm.side_effect = self._dummy_config_repo self.compose.notifier = mock.Mock() + self.compose.conf['translate_paths'] = [(self.topdir, 'http://example.com/')] koji = KojiWrapper.return_value koji.run_runroot_cmd.side_effect = self._mock_runroot( @@ -186,7 +187,9 @@ class OSTreeThreadTest(helpers.PungiTestCase): variant='Everything', arch='x86_64', ref='fedora-atomic/25/x86_64', - commitid='fca3465861a')]) + commitid='fca3465861a', + repo_path='http://example.com/place/for/atomic', + local_repo_path=self.repo)]) @mock.patch('pungi.wrappers.scm.get_dir_from_scm') @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') @@ -208,7 +211,9 @@ class OSTreeThreadTest(helpers.PungiTestCase): variant='Everything', arch='x86_64', ref='fedora-atomic/25/x86_64', - commitid=None)]) + commitid=None, + repo_path=self.repo, + local_repo_path=self.repo)]) @mock.patch('pungi.wrappers.scm.get_dir_from_scm') @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper')