| |
@@ -212,3 +212,195 @@
|
| |
''')
|
| |
|
| |
return json.loads(mbs_data_text)
|
| |
+
|
| |
+
|
| |
+ @pytest.fixture
|
| |
+ def mbs_json_res_id_1795():
|
| |
+ """ Mock MBS response (JSON) - module ID 1795 """
|
| |
+
|
| |
+ mbs_data_text = (r'''
|
| |
+ {
|
| |
+ "build_context": "ef25c801bb4d5799a1453bd2d5798d3a597b9061",
|
| |
+ "component_builds": [
|
| |
+ 99443,
|
| |
+ 99441,
|
| |
+ 99440
|
| |
+ ],
|
| |
+ "context": "6c81f848",
|
| |
+ "id": 1795,
|
| |
+ "koji_tag": "module-nodejs-10-20180525120815-6c81f848",
|
| |
+ "modulemd": "---\ndocument: modulemd\nversion: 2\ndata:\n name: nodejs\n stream: 10\n version: 20180525120815\n context: 6c81f848\n summary: Javascript runtime\n description: >-\n Node.js is a platform built on Chrome''s JavaScript runtime for easily building\n fast, scalable network applications. Node.js uses an event-driven, non-blocking\n I/O model that makes it lightweight and efficient, perfect for data-intensive\n real-time applications that run across distributed devices.\n license:\n module:\n - MIT\n xmd:\n mbs:\n scmurl: https://src.fedoraproject.org/modules/nodejs.git?#3f5a84799a6ff9fd5a24b3820f546f675ffaafc4\n buildrequires:\n platform:\n version: 4\n ref: f29\n stream: f29\n context: 00000000\n filtered_rpms: []\n mse: TRUE\n rpms:\n libuv:\n ref: db8ffab1c1559b150fb0ba58fcaece69c0a5c23f\n nodejs:\n ref: ad36c3e56371ec8d28e415840d8dae56ab452142\n commit: 3f5a84799a6ff9fd5a24b3820f546f675ffaafc4\n dependencies:\n - buildrequires:\n platform: [f29]\n requires:\n platform: [f29]\n references:\n community: http://nodejs.org\n documentation: http://nodejs.org/en/docs\n tracker: https://github.com/nodejs/node/issues\n profiles:\n default:\n rpms:\n - nodejs\n - npm\n development:\n rpms:\n - nodejs\n - nodejs-devel\n - npm\n minimal:\n rpms:\n - nodejs\n api:\n rpms:\n - nodejs\n - nodejs-devel\n - npm\n components:\n rpms:\n libuv:\n rationale: Platform abstraction layer for Node.js\n repository: git://pkgs.fedoraproject.org/rpms/libuv\n cache: http://pkgs.fedoraproject.org/repo/pkgs/libuv\n ref: 1\n nodejs:\n rationale: Javascript runtime and npm package manager.\n repository: git://pkgs.fedoraproject.org/rpms/nodejs\n cache: http://pkgs.fedoraproject.org/repo/pkgs/nodejs\n ref: 10\n buildorder: 10\n...\n",''' # noqa: E501
|
| |
+ '''
|
| |
+ "name": "nodejs",
|
| |
+ "owner": "sgallagh",
|
| |
+ "rebuild_strategy": "only-changed",
|
| |
+ "ref_build_context": "ef25c801bb4d5799a1453bd2d5798d3a597b9061",
|
| |
+ "runtime_context": "d64e1e812ab9b003a6055ee0ba3da6d3e6237ed7",
|
| |
+ "scmurl": "https://src.fedoraproject.org/modules/nodejs.git?#3f5a84799a6ff9fd5a24b3820f546f675ffaafc4",''' # noqa: E501
|
| |
+ '''
|
| |
+ "siblings": [
|
| |
+ 1794
|
| |
+ ],
|
| |
+ "state": 5,
|
| |
+ "state_name": "ready",
|
| |
+ "state_reason": null,
|
| |
+ "state_trace": [
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 0,
|
| |
+ "state_name": "init",
|
| |
+ "time": "2018-05-25T12:08:54Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 1,
|
| |
+ "state_name": "wait",
|
| |
+ "time": "2018-05-25T12:08:55Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 2,
|
| |
+ "state_name": "build",
|
| |
+ "time": "2018-05-25T12:09:02Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 3,
|
| |
+ "state_name": "done",
|
| |
+ "time": "2018-05-25T20:02:54Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 5,
|
| |
+ "state_name": "ready",
|
| |
+ "time": "2018-05-25T20:03:00Z"
|
| |
+ }
|
| |
+ ],
|
| |
+ "state_url": "/module-build-service/1/module-builds/1795",
|
| |
+ "stream": "10",
|
| |
+ "tasks": {
|
| |
+ "rpms": {
|
| |
+ "libuv": {
|
| |
+ "nvr": "libuv-1.20.3-1.module_1743+72f89101",
|
| |
+ "state": 1,
|
| |
+ "state_reason": "Reused component from previous module build",
|
| |
+ "task_id": 26877622
|
| |
+ },
|
| |
+ "module-build-macros": {
|
| |
+ "nvr": "module-build-macros-0.1-1.module_1794+ffed6513",
|
| |
+ "state": 1,
|
| |
+ "state_reason": "",
|
| |
+ "task_id": 27187177
|
| |
+ },
|
| |
+ "nodejs": {
|
| |
+ "nvr": "nodejs-10.2.1-1.module_1794+ffed6513",
|
| |
+ "state": 1,
|
| |
+ "state_reason": "",
|
| |
+ "task_id": 27187302
|
| |
+ }
|
| |
+ }
|
| |
+ },
|
| |
+ "time_completed": "2018-05-25T20:02:54Z",
|
| |
+ "time_modified": "2018-05-25T20:03:00Z",
|
| |
+ "time_submitted": "2018-05-25T12:08:54Z",
|
| |
+ "version": "20180525120815"
|
| |
+ }
|
| |
+ ''')
|
| |
+
|
| |
+ return json.loads(mbs_data_text)
|
| |
+
|
| |
+
|
| |
+ @pytest.fixture
|
| |
+ def mbs_json_res_id_1874():
|
| |
+ """ Mock MBS response (JSON) - module ID 1874 """
|
| |
+
|
| |
+ mbs_data_text = (r'''
|
| |
+ {
|
| |
+ "build_context": "ef25c801bb4d5799a1453bd2d5798d3a597b9061",
|
| |
+ "component_builds": [
|
| |
+ 100324,
|
| |
+ 100327,
|
| |
+ 100325
|
| |
+ ],
|
| |
+ "context": "6c81f848",
|
| |
+ "id": 1874,
|
| |
+ "koji_tag": "module-nodejs-10-20180622010510-6c81f848",
|
| |
+ "modulemd": "---\ndocument: modulemd\nversion: 2\ndata:\n name: nodejs\n stream: 10\n version: 20180622010510\n context: 6c81f848\n summary: Javascript runtime\n description: >-\n Node.js is a platform built on Chrome''s JavaScript runtime for easily building\n fast, scalable network applications. Node.js uses an event-driven, non-blocking\n I/O model that makes it lightweight and efficient, perfect for data-intensive\n real-time applications that run across distributed devices.\n license:\n module:\n - MIT\n xmd:\n mbs:\n scmurl: https://src.fedoraproject.org/modules/nodejs.git?#f41bdea38b920d67fda578a643a2e42da4f03b18\n buildrequires:\n platform:\n version: 4\n ref: f29\n stream: f29\n context: 00000000\n filtered_rpms: []\n mse: TRUE\n rpms:\n libuv:\n ref: db8ffab1c1559b150fb0ba58fcaece69c0a5c23f\n nodejs:\n ref: 011878379b079f9dc7e8845e468bd2375b2d228b\n commit: f41bdea38b920d67fda578a643a2e42da4f03b18\n dependencies:\n - buildrequires:\n platform: [f29]\n requires:\n platform: [f29]\n references:\n community: http://nodejs.org\n documentation: http://nodejs.org/en/docs\n tracker: https://github.com/nodejs/node/issues\n profiles:\n default:\n rpms:\n - nodejs\n - npm\n development:\n rpms:\n - nodejs\n - nodejs-devel\n - npm\n minimal:\n rpms:\n - nodejs\n api:\n rpms:\n - nodejs\n - nodejs-devel\n - npm\n components:\n rpms:\n libuv:\n rationale: Platform abstraction layer for Node.js\n repository: git://pkgs.fedoraproject.org/rpms/libuv\n cache: http://pkgs.fedoraproject.org/repo/pkgs/libuv\n ref: 1\n nodejs:\n rationale: Javascript runtime and npm package manager.\n repository: git://pkgs.fedoraproject.org/rpms/nodejs\n cache: http://pkgs.fedoraproject.org/repo/pkgs/nodejs\n ref: 10\n buildorder: 10\n...\n",''' # noqa: E501
|
| |
+ '''
|
| |
+ "name": "nodejs",
|
| |
+ "owner": "sgallagh",
|
| |
+ "rebuild_strategy": "only-changed",
|
| |
+ "ref_build_context": "ef25c801bb4d5799a1453bd2d5798d3a597b9061",
|
| |
+ "runtime_context": "d64e1e812ab9b003a6055ee0ba3da6d3e6237ed7",
|
| |
+ "scmurl": "https://src.fedoraproject.org/modules/nodejs.git?#f41bdea38b920d67fda578a643a2e42da4f03b18",''' # noqa: E501
|
| |
+ '''
|
| |
+ "siblings": [
|
| |
+ 1873
|
| |
+ ],
|
| |
+ "state": 5,
|
| |
+ "state_name": "ready",
|
| |
+ "state_reason": null,
|
| |
+ "state_trace": [
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 0,
|
| |
+ "state_name": "init",
|
| |
+ "time": "2018-06-22T01:05:37Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 1,
|
| |
+ "state_name": "wait",
|
| |
+ "time": "2018-06-22T01:05:39Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 2,
|
| |
+ "state_name": "build",
|
| |
+ "time": "2018-06-22T01:05:56Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 3,
|
| |
+ "state_name": "done",
|
| |
+ "time": "2018-06-22T04:12:34Z"
|
| |
+ },
|
| |
+ {
|
| |
+ "reason": null,
|
| |
+ "state": 5,
|
| |
+ "state_name": "ready",
|
| |
+ "time": "2018-06-22T04:12:41Z"
|
| |
+ }
|
| |
+ ],
|
| |
+ "state_url": "/module-build-service/1/module-builds/1874",
|
| |
+ "stream": "10",
|
| |
+ "tasks": {
|
| |
+ "rpms": {
|
| |
+ "libuv": {
|
| |
+ "nvr": "libuv-1.20.3-1.module_1743+72f89101",
|
| |
+ "state": 1,
|
| |
+ "state_reason": "Reused component from previous module build",
|
| |
+ "task_id": 26877622
|
| |
+ },
|
| |
+ "module-build-macros": {
|
| |
+ "nvr": "module-build-macros-0.1-1.module_1873+3ca07718",
|
| |
+ "state": 1,
|
| |
+ "state_reason": "",
|
| |
+ "task_id": 27773131
|
| |
+ },
|
| |
+ "nodejs": {
|
| |
+ "nvr": "nodejs-10.5.0-1.module_1873+3ca07718",
|
| |
+ "state": 1,
|
| |
+ "state_reason": "",
|
| |
+ "task_id": 27773337
|
| |
+ }
|
| |
+ }
|
| |
+ },
|
| |
+ "time_completed": "2018-06-22T04:12:34Z",
|
| |
+ "time_modified": "2018-06-22T04:12:41Z",
|
| |
+ "time_submitted": "2018-06-22T01:05:37Z",
|
| |
+ "version": "20180622010510"
|
| |
+ }
|
| |
+ ''')
|
| |
+
|
| |
+ return json.loads(mbs_data_text)
|
| |
This PR is meant to be merged after PR#9 as it already includes its changes.
This PR targets issues #3, #5.
The main feature is module metadata diff support. This is a JSON interpretation of the metadata which is suitable for comparing between module versions. Modulemd has been removed and superseded with libmodulemd, which extends functionality of module_diff to the modulemd specification version 2.
The MBS API now supports getting module by ID, which has also been brought to the CLI.