Metadata-Version: 2.1
Name: buildbot-mattermost-reporter
Version: 0.2.0
Summary: Mattermost status reporter for Buildbot
Author-email: Aksel Sjögren <sjoegren@mailc.net>
Project-URL: Homepage, https://github.com/sjoegren/buildbot-mattermost-reporter
Project-URL: Issues, https://github.com/sjoegren/buildbot-mattermost-reporter/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: buildbot>=3.0
Provides-Extra: test
Requires-Dist: black; extra == "test"
Requires-Dist: flake8; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: txrequests; extra == "test"

# Mattermost status reporter for Buildbot

Install:

```
pip install buildbot-mattermost-reporter
```

Usage example in Buildbot `master.cfg`:

```python
from buildbot.plugins import reporters

c['services'].append(
    reporters.MattermostStatusPush(
        webhook_url="https://mattermost.example.com/hooks/hookidstring",
    ),
)
```

Parameters to `MattermostStatusPush`:

```
MattermostStatusPush(
    webhook_url, channel=None, icon_url=None, icon_emoji=None,
    timezone=None, username_fn=None, buildstatusgenerator_kwargs=None,
    generators=None,
    **kwargs)
```

* `webhook_url` (*string*): Mattermost Webhook URL given when webhook is
  created
* `channel` (*string*): See [Mattermost incoming webhooks docs][]
* `icon_url` (*string*): See [Mattermost incoming webhooks docs][]
* `icon_emoji` (*string*): See [Mattermost incoming webhooks docs][]
* `timezone` (*datetime.tzinfo*): Convert timestamps in messages to a timezone,
  if set. Otherwise timestamps are UTC. Concrete `tzinfo` objects could be
  created with [dateutil][], which Buildbot has as dependency.
* `username_fn` (*callable*): Callable that takes a string argument, which is
  one of the individuals in the builds *owners* property, and returns a
  Mattermost username. The username is used for failing builds, where the
  message includes a line like `@owner1, @owner2, ...`. By default a function
  is used that assumes that each owner is an e-mail address and returns the
  part before @, i.e. `user@example.com` returns `user`.
  An example where failing builds would notify the whole channel instead would
  be `username_fn=lambda _: "channel"`.
* `buildstatusgenerator_kwargs` (*dict*): Any extra keyword arguments to
  `reporters.BuildStatusGenerator`, e.g.
  `buildstatusgenerator_kwargs={'report_new': True}`.
* `generators` (*list*): To override generator created by
  `MattermostStatusPush` and format Mattermost messages in a custom manner.
* `**kwargs`: Any extra arguments to `reporters.HttpStatusPush`.

[Mattermost incoming webhooks docs]: https://developers.mattermost.com/integrate/webhooks/incoming/
[dateutil]: https://pypi.org/project/python-dateutil/
