Skip to main content

Django Heroku Github Sync

Django app for syncing Heroku and Github releases.

Version support

This app support Django 3.2+ and Python 3.10+.

Background

If you deploy your application to Heroku, and you store your code in Github, you can create automated Release notes in GH each time a release is deployed to Heroku.

This uses Github's "automatically generated release notes" feature.

How it works

The underlying principle is simple - it uses Github's REST API to create a new repo release (with associated tag) for a specific commit as identified by the Heroku API, using the Heroku release version number as the tag.

The app uses Heroku's App Webhooks api:release webhook, which receives updates each time a release is created, or its status is updated. (The updates are important as a release goes through various states, and is not released until the state reaches succeeded). You can read more about the release webhook payload here.

Configuration

Django

  1. Add to INSTALLED_APPS
  2. ...

Heroku

You must create a new webhook subscription point at this app (wherever you have it deployed).

Github

You don't need to do anything to configure Github, but you do need to give access to the API.

Tests

Running tests

The tests themselves use pytest as the test runner. If you have installed the poetry evironment, you can run them thus:

$ poetry run pytest

or

$ poetry shell
(release_tracker) $ pytest

The full suite is controlled by tox, which contains a set of environments that will format, lint, and test against all support Python

  • Django version combinations.
$ tox
...
______________________ summary __________________________
  fmt: commands succeeded
  lint: commands succeeded
  mypy: commands succeeded
  py37-django22: commands succeeded
  py37-django32: commands succeeded
  py37-djangomain: commands succeeded
  py38-django22: commands succeeded
  py38-django32: commands succeeded
  py38-djangomain: commands succeeded
  py39-django22: commands succeeded
  py39-django32: commands succeeded
  py39-djangomain: commands succeeded

CI

There is a .github/workflows/tox.yml file that can be used as a baseline to run all of the tests on Github.

Heroku

Deploy

Metadata

Release files for django-release-tracker 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-release-tracker 0.2.0
File Size Uploaded
django_release_tracker-0.2.0.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-release-tracker 0.2.0
File Interpreter ABI Platform
django_release_tracker-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.9 kB

Release files / django_release_tracker-0.2.0.tar.gz

Download URL django_release_tracker-0.2.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2f046a71796a11067df64df4eed126d18f0e48123321ff23d213171852d764e7
BLAKE2b-256 checksum
How to use checksums
c13db6130f6b14528cf76d9faef84ec694a1cf97b016ec416eb2d5aea01726ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.10 Darwin/23.1.0

Release files / django_release_tracker-0.2.0-py3-none-any.whl

Download URL django_release_tracker-0.2.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5d53dce0a5d2e9053effc8c8e48cb00c9aa28b214fddb7c3c1e9c0cf1f65fb8
BLAKE2b-256 checksum
How to use checksums
b514987d7a5e2369fdb54a9b98e7839267a341c3e4edfc993752e4785ad353c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.10 Darwin/23.1.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page