| |
@@ -295,6 +295,31 @@
|
| |
|
| |
@patch('freshmaker.kojiservice.KojiService.get_build')
|
| |
@patch('freshmaker.kojiservice.KojiService.get_task_request')
|
| |
+ def test_resolve_commit_odcs_compose_ids(
|
| |
+ self, get_task_request, get_build):
|
| |
+ get_build.return_value = {
|
| |
+ "task_id": 123456,
|
| |
+ 'extra': {
|
| |
+ 'image': {
|
| |
+ 'odcs': {
|
| |
+ 'compose_ids': [7300, 7301],
|
| |
+ 'signing_intent': 'release',
|
| |
+ 'signing_intent_overridden': False
|
| |
+ }
|
| |
+ }
|
| |
+ }
|
| |
+ }
|
| |
+ get_task_request.return_value = [
|
| |
+ "git://example.com/rpms/repo-1?#commit_hash1", "target1", {}]
|
| |
+
|
| |
+ self.dummy_image.resolve_commit()
|
| |
+ self.assertEqual(self.dummy_image["repository"], "rpms/repo-1")
|
| |
+ self.assertEqual(self.dummy_image["commit"], "commit_hash1")
|
| |
+ self.assertEqual(self.dummy_image["target"], "target1")
|
| |
+ self.assertEqual(self.dummy_image["odcs_compose_ids"], [7300, 7301])
|
| |
+
|
| |
+ @patch('freshmaker.kojiservice.KojiService.get_build')
|
| |
+ @patch('freshmaker.kojiservice.KojiService.get_task_request')
|
| |
def test_resolve_commit_koji_fallback(self, get_task_request, get_build):
|
| |
get_build.return_value = {"task_id": 123456}
|
| |
get_task_request.return_value = [
|
| |
@@ -304,6 +329,7 @@
|
| |
self.assertEqual(self.dummy_image["repository"], "rpms/repo-1")
|
| |
self.assertEqual(self.dummy_image["commit"], "commit_hash1")
|
| |
self.assertEqual(self.dummy_image["target"], "target1")
|
| |
+ self.assertEqual(self.dummy_image["odcs_compose_ids"], None)
|
| |
|
| |
@patch('freshmaker.kojiservice.KojiService.get_build')
|
| |
@patch('freshmaker.kojiservice.KojiService.get_task_request')
|
| |
@@ -968,6 +994,7 @@
|
| |
"git_branch": "mybranch",
|
| |
"error": None,
|
| |
"arches": None,
|
| |
+ "odcs_compose_ids": None,
|
| |
"brew": {
|
| |
"completion_date": u"20170421T04:27:51.000-0400",
|
| |
"build": "package-name-2-4-12.10",
|
| |
Some images contain RPMs which are internal only and are used only as a build-time dependency of the image. Those RPMs are therefore never shipped and don't exist in any Pulp repository. But Freshmaker currently includes only repositories from Pulp - that means that build of such images would fail, because the internal only package cannot be installed from public Pulp repo.
In the original build, the internal only package is part of ODCS compose as requested by OSBS build system.
This PR gets the list of ODCS compose IDs which have been used to build the original image and passes them to OSBS when rebuildiong the image. This means that Freshmaker now submits image with Pulp ODCS compose IDs together with original Koji tag ODCS compose IDs.
The idea is that the Koji tag compose repositories will contain all the packages (including internal-only packages) which are needed to build the image in the same versions as in the time when building it originally. The Pulp repos will provide the latest versions of those packages, so when the "yum install" phase of image build is running, latest RPMs from Pulp repos will be used and internal-only packages will be taken from original renewed compose(s).