From 53757bf26c64f01cfd6ad0a59cf796b6c2c5a71d Mon Sep 17 00:00:00 2001 From: Tim Flink Date: Oct 08 2017 13:49:01 +0000 Subject: [PATCH 1/2] changing anongiturl to use src.fp.o instead of pkgs.fp.o. Fixes #119 Fixes rhbz#1188634 Signed-off-by: Tim Flink --- diff --git a/conf/etc/rpkg/fedpkg-stage.conf b/conf/etc/rpkg/fedpkg-stage.conf index 5ddee92..f04c342 100644 --- a/conf/etc/rpkg/fedpkg-stage.conf +++ b/conf/etc/rpkg/fedpkg-stage.conf @@ -3,7 +3,7 @@ lookaside = https://src.stg.fedoraproject.org/repo/pkgs lookasidehash = sha512 lookaside_cgi = https://src.stg.fedoraproject.org/repo/pkgs/upload.cgi gitbaseurl = ssh://%(user)s@pkgs.stg.fedoraproject.org/%(module)s -anongiturl = git://pkgs.stg.fedoraproject.org/%(module)s +anongiturl = https://src.stg.fedoraproject.org/git/%(module)s branchre = f\d$|f\d\d$|el\d$|olpc\d$|master$ kojiprofile = stg build_client = koji diff --git a/conf/etc/rpkg/fedpkg.conf b/conf/etc/rpkg/fedpkg.conf index eff5918..966739b 100644 --- a/conf/etc/rpkg/fedpkg.conf +++ b/conf/etc/rpkg/fedpkg.conf @@ -3,7 +3,7 @@ lookaside = https://src.fedoraproject.org/repo/pkgs lookasidehash = sha512 lookaside_cgi = https://src.fedoraproject.org/repo/pkgs/upload.cgi gitbaseurl = ssh://%(user)s@pkgs.fedoraproject.org/%(module)s -anongiturl = git://pkgs.fedoraproject.org/%(module)s +anongiturl = https://src.fedoraproject.org/git/%(module)s branchre = f\d$|f\d\d$|el\d$|olpc\d$|master$ kojiprofile = koji build_client = koji From fc261daf8c12be8453274555a8ffbd8b23a62c09 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Oct 08 2017 13:51:24 +0000 Subject: [PATCH 2/2] Override build URL for Koji git+https:// is required. Signed-off-by: Chenxiong Qi --- diff --git a/fedpkg/__init__.py b/fedpkg/__init__.py index 4b09c5e..e7a0450 100644 --- a/fedpkg/__init__.py +++ b/fedpkg/__init__.py @@ -217,6 +217,14 @@ class Commands(pyrpkg.Commands): in Koji. """ + def construct_build_url(self): + """Override build URL for Fedora Koji build + + In Fedora Koji, anonymous URL should have prefix "git+https://" + """ + url = super(Commands, self).construct_build_url() + return 'git+{0}'.format(url) + def retire(self, message): """Delete all tracked files and commit a new dead.package file diff --git a/test/test_commands.py b/test/test_commands.py index f13ec52..e2abf5a 100644 --- a/test/test_commands.py +++ b/test/test_commands.py @@ -329,3 +329,17 @@ class TestFindMasterBranch(CommandTestCase): koji_session.getBuildTarget.assert_called_once_with('rawhide') self.assertEqual('28', result) + + +class TestOverrideBuildURL(CommandTestCase): + """Test Commands.construct_build_url""" + + @patch('pyrpkg.Commands.construct_build_url') + def test_override(self, super_construct_build_url): + super_construct_build_url.return_value = 'https://localhost/rpms/pkg' + cmd = self.make_commands() + + overrided_url = cmd.construct_build_url() + self.assertEqual( + 'git+{0}'.format(super_construct_build_url.return_value), + overrided_url)