This is a system that provides answers to the following question:
Which branches did a certain GitHub pull request "land" in?
A pull request is considered landed in a branch when that branch contains that pull request's "merge commit"1.
As of 2024-02-02 GitHub does not provide an API for directly asking this question.
In order to provide an API that answers this question the following are obtained:
- All pull requests and their merge commits (via GitHub's GraphQL API).
- A clone of the repository.
From these, all landings are deduced and stored in a (PostgreSQL) database.
It is assumed that in the tracked branches, history is never rewritten.
Two programs are provided:
- pr-tracker-fetcher: obtains data, determines landings and persists them.
- pr-tracker-api: provides an HTTP endpoint for querying landings.
Takes no arguments. Expects configuration via environment.
Takes no arguments. Expects configuration via environment.
- This project uses Conventional Commits v1 and Semantic Versioning v2.
- With regard to versioning, the documented executables and NixOS modules are public. The libraries are private.
- This project, with all its components, is versioned as one.
Footnotes
-
Note that in GitHub, a pull request has a "merge commit" even having been merged without an actual merge commit. ↩