Github webhook that posts comments to pull requests, providing artifacts retrieved from CI services.
This webhook was designed to run on the google cloud platform AppEngine's standard environment. However, it should be very easy to set it up on every machine with python and flask.
To get started, set the GITHUB_USERNAME
and GITHUB_TOKEN
using environment variables or using an .env
file:
GITHUB_USERNAME = "LmmsBot"
GITHUB_TOKEN = "<retracted>"
Then, either upload deploy it to GCP or manually install the requirements.txt
file and run the main.py
flask module.
Add a webhook, check only statuses
event, and change payload type
for json
.
Currently, we use file names in order to detect relevant artifacts and display the right title.
To add additional artifacts, simply edit the settings.py
file as following:
platform = Settings.Platform(
name="Windows",
extension_to_title={
"exe": "Windows Executable"
}
)
and add this platform:
settings.platforms.append(platform)
Since this script does not use any atomic storage it is no possible to detect if while preparing a new comment, another instance already posted a new comment. Resulting two comments posted, instead of one (the second instance would have to edit the first comment, that was posted after it has checked for comment). Also, CircleCI sends two updates instead of one.
Currently, we solved that by limiting the amount of concurrent requests to 1 (See app.yaml
).
- CircleCI (Without github checks)
- AppVeyor