From 7e1be831df74a85d60f271ae8697237cc8f49759 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:05:20 +0200 Subject: [PATCH 001/114] ci: detail --- .github/workflows/docker-hub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 8fa86ac..9be581b 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -1,4 +1,4 @@ -name: Publish +name: Publish on Docker Hub on: push: From 1c00ff22f3276024c58bb42ed3cbacb32116c8b8 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:06:38 +0200 Subject: [PATCH 002/114] fix changelog --- CHANGELOG.md | 26 ++++++++++++++------------ docs/release.sh | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64dc15f..3b4554b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [3.2.0] - 2021-08-27 +- fix changelog + +## [v3.2.0] - 2021-08-27 - add github & grafana formatters - add formatted_body to bypass markdown with direct @@ -18,15 +20,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Publish releases also on github from github actions - fix tests for recent synapse docker image -## [3.1.1] - 2021-07-18 +## [v3.1.1] - 2021-07-18 -## [3.1.0] - 2021-07-18 +## [v3.1.0] - 2021-07-18 - Publish on PyPI & Docker Hub with Github Actions in [#10](https://github.com/nim65s/matrix-webhook/pull/10) by [@nim65s](https://github.com/nim65s) -## [3.0.0] - 2021-07-18 +## [v3.0.0] - 2021-07-18 - Simplify code in [#1](https://github.com/nim65s/matrix-webhook/pull/1) @@ -44,16 +46,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 in [#9](https://github.com/nim65s/matrix-webhook/pull/9) by [@nim65s](https://github.com/nim65s) -## [2.0.0] - 2020-03-14 +## [v2.0.0] - 2020-03-14 - Update to matrix-nio & aiohttp & markdown -## [1.0.0] - 2020-02-14 +## [v1.0.0] - 2020-02-14 - First release with matrix-client & http.server [Unreleased]: https://github.com/nim65s/matrix-webhook/compare/v3.2.0...master -[3.2.0] https://github.com/nim65s/matrix-webhook/compare/v3.1.1...v3.2.0 -[3.1.1]: https://github.com/nim65s/matrix-webhook/compare/v3.1.0...v3.1.1 -[3.1.0]: https://github.com/nim65s/matrix-webhook/compare/v3.0.0...v3.1.0 -[3.0.0]: https://github.com/nim65s/matrix-webhook/compare/v2.0.0...v3.0.0 -[2.0.0]: https://github.com/nim65s/matrix-webhook/compare/v1.0.0...v2.0.0 -[1.0.0]: https://github.com/nim65s/matrix-webhook/releases/tag/v1.0.0 +[v3.2.0] https://github.com/nim65s/matrix-webhook/compare/v3.1.1...v3.2.0 +[v3.1.1]: https://github.com/nim65s/matrix-webhook/compare/v3.1.0...v3.1.1 +[v3.1.0]: https://github.com/nim65s/matrix-webhook/compare/v3.0.0...v3.1.0 +[v3.0.0]: https://github.com/nim65s/matrix-webhook/compare/v2.0.0...v3.0.0 +[v2.0.0]: https://github.com/nim65s/matrix-webhook/compare/v1.0.0...v2.0.0 +[v1.0.0]: https://github.com/nim65s/matrix-webhook/releases/tag/v1.0.0 diff --git a/docs/release.sh b/docs/release.sh index 40f05e2..26b7b83 100755 --- a/docs/release.sh +++ b/docs/release.sh @@ -11,9 +11,9 @@ poetry version "$1" NEW=$(poetry version -s) DATE=$(date +%Y-%m-%d) -sed -i "/^## \[Unreleased\]/a \\\n## [$NEW] - $DATE" CHANGELOG.md +sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" CHANGELOG.md sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md -sed -i "/^\[Unreleased\]/a [$NEW] https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md +sed -i "/^\[Unreleased\]/a [v$NEW] https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md git add pyproject.toml CHANGELOG.md git commit -m "Release v$NEW" From d726db6ed222c0ba543ecd6fe5fef7587c8bcab4 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:07:30 +0200 Subject: [PATCH 003/114] release: push --- docs/release.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release.sh b/docs/release.sh index 26b7b83..933e083 100755 --- a/docs/release.sh +++ b/docs/release.sh @@ -18,3 +18,5 @@ sed -i "/^\[Unreleased\]/a [v$NEW] https://github.com/nim65s/matrix-webhook/comp git add pyproject.toml CHANGELOG.md git commit -m "Release v$NEW" git tag -s "v$NEW" -m "Release v$NEW" +git push +git push --tags From 58d0e83f8fe0208fdcd202ddcef35548f2f51af2 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:07:36 +0200 Subject: [PATCH 004/114] Release v3.2.1 --- CHANGELOG.md | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4554b..d55ec76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v3.2.1] - 2021-08-28 + - fix changelog ## [v3.2.0] - 2021-08-27 @@ -52,7 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [v1.0.0] - 2020-02-14 - First release with matrix-client & http.server -[Unreleased]: https://github.com/nim65s/matrix-webhook/compare/v3.2.0...master +[Unreleased]: https://github.com/nim65s/matrix-webhook/compare/v3.2.1...master +[v3.2.1] https://github.com/nim65s/matrix-webhook/compare/v3.2.0...v3.2.1 [v3.2.0] https://github.com/nim65s/matrix-webhook/compare/v3.1.1...v3.2.0 [v3.1.1]: https://github.com/nim65s/matrix-webhook/compare/v3.1.0...v3.1.1 [v3.1.0]: https://github.com/nim65s/matrix-webhook/compare/v3.0.0...v3.1.0 diff --git a/pyproject.toml b/pyproject.toml index 4d815bb..2994446 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "matrix-webhook" -version = "3.2.0" +version = "3.2.1" description = "Post a message to a matrix room with a simple HTTP POST" authors = ["Guilhem Saurel "] license = "BSD-2-Clause" From df8ce523cb9ad6d9cfbda213744c3da9f444438b Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:08:56 +0200 Subject: [PATCH 005/114] fix changelog --- CHANGELOG.md | 4 ++-- docs/release.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d55ec76..646d4fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,8 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First release with matrix-client & http.server [Unreleased]: https://github.com/nim65s/matrix-webhook/compare/v3.2.1...master -[v3.2.1] https://github.com/nim65s/matrix-webhook/compare/v3.2.0...v3.2.1 -[v3.2.0] https://github.com/nim65s/matrix-webhook/compare/v3.1.1...v3.2.0 +[v3.2.1]: https://github.com/nim65s/matrix-webhook/compare/v3.2.0...v3.2.1 +[v3.2.0]: https://github.com/nim65s/matrix-webhook/compare/v3.1.1...v3.2.0 [v3.1.1]: https://github.com/nim65s/matrix-webhook/compare/v3.1.0...v3.1.1 [v3.1.0]: https://github.com/nim65s/matrix-webhook/compare/v3.0.0...v3.1.0 [v3.0.0]: https://github.com/nim65s/matrix-webhook/compare/v2.0.0...v3.0.0 diff --git a/docs/release.sh b/docs/release.sh index 933e083..c2ef8e3 100755 --- a/docs/release.sh +++ b/docs/release.sh @@ -13,7 +13,7 @@ DATE=$(date +%Y-%m-%d) sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" CHANGELOG.md sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md -sed -i "/^\[Unreleased\]/a [v$NEW] https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md +sed -i "/^\[Unreleased\]/a [v$NEW]: https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md git add pyproject.toml CHANGELOG.md git commit -m "Release v$NEW" From 0aea63903dc31fedb3f53200d3af4c7e8cd01f59 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:11:30 +0200 Subject: [PATCH 006/114] badges: add PyPI --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 62f7dbd..12fc780 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Release](https://github.com/nim65s/matrix-webhook/actions/workflows/release.yml/badge.svg)](https://pypi.org/project/matrix-webhook/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![codecov](https://codecov.io/gh/nim65s/matrix-webhook/branch/master/graph/badge.svg?token=BLGISGCYKG)](https://codecov.io/gh/nim65s/matrix-webhook) +[![PyPI version](https://badge.fury.io/py/matrix-webhook.svg)](https://badge.fury.io/py/matrix-webhook) Post a message to a matrix room with a simple HTTP POST From 8592be257fdd5e6d0af26e3ac3a1b5d94dcc219f Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:15:41 +0200 Subject: [PATCH 007/114] badges: new line --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 12fc780..1971405 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Lints](https://github.com/nim65s/matrix-webhook/actions/workflows/lint.yml/badge.svg)](https://github.com/nim65s/matrix-webhook/actions/workflows/lint.yml) [![Docker-Hub](https://github.com/nim65s/matrix-webhook/actions/workflows/docker-hub.yml/badge.svg)](https://hub.docker.com/r/nim65s/matrix-webhook) [![Release](https://github.com/nim65s/matrix-webhook/actions/workflows/release.yml/badge.svg)](https://pypi.org/project/matrix-webhook/) + [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![codecov](https://codecov.io/gh/nim65s/matrix-webhook/branch/master/graph/badge.svg?token=BLGISGCYKG)](https://codecov.io/gh/nim65s/matrix-webhook) [![PyPI version](https://badge.fury.io/py/matrix-webhook.svg)](https://badge.fury.io/py/matrix-webhook) From 179ef11ae70b6f7fcfccff641769497a16f292a8 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:18:42 +0200 Subject: [PATCH 008/114] readme: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1971405..6c66d3b 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Add a JSON webhook with `?formatter=github`, and put the `API_KEY` as secret ### For Grafana -Add a webhook with an URL ending with `?formatter=grafana&key=API_KEY' +Add a webhook with an URL ending with `?formatter=grafana&key=API_KEY` ## Test room From ef79d39a9f6cecaaf54c70f1dca5ed46896ad499 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 17:11:56 +0000 Subject: [PATCH 009/114] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 21.7b0 → 21.8b0](https://github.com/psf/black/compare/21.7b0...21.8b0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e09667c..7340a47 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 21.7b0 + rev: 21.8b0 hooks: - id: black language_version: python3 From 7aa5df3871da80b3630049c3fc6685ea9485c7f2 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:38:39 +0200 Subject: [PATCH 010/114] readme: detail --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c66d3b..6e3db88 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Add a webhook with an URL ending with `?formatter=grafana&key=API_KEY` ## Test room -[#matrix-webhook:tetaneutral.net](https://matrix.to/#/!DPrUlnwOhBEfYwsDLh:matrix.org?via=laas.fr&via=tetaneutral.net&via=aen.im) +[#matrix-webhook:tetaneutral.net](https://matrix.to/#/!DPrUlnwOhBEfYwsDLh:matrix.org) ## Unit tests From d0c4cd42274cc2261aab755190e92c3daca08b08 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 28 Aug 2021 00:40:56 +0200 Subject: [PATCH 011/114] formatters: fix github format --- matrix_webhook/formatters.py | 4 ++-- tests/test_github.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix_webhook/formatters.py b/matrix_webhook/formatters.py index 55ba43d..2d52788 100644 --- a/matrix_webhook/formatters.py +++ b/matrix_webhook/formatters.py @@ -22,8 +22,8 @@ def github(data, headers): pusher, ref, a, b, c = [ data[k] for k in ["pusher", "ref", "after", "before", "compare"] ] - pusher = f"[{pusher['name']}](https://github.com/{pusher['name']})" - data["body"] = f"@{pusher} pushed on {ref}: [{b} → {a}]({c}):\n\n" + pusher = f"[@{pusher['name']}](https://github.com/{pusher['name']})" + data["body"] = f"{pusher} pushed on {ref}: [{b} → {a}]({c}):\n\n" for commit in data["commits"]: data["body"] += f"- [{commit['message']}]({commit['url']})\n" else: diff --git a/tests/test_github.py b/tests/test_github.py index fed01d7..3943202 100644 --- a/tests/test_github.py +++ b/tests/test_github.py @@ -93,7 +93,7 @@ class GithubFormatterTest(unittest.IsolatedAsyncioTestCase): before = "ac7d1d9647008145e9d0cf65d24744d0db4862b8" after = "4bcdb25c809391baaabc264d9309059f9f48ead2" GH = "https://github.com" - expected = f'

@nim65s pushed on refs/heads/devel: ' + expected = f'

@nim65s pushed on refs/heads/devel: ' expected += f'{before} → {after}:

\n