Coder Social home page Coder Social logo

metaswitch / announcer Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 1.0 738 KB

Announce changes in keepachangelog-style CHANGELOG.md files to Slack and Microsoft Teams

License: MIT License

Dockerfile 0.21% Python 96.42% Shell 3.37%
slack keepachangelog mistletoe teams microsoft-teams

announcer's Introduction

Github build pypi version docker pulls

announcer

This tool:

  • takes an keepachangelog-style CHANGELOG.md file
  • extracts all changes for a particular version
  • and sends a formatted message to a Slack or Microsoft Teams webhook.

It is available as a Python package, or as a Docker container for use in CI.

Installation

Install this tool using pip:

pip install announcer

Tool usage

usage: announce [-h] (--webhook WEBHOOK | --slackhook WEBHOOK) [--target {slack,teams}] --changelogversion CHANGELOGVERSION --changelogfile CHANGELOGFILE --projectname PROJECTNAME
                [--username USERNAME] [--compatibility-teams-sections] [--iconurl ICONURL | --iconemoji ICONEMOJI]

Announce CHANGELOG changes on Slack and Microsoft Teams

optional arguments:
  -h, --help            show this help message and exit
  --webhook WEBHOOK     The incoming webhook URL
  --slackhook WEBHOOK   The incoming webhook URL. (Deprecated)
  --target {slack,teams}
                        The type of announcement that should be sent to the webhook
  --changelogversion CHANGELOGVERSION
                        The changelog version to announce (e.g. 1.0.0)
  --changelogfile CHANGELOGFILE
                        The file containing changelog details (e.g. CHANGELOG.md)
  --projectname PROJECTNAME
                        The name of the project to announce (e.g. announcer)
  --username USERNAME   The username that the announcement will be made as (e.g. announcer). Valid for: Slack
  --compatibility-teams-sections
                        Compatibility option - sends Teams messages in multiple sections
  --iconurl ICONURL     A URL to use for the user icon in the announcement. Valid for: Slack
  --iconemoji ICONEMOJI
                        An emoji code to use for the user icon in the announcement (e.g. party_parrot). Valid for: Slack

Gitlab Usage

Announcer builds and publishes a Docker image that you can integrate into your .gitlab-ci.yml:

announce:
  stage: announce
  image: metaswitch/announcer:5.0.0
  script:
   - announce --webhook <webhook address>
              --changelogversion $CI_COMMIT_REF_NAME
              --changelogfile <CHANGELOG.md file>
              --projectname <Project name>
              --iconemoji party_parrot
  only:
    - tags

announcer's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar maxdymond avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

vbohinc

announcer's Issues

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Creating virtualenv announcer-GGc3XedL-py3.9 in /home/dependabot/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...

  PackageNotFound

  Package tox (3.14.3) not found.

  at /usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/poetry/repositories/pool.py:144 in package
      140│                     self._packages.append(package)
      141│ 
      142│                     return package
      143│ 
    → 144│         raise PackageNotFound("Package {} ({}) not found.".format(name, version))
      145│ 
      146│     def find_packages(
      147│         self, dependency,
      148│     ):

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

CHANGELOG link is broken if the tag and the changelogversion don't match

If the tag is not the same as the heading in the changelog (e..g if the tag is vX.Y.Z or X.Y.Z-release), but the changelog headings just use the version number, then the link to the changelog from Slack is incorrect.

One option would be to recognize the two different link types:

[<version>]: https://git/repo/tree/<tag>

and

[<version>]: https://git/repo/compare/<old_tag>...<tag>

and use that to extract the tag.

An alternative, rejected, proposal in #34 was to just specify the tag on the command line.

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Creating virtualenv announcer-ykKR_5iZ-py3.9 in /home/dependabot/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...

  PackageNotFound

  Package colorama (0.4.1) not found.

  at /usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/poetry/repositories/pool.py:144 in package
      140│                     self._packages.append(package)
      141│ 
      142│                     return package
      143│ 
    → 144│         raise PackageNotFound("Package {} ({}) not found.".format(name, version))
      145│ 
      146│     def find_packages(
      147│         self, dependency,
      148│     ):

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.