Munki Promoter is a tool which manages the lifecycle of your software packages within a Munki repository automatically. For example you receive new versions of your packages every couple of days and it goes into a development or testing state where you can evaluate the new package. After a predefined period of days and if no complaints or errors were reported these new versions should now be promoted to the production state. Additionally you may want to offer a certain degree of transparency, therefore the current state of your software repository is mirrored by a Jira Board, where each issue represents a package.But not only is the Jira Board a visual representation it also acts as a familiar user interface to change certain packages options which will be considered by the Munki Promoter.
This is the main use case for the Munki Promoter. It loads packages from a existing Munki Repository, creates or updates the corresponding Jira issues and then checks whether a software package can or should be promoted to another catalog. In this general case we decided to go with a three catalog approach.
- Development
- Testing
- Production
Munki Promoter currently requires Python version 3.7+ and Munki tools to be installed on the machine running the application code
Its dependencies can be installed by running pip install -r requirements.txt
.
Once the prerequisites are satisfied we can begin to add all necessary
configuration values.The configuration is loaded and managed by the config.py
module. It tries to load all values from the local environment or configuration
file. This offers the advantage to simply deploy and manage a machine with a
configuration management tool such as
Ansible.
For more information and how to set up your version of Munki Promoter please refer to our documentation.
Bug fixes, documentation improvements or feature requests are always welcome. Please note that we have certain measures in place to ease development, ensure code quality and readability. Some of them are explained below.
To ensure consistency in our code we utilise Black as a code formatter.
Our continuous integration will automatically run
Flake8 and check whether our
code complies with our style guide which is almost vanilla PEP8. You can run
flake8
locally to test your code changes.
Tox aims to automate and standardize testing in Python. It is part of a larger vision of easing the packaging, testing and release process of Python software.
To test future compatibility a basic tox configuration is also included in this
repo. By simply running tox
in the main directory the test can be started.
As the code currently uses certain features from
from __future__ import annotations
the code is only compatible with Python
version 3.7 and above.
As a test runner we utilised pytest and already created tests which aim to cover most of the critical application modules.
To view the test coverage just run
coverage run -m pytest tests/* --cov=. --cov-report=html
The results will then be stored in a new folder called htmlcov
. and published
on Codacy.