ostree: Add URL to repo to message

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-06-29 13:04:29 +02:00
parent 8c48dfb93a
commit e246aef5f6
2 changed files with 11 additions and 4 deletions

View File

@ -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))

View File

@ -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')