{ "info": { "author": "The Factory 2.0 Team", "author_email": "ursa-major-owner@fedoraproject.org", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "Ursa-Major\n==========\n\n.. image:: https://img.shields.io/pypi/v/ursa-major.svg\n :alt: PyPI\n\n.. image:: https://img.shields.io/pypi/l/ursa-major.svg\n :alt: PyPI - License\n\n.. image:: https://img.shields.io/pypi/pyversions/ursa-major.svg\n :alt: PyPI - Python Version\n\nUrsa-Major is a utility to help managing module's koji tags in koji's\ninheritance. It reads configuration for tags from a tag config file, then\nupdate koji's inheritance accordingly.\n\nTag Config File\n---------------\n\nThe tag config file used by Ursa-Major is in json format, the top level keys\nare koji tags which we should add module tags into their inheritance. For each\ntag, it contains a list of modules, owners can also be set for a tag.\n\nAn example tag config file is:\n\n.. code-block:: json\n\n {\n \"fedora-30-buildroot-modules\": {\n \"modules\": [\n {\n \"name\": \"httpd\",\n \"priority\": 10,\n \"buildrequires\": {\n \"platform\": \"f30\"\n },\n \"requires\": {\n \"platform\": \"f30\"\n },\n \"stream\": \"2.4\"\n },\n {\n \"name\": \"ruby\",\n \"priority\": 40,\n \"requires\": {\n \"platform\": \"f30\"\n },\n \"stream\": \"2.5\"\n }\n ],\n \"owners\": [\n \"foo@example.com\"\n ]\n },\n \"fedora-30-test-build\": {\n \"modules\": [\n {\n \"name\": \"testmodule\",\n \"priority\": 150,\n \"stream\": \"f30\"\n }\n ],\n \"owners\": [\n \"bar@example.com\"\n ]\n }\n }\n\n\nA valid module config should contains:\n\n* ``name`` (required): module name\n* ``stream`` (required): module stream\n* ``priority`` (required): add module's tag to tag inheritance with this priority\n* ``requires`` (optional): module's runtime dependencies.\n* ``buildrequires`` (optional): module's build time dependencies.\n\nFor each tag, ``owners`` can be set with email addresses.\n\nThe default tag config file used by Ursa-Major is ``ursa-major.json`` in current\nworking directory. You can change it with ``--tag-config-file``.\n\n\nKoji and MBS\n------------\n\nTags in tag config file are koji tags, Ursa-Major connects to koji hub and\nupdate tag inheritance per config, and connects to MBS to query module's\ninformation, especially the modulemd data.\n\nKoji and MBS servers are set in Ursa-Major's config files, the global config\nfile is ``/etc/ursa-major/ursa-major`` by default, and can be changed by\n``--config`` argument. The user config file is\n``~/.config/ursa-major/ursa-major.conf``, and can be changed by\n``--user-config``. User config file is optional, and values in global config\nfile will be overrided by user config file.\n\nAn example config file:\n\n.. code-block:: bash\n\n $ cat /etc/ursa-major/ursa-major.conf\n\n [main]\n # See https://docs.python.org/3/library/logging.html#logging-levels\n log_level = info\n\n [koji]\n profile = koji\n\n [mbs]\n server_url = https://mbs.fedoraproject.org/\n\n [mail]\n mail_processing = true\n mail_log_level = info\n mail_server = smtp.example.com\n mail_from = ursa-major@example.com\n mail_replyto = ursa-major@example.com\n # email addresses seperated by ','\n mail_always_cc = ursa-major-admin@example.com\n mail_always_bcc =\n mail_subject_prefix = [ursa-major]\n\n\nSub Commands\n============\n\nGlobal arguments of ``ursa-major``:\n\n* ``--debug`` (optional): print debug messages\n\n* ``--dry-run`` (optional): run in dry-run mode, not do any real change\n\n* ``--config`` (optional): default if ``/etc/ursa-major/ursa-major.conf``\n\n* ``--user-config`` (optional): default is ``~/.config/ursa-major/ursa-major.conf``\n\n* ``--tag-config-file`` (optional): default is ``$PWD/ursa-major.json``\n\n\nshow-config\n-----------\n\nThis just show the content of tag config file, or the content of a specified\ntag.\n\nArguments:\n\n* ``--tag`` (optional): only show config content under this tag\n\nExample:\n\n.. code-block:: bash\n\n $ ursa-major show-config --tag-config-file ~/fedora-prod-ursa-major.json --tag fedora-30-test-build\n\ncheck-config\n------------\n\nCheck the tag config file to detect any invalid configuration:\n\n.. code-block:: bash\n\n $ ursa-major check-config --tag-config-file ~/fedora-prod-ursa-major.json\n\nChecks include:\n\n* ``name``, ``stream`` and ``priority`` are required for a module\n* ``priority`` value should not conflict with other parent tags which not belong\n to this module in tag's inheritance\n* ...\n\nremove-module\n-------------\n\nRemove a module from the tag config file, and if any tag in the specified\ntag's inheritance belong to this module, also remove those tags from\ninheritance.\n\nArguments:\n\n* ``--tag`` (required): remove module from this tag\n\n* ``--name`` (required): module name\n\n* ``--stream`` (required): module stream\n\n* ``--require`` (optional): module's runtime requires, can be specified multiple times\n\n* ``--buildrequire`` (optional): module's buildrequires, can be specified multiple times\n\n\nExample:\n\n.. code-block:: bash\n\n $ ursa-major remove-module --tag fedora-30-test-build --name testmodule --stream f30\n\nThis will remove the module of ``testmodule:f30`` from tag config file if it's\ns present under tag ``fedora-30-test-build``. And if there are some tags belong\nto ``testmodule:f30`` exist in ``fedora-30-test-build``'s inheritance, those tags\nare also removed from inheritance.\n\nadd-module\n----------\n\nAdd a module to tag config file under the specified tag, and add the latest\nmodule build's tag of that module to tag inheritance accordingly.\n\nArguments:\n\n* ``--tag`` (required): add module to this tag\n\n* ``--name`` (required): module name\n\n* ``--stream`` (required): module stream\n\n* ``--priority`` (required): priority value when add tag to inheritance\n\n* ``--require`` (optional): module's runtime requires, can be specified multiple times\n\n* ``--buildrequire`` (optional): module's buildrequires, can be specified multiple times\n\n* ``--force`` (optional): allow to add module that doesn't have a build in MBS yet\n\n* ``--wait-regen-repo`` (optional): wait for regen-repo task to finish\n\n* ``--update-config-only`` (optinal): only update tag config file, not update tag inheritance\n\n* ``--update-inheritance-only`` (optional): only update tag inheritance, not update tag config file\n\nExample:\n\n.. code-block:: bash\n\n $ ursa-major add-module --tag fedora-30-test-build --name testmodule --stream f30 --priority 100\n\nIf the specified module with that ``name`` and ``stream`` already exists in tag\nconfig file, Ursa-Major will check whether ``requires`` or ``priority`` is\ndifferent from the value specified in command line, if true, the tag config\nfile will be updated to use the values specified. Tag inheritance will be\nupdated to remove tags belong to the old module, and add the latest module\nbuild's koji tag of the new module (by querying MBS) to tag inheritance.\n\nThe specified module in command line should has at least one built module\n(state name is 'ready') in MBS, so Ursa-Major can get the latest module build's\nkoji tag, if you want to specify a un-built module, you can run ``add-module``\nwith ``--force``.\n\nYou can run the command with ``--update-inheritance-only`` if you want to update\nthe tag inheritance only. And run with ``--update-config-only`` if want to update\ntag config file only, this is just similiar to change the tag config file\ndirectly, but do some checks for you at the some time.\n\nWhen any tag is added to tag inheritance, Ursa-Major also submit ``regen-repo``\ntasks for the build tags in inheritance data. If the specified tag is a build\ntag, it's the only one build tag Ursa-Major will regen-repo for. Or Ursa-Major\nwill check the tag's inheritance data, if it reaches the first build tag in\neach inheritant path, it returns that build tag. And it stops at any tag that\nname starts with 'module-'.\n\nFor example, if we have tag inheritance data as below (tags with\n'*' marks are build tags):\n\nExample #1:\n\n::\n\n my-example-tag\n \u2514\u2500product-foo-temp-override\n \u2514\u2500product-foo-override\n \u2514\u2500product-foo-build (*)\n \u251c\u2500tmp-product-foo-build (*)\n \u2514\u2500alt-product-foo-build (*)\n\nIn this case, there is one build tag found for 'my-example-tag', it is:\n``product-foo-build``. Ursa-Major stops at 'product-foo-build', so\n'tmp-product-foo-build' and 'alt-product-foo-build' are not checked at all.\n\nExample #2:\n\n::\n\n my-example-tag\n \u251c\u2500module-345678-build\n \u251c\u2500module-234567-build\n \u251c\u2500module-123456-build\n \u2502 \u2514\u2500product-foo-module-hotfix\n \u2502 \u2514\u2500product-foo-module-hotfix-build (*)\n \u251c\u2500tmp-product-foo-python-candidate\n \u2502 \u2514\u2500tmp-product-foo-python-override\n \u2502 \u2514\u2500tmp-product-foo-python-build (*)\n \u251c\u2500product-foo-container-build (*)\n \u2514\u2500product-foo-temp-override\n \u2514\u2500product-foo-override\n \u2514\u2500product-foo-build (*)\n \u251c\u2500tmp-product-foo-build (*)\n \u2514\u2500alt-product-foo-build (*)\n\nIn this case, there are 3 build tags found for ``my-example-tag``, they are:\n``tmp-product-foo-python-build``, ``product-foo-container-build`` and\n``product-foo-build``. ``product-foo-module-hotfix-build`` is a build tag, but\nUrsa-Major doesn't count it in, because it stops at tag 'module-123456-build'\nwhich name starts with 'module-'.\n\nupdate-tag\n----------\n\nUpdate a tag's inheritance data with all latest module build tags of the\nmodules in tag's config.\n\nArguments:\n\n* ``--tag`` (required): the tag to update\n* ``--wait-regen-repo`` (optional): wait for regen-repo task to finish\n\nExample:\n\n.. code-block:: bash\n\n $ ursa-major update-tag --tag fedora-30-test-build --wait-regen-repo\n\nThis will check the latest builds in MBS for all modules in config of tag\n'fedora-30-test-build', if there is any build's tag is missing from tag's\ninheritance data, the tag will be added into inheritance, and old tags\nwill be removed at the same time for the module.\n\nadd-tag\n-------\n\nReads module state change message from an environment variable and then add\nthe module's koji tag tag inheritance according to tag config file if the\nmodule build state is 'ready', and remove old tags of the module at the same\ntime. The module's state change message is generated by MBS.\n\nArguments:\n\n* ``--module-from-env`` (optional): the environment variable Ursa-Major read the\n module state change message from, by default it's ``CI_MESSAGE``\n\n* ``--wait-regen-repo`` (optinal): wait for regen-repo tasks to finish, default is ``False``\n\n* ``--send-mail`` (optional): send mail to tag owners, default is ``False``\n\nExample:\n\n.. code-block:: bash\n\n $ cat $CI_MESSAGE\n {\n \"state_reason\": null,\n \"component_builds\": [\n 108146,\n 108145\n ],\n \"name\": \"testmodule\",\n \"stream\": \"master\",\n \"time_submitted\": \"2018-10-26T16:59:06Z\",\n \"version\": \"20181026165847\",\n \"time_modified\": \"2018-10-26T16:59:27Z\",\n \"state_name\": \"ready\",\n \"scmurl\": \"https://src.fedoraproject.org/modules/testmodule.git?#3f262deef9d79160ea229142aeb51eedcc956929\",\n \"state\": 5,\n \"time_completed\": \"2018-10-26T16:59:15Z\",\n \"koji_tag\": \"module-testmodule-master-20181026165847-a5b0195c\",\n \"context\": \"a5b0195c\",\n \"owner\": \"foobar\",\n \"siblings\": [],\n \"id\": 2321,\n \"rebuild_strategy\": \"only-changed\"\n }\n\n $ cat $PWD/ursa-major.json\n {\n \"fedora-30-test-build\": {\n \"modules\": [\n {\n \"name\": \"testmodule\",\n \"priority\": 150,\n \"stream\": \"master\"\n }\n ],\n \"owners\": [\n \"foobar@example.com\"\n ]\n }\n }\n\n $ ursa-major add-tag --wait-regen-repo --send-mail\n\nIn this example, Ursa-Major reads the module state change message from\nenviroment variable ``CI_MESSAGE``, the module build state name is \"ready\" and\nmodule is present under a tag \"fedora-30-test-build\" in tag config file.\nUrsa-Major will add the koji tag \"module-testmodule-master-20181026165847-a5b0195c\"\ninto \"fedora-30-test-build\"'s inheritance, and then regen-repo for build tags\nin \"fedora-30-test-build\"'s inheritance (refer to ``add-module`` for details of\nhow to find build tags).\n\nUrsa-Major will send mail to tag owners if run with \"--send-mail\", mail\nconfiguration can be configured in global config file or user config file,\nunder the section of \"mail\".\n\n\n\nChange Logs\n===========\n0.3.3 (2019-08-23)\n------------------\n* Add new sub command update-tag (Qixiang Wan)\n\n0.3.2 (2019-06-26)\n------------------\n* Include garbaged module builds while checking existing module build tags (Qixiang Wan)\n* Refactor get_modules (Qixiang Wan)\n\n0.3.1 (2019-05-21)\n------------------\n\n* Not check requires/buildrequires for existing koji tags (Qixiang Wan)\n* Updating existing inheritance instead of removing and adding (Qixiang Wan)\n\n0.2.2 (2019-03-26)\n------------------\n\n* For adding tag, allow filtering on buildrequires to find out koji_tags from\n tag inheritance (Chenxiong Qi)\n\n0.2.1 (2019-03-20)\n------------------\n\n* Make setup_method/teardown_method compatible with newer version of pytest (Chenxiong Qi)\n* Add missing file CHANGELOG.rst to sdist package (Chenxiong Qi)\n\n0.2.0 (2019-03-20)\n------------------\n\n* Add tests for AddModuleHandler methods (Chenxiong Qi)\n* Avoid long modulemd embedded into fake data for tests (Chenxiong Qi)\n* Fixes according to review comments (Chenxiong Qi)\n* Command check-config supports filtering modules on buildrequires (Chenxiong Qi)\n* Command add-module supports buildrequires now (Chenxiong Qi)\n* Command remove-module supports filtering modules on buildrequires (Chenxiong Qi)\n* Allow passing buildrequires to MBS.get_modules_with_requires (Chenxiong Qi)\n* Reword remove-module help and --tag option help text (Chenxiong Qi)\n* Allow filtering on buildrequires (Chenxiong Qi)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pagure.io/ursa-major/", "keywords": "ursa-major modularity koji fedora", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ursa-major", "package_url": "https://pypi.org/project/ursa-major/", "platform": "", "project_url": "https://pypi.org/project/ursa-major/", "project_urls": { "Homepage": "https://pagure.io/ursa-major/" }, "release_url": "https://pypi.org/project/ursa-major/0.3.3/", "requires_dist": null, "requires_python": "", "summary": "A utility for managing module tags in Koji's tag inheritance", "version": "0.3.3" }, "last_serial": 5718645, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e9ae96a7d98f197f292a6780d1ed3a84", "sha256": "ea3506dc3526db93523736b543e09078a1746a75b0fee3dee99214a07be4cb0d" }, "downloads": -1, "filename": "ursa_major-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e9ae96a7d98f197f292a6780d1ed3a84", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 35893, "upload_time": "2018-10-30T07:37:35", "url": "https://files.pythonhosted.org/packages/9d/be/e38c87dd72e0881322bd1e9f0882f3576bbc7a4777946e9c9845abed91b8/ursa_major-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c61a7f98b25c6519eff33c028ea8776e", "sha256": "87affca69d750fb28268977f7d4473cdb76e18cc430caefcb9cdf1df31a86ae1" }, "downloads": -1, "filename": "ursa-major-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c61a7f98b25c6519eff33c028ea8776e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44645, "upload_time": "2018-10-30T07:37:38", "url": "https://files.pythonhosted.org/packages/df/ac/08dc08e7c8332ef5916321455e55f10134405f1aa1f8f20a4f1a7e1c6262/ursa-major-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "9737372264d3a8e634f04420c322ded8", "sha256": "15ad71ac48215f63f84773996ac8022ca59b1aaf44e01497dbe82b5d8d6fd9fd" }, "downloads": -1, "filename": "ursa-major-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9737372264d3a8e634f04420c322ded8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54757, "upload_time": "2019-03-20T02:36:19", "url": "https://files.pythonhosted.org/packages/ce/91/bbb6d4158c59f0fa4af1dcc1efe7519936dbcd9c4fdf1564ba35e30d2884/ursa-major-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "16a520fbedfd2d51815f44cb4219fad3", "sha256": "7615f21f1b9a6d0951f8f26a4b6815cbb173e4397d7ab52be662343fe7879b0c" }, "downloads": -1, "filename": "ursa-major-0.2.1.tar.gz", "has_sig": false, "md5_digest": "16a520fbedfd2d51815f44cb4219fad3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54935, "upload_time": "2019-03-20T08:15:20", "url": "https://files.pythonhosted.org/packages/91/f4/9c6e2eb348497a154a95a203e5fad23833b369856bb61c1e7aafa3035554/ursa-major-0.2.1.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "4485fc607c47a5685f9a00e194b8fa4f", "sha256": "069b621d011a2da0b59d3d7d745a09b83c70c43b0f47054323aa84a839edf95c" }, "downloads": -1, "filename": "ursa-major-0.3.1.tar.gz", "has_sig": false, "md5_digest": "4485fc607c47a5685f9a00e194b8fa4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59074, "upload_time": "2019-05-21T08:41:23", "url": "https://files.pythonhosted.org/packages/5b/18/f40a70510a5f742feb9d21426c671abefc7dec227bbaab29c8877d00f5b9/ursa-major-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "f29f4d5c28b66cf76df85b734415e9d5", "sha256": "6f02e87075b6d83ed39121b173d33c76bfba95c725cd3ddf847e55e4f3ea05d2" }, "downloads": -1, "filename": "ursa-major-0.3.2.tar.gz", "has_sig": false, "md5_digest": "f29f4d5c28b66cf76df85b734415e9d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58702, "upload_time": "2019-06-26T03:11:24", "url": "https://files.pythonhosted.org/packages/59/0a/3f2d72b82d468257561a1dc290343c33464112e935bd38858bff6e7e50d8/ursa-major-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "68ddaf4004f2b4e4ec542993f16d4d7f", "sha256": "123ebe36019f73481d0d086e2e3e8ecab20da4476fa6bdb98ce73d117b0e5a92" }, "downloads": -1, "filename": "ursa-major-0.3.3.tar.gz", "has_sig": false, "md5_digest": "68ddaf4004f2b4e4ec542993f16d4d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61822, "upload_time": "2019-08-23T03:49:41", "url": "https://files.pythonhosted.org/packages/b1/73/524391dfa4bb756cef263d21af4c4bab59bca0506bbf0bb4653e9ddce019/ursa-major-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "68ddaf4004f2b4e4ec542993f16d4d7f", "sha256": "123ebe36019f73481d0d086e2e3e8ecab20da4476fa6bdb98ce73d117b0e5a92" }, "downloads": -1, "filename": "ursa-major-0.3.3.tar.gz", "has_sig": false, "md5_digest": "68ddaf4004f2b4e4ec542993f16d4d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61822, "upload_time": "2019-08-23T03:49:41", "url": "https://files.pythonhosted.org/packages/b1/73/524391dfa4bb756cef263d21af4c4bab59bca0506bbf0bb4653e9ddce019/ursa-major-0.3.3.tar.gz" } ] }