{"id":18584670,"url":"https://github.com/fedora-modularity/message-tagging-service","last_synced_at":"2025-04-10T12:30:44.708Z","repository":{"id":57440986,"uuid":"157424989","full_name":"fedora-modularity/message-tagging-service","owner":"fedora-modularity","description":"Tag koji builds with the correct tags, triggered by the message bus","archived":false,"fork":false,"pushed_at":"2025-01-08T20:55:40.000Z","size":467,"stargazers_count":2,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T21:22:11.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedora-modularity.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-13T18:13:04.000Z","updated_at":"2024-07-11T19:01:58.000Z","dependencies_parsed_at":"2024-01-19T13:52:15.034Z","dependency_job_id":"d8f25710-2e54-41c4-8ea9-f9bad6e83c1f","html_url":"https://github.com/fedora-modularity/message-tagging-service","commit_stats":{"total_commits":142,"total_committers":8,"mean_commits":17.75,"dds":0.3380281690140845,"last_synced_commit":"3ae3a1257fdca7ebd65e8fe18d6494ddef2e4fb6"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-modularity%2Fmessage-tagging-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-modularity%2Fmessage-tagging-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-modularity%2Fmessage-tagging-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-modularity%2Fmessage-tagging-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedora-modularity","download_url":"https://codeload.github.com/fedora-modularity/message-tagging-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217124,"owners_count":21066633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T00:28:22.899Z","updated_at":"2025-04-10T12:30:44.352Z","avatar_url":"https://github.com/fedora-modularity.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Message Tagging Service\n=======================\n\n.. image:: https://img.shields.io/pypi/v/message-tagging-service.svg\n   :target: https://pypi.org/project/message-tagging-service/\n\n.. image:: https://img.shields.io/pypi/pyversions/message-tagging-service.svg\n   :target: https://pypi.org/project/message-tagging-service/\n\n.. image:: https://img.shields.io/pypi/l/message-tagging-service.svg?colorB=green\n   :target: https://pypi.org/project/message-tagging-service/\n\n.. image:: https://quay.io/repository/factory2/message-tagging-service/status\n   :target: https://quay.io/repository/factory2/message-tagging-service/status\n\nMessage tagging service is a microservice to tag build with proper tags, which\nis triggered by specific message from a message bus. Currently, service\nsupports to tag module build according to a module build state change event.\n\nThis service works with Python 3.6 and 3.7.\n\nWorkflow\n--------\n\nThis is the service workflow, for example of a module build.\n\n* Listen on message bus, which is `fedora-messaging`_ in Fedora, and waiting\n  for module build state change events.\n\n* Once received a message, MTS checks predefined rule definitions one by one in\n  the order of presence in rule file.\n\n* If the module build matches a rule, apply tags defined in matched rule to\n  this build and its associated ``-devel`` build.\n\n* Send message to message bus to announce a module build is tagged with\n  specific tags. Please note that MTS does not actually wait for the tag build\n  task to finish. The message is sent just after ``tagBuild`` returns, which\n  just creates a tag build task and returns immediately.\n\n.. _fedora-messaging: https://fedora-messaging.readthedocs.io/en/stable/\n\nRule Definition\n---------------\n\nRule definition is documented in a `Modularity document`_\n\nFor detailed information on how the rules are matched, please refer to\n`paragraph`_ in that document.\n\n.. _Modularity document: https://pagure.io/modularity/blob/master/f/drafts/module-tagging-service/format.md\n.. _paragraph: https://pagure.io/modularity/blob/master/f/drafts/module-tagging-service/format.md?text=True#_8\n\nConfiguration\n-------------\n\nApplication configuration ``conf/config.py``. Each config is well-documented,\nplease refer to this file's content for detailed information. Following three\nconfig section are defined for different purpose to run MTS.\n\n* ``BaseConfiguration`` provides default options which could be reused for\n  running in production.\n* ``DevConfiguration`` contains anything for running in development mode.\n* ``TestConfiguration`` contains any config for test purpose.\n\nMessaging configuration for fedora-messaging included in file ``conf/mts.toml``,\nwhich includes configs for receiving and sending messages from and to\nfedora-messaging broker in `TOML`_ format. The default config values is defined\nwell for interacting with a local RabbitMQ broker, which is good for testing\nlocally. For deployment, copy this file and adjust config values for the Fedora\nmessaging broker.\n\n.. _TOML: https://github.com/toml-lang/toml\n\nMessaging\n---------\n\nEvents\n~~~~~~\n\nbuild.tag.requested\n^^^^^^^^^^^^^^^^^^^\n\nMessage is sent when a ``tagBuild`` task is requested in Koji. An example message::\n\n    {\n      \"build\": {\n        \"id\": id,\n        \"name\": name,\n        \"stream\": stream,\n        \"version\": version,\n        \"context\": context,\n      },\n      \"nvr\": N-V-R,\n      \"destination_tags\": [\n        {\"tag\": name_1, \"task_id\": 1},\n        {\"tag\": name_2, \"task_id\": 2},\n        ...\n      ]\n    }\n\nwhere, ``destination_tags`` is a list of mappings each of them contains the tag\nto apply and corresponding task ID returned from Koji.\n\nbuild.tag.unmatched\n^^^^^^^^^^^^^^^^^^^\n\nMessage is sent if a module build does not match any predefined rules. An\nexample message::\n\n    {\n      \"build\": {\n        \"id\": id,\n        \"name\": name,\n        \"stream\": stream,\n        \"version\": version,\n        \"context\": context,\n      },\n    }\n\nThe message simply contains the module build information.\n\nTopic Prefix\n~~~~~~~~~~~~\n\nFor Fedora, messages are sent to topics with prefix ``org.fedoraproject.prod``,\ne.g. ``org.fedoraproject.prod.mts.build.tag.requested``.\n\nFor internal, the prefix is ``VirtualTopic.eng.mts``, e.g.\n``VirtualTopic.eng.mts.build.tag.requested``.\n\nEnvironment Variables\n---------------------\n\nMTS_DRY_RUN\n~~~~~~~~~~~\n\nDry run mode. Currently, no build is tagged actually in dry run mode. No\nparticular is required. Just define ``MTS_DRY_RUN`` in environment variables.\n\nMTS_DEV\n~~~~~~~\n\nSwitch service to run in development mode as long as ``MTS_DEV`` is defined.\nFor example, ``export MTS_DEV=1``.\n\nMTS_CONFIG_FILE\n~~~~~~~~~~~~~~~\n\nSpecify an alternative config file instead of reading the ``conf/config.py``\nwhen ``MTS_DEV`` is enabled or ``/etc/mts/config.py`` if MTS is installed in\nsystem. Either an absolute path or relative path works.\n\nContribution\n------------\n\nReport issue at https://github.com/fedora-modularity/message-tagging-service/issues.\n\nBefore making a pull request, ensure the changes do not break anything and are\ncovered by tests. Run tests::\n\n  tox\n\nChange Logs\n-----------\n\n0.8.1 (2020-06-22)\n~~~~~~~~~~~~~~~~~~\n\n* Fix the field from build_state to state_name for state filter (Yu Ming Zhu)\n\n0.8 (2020-06-18)\n~~~~~~~~~~~~~~~~\n\n* Only receive msgs with build_state is ready or done by default (Yu Ming Zhu)\n* Unittest: the latest koji use gssapi_login instead of krb_login (Yu Ming Zhu)\n* CI: Fix missing command to run tests (Chenxiong Qi)\n* Use image fedora:31 in CI (Chenxiong Qi)\n\n0.7 (2020-02-07)\n~~~~~~~~~~~~~~~~\n\n* Upgrade base image to Fedora 30\n* Do not attempt to tag a scratch build (Chenxiong Qi)\n* Do not handle scratch from rule (Chenxiong Qi)\n* Add support for complex destinations (Luiz Carvalho)\n* Run mts in the foreground (Luiz Carvalho)\n\n0.6 (2019-09-27)\n~~~~~~~~~~~~~~~~\n\n* Revert \"Log the exception when tag failures occur\" (Chenxiong Qi)\n* Allow durable queues when using rhmsg (Luiz Carvalho)\n* Fix param type of dest_tags (Chenxiong Qi)\n* Better logs (Chenxiong Qi)\n* Log the exception when tag failures occur (mprahl)\n* Set image version to latest (Chenxiong Qi)\n* Fix consumer and add tests (Chenxiong Qi)\n* Massive updates to README.rst (Chenxiong Qi)\n* Fix variable name inside log message format (Chenxiong Qi)\n* Include mts.toml config in sdist package (Chenxiong Qi)\n* Do not include removed fedmsg.d/ directory (Chenxiong Qi)\n* Remove fedmsg related lines from Dockerfile (Chenxiong Qi)\n* Remove duplicate code handling rule scratch and development (Chenxiong Qi)\n* Migrate to fedora-messaging (Chenxiong Qi)\n* Refactor function is_file_readable (Chenxiong Qi)\n* No need to set koji_cert if not use ssl auth (Chenxiong Qi)\n* Ensure logout koji session if something wrong on session (Chenxiong Qi)\n* Revert \"Set USER for fedmsg to publish message\" (Chenxiong Qi)\n* Revert \"Install packages for Fedora container\" (Chenxiong Qi)\n* Set USER for fedmsg to publish message (Chenxiong Qi)\n* Install packages for Fedora container (Chenxiong Qi)\n* Use new pytest.raises argument match (Chenxiong Qi)\n\n0.5 (2019-04-15)\n~~~~~~~~~~~~~~~~\n\n- Change metric name to be in sync with other services (Filip Valder)\n- Reduce the number of tries to match rules (Chenxiong Qi)\n- Match module build by build state (Chenxiong Qi)\n\n0.4.1 (2019-04-01)\n~~~~~~~~~~~~~~~~~~\n\n- Ignore https verify while downloading ca cert (Chenxiong Qi)\n\n0.4 (2019-03-30)\n~~~~~~~~~~~~~~~~\n\n- Adjust gunicorn command line options (Chenxiong Qi)\n- Increase the number of workers to run the web app (Chenxiong Qi)\n- Set gunicorn log level to debug (Chenxiong Qi)\n- Test image build and container in Travis-CI (Chenxiong Qi)\n- Refactor Dockerfile (Chenxiong Qi)\n- Add missing deps to Dockerfile (Chenxiong Qi)\n- Add missing \\ to break dnf-install command properly in Dockerfile (Chenxiong Qi)\n- Expose metrics endpoint for monitoring (Chenxiong Qi)\n- Add container badge in README (Chenxiong Qi)\n- Include failed tagBuild task request in build.tag.requested message (Chenxiong Qi)\n\n0.3 (2019-02-20)\n~~~~~~~~~~~~~~~~\n\n- Refine event topics (Chenxiong Qi)\n- Fix badges in README (Chenxiong Qi)\n- Better log when module build in init state (Chenxiong Qi)\n- Use known good version of moksha-hub (Luiz Carvalho)\n- Tag -devel CG Koji build (Luiz Carvalho)\n- Handle multiple tags for single rule (Luiz Carvalho)\n- Refine code for the first match wins (Chenxiong Qi)\n- Use dedent in tests when mocking modulemd data (Luiz Carvalho)\n- Only allow a single rule match (Luiz Carvalho)\n- Make docker/install-ca.sh executable (mprahl)\n- Add missing docker/install-ca.sh (mprahl)\n- Add back the volumes for improved UX in OpenShift (mprahl)\n- Connect over http when using the rcm-tools repo since the CA isn't trusted (mprahl)\n- Fix a comment in the Jenkinsfile (mprahl)\n- Add a Jenkins job to build container images and push them to quay.io (mprahl)\n- Install rhmsg in the container image (mprahl)\n- Add the ability to install a custom CA in the container image (mprahl)\n- Set the default container user to 1001 to mimic OpenShift (mprahl)\n- Add additional DNF arguments to make the container image slightly smaller (mprahl)\n- Remove the volumes in the Dockerfile that MTS doesn't write to (mprahl)\n- Don't rely on default fedmsg configuration files in the container image (mprahl)\n- Add Dockerfile for building prod image (Chenxiong Qi)\n- Allow set None to a config (Chenxiong Qi)\n- Refine configuration section in README (Chenxiong Qi)\n- Fix consumer_topics in config (Chenxiong Qi)\n- Install MTS and fedmsg.d config files (Chenxiong Qi)\n- Fix grammar issues in README (Chenxiong Qi)\n- Support multiple authtype to login a Koji session (Chenxiong Qi)\n- Refactor fedmsg.d config (Chenxiong Qi)\n- Convert README to RST format (Chenxiong Qi)\n- Login koji session by calling koji_cli.lib.activate_session (Chenxiong Qi)\n- Config update and reset methods. Extending tests for Config (Valerij Maljulin)\n- Merge __getattr__ with __getitem__ in Config class (Valerij Maljulin)\n- Adding support for profile parameter (Valerij Maljulin)\n- Base class for configuration profiles (Valerij Maljulin)\n\n0.2 (2019-01-22)\n~~~~~~~~~~~~~~~~\n\n- Add missing files to tarball generated by sdist\n\n0.1 (2019-01-21)\n~~~~~~~~~~~~~~~~\n\n- First release that MTS is able to handle specific message to tag build.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedora-modularity%2Fmessage-tagging-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedora-modularity%2Fmessage-tagging-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedora-modularity%2Fmessage-tagging-service/lists"}