[go: up one dir, main page]

Skip to content

Store issue/MR information in merge commit metadata

Problem to solve

Extracting information about which issues and merge requests are relevant to a given commit by looking at the git repository for a project means parsing human-readable commit messages.

Target audience

Release manager who has to list all the changes made in a particular software release

Proposal

Store a machine-readable reference to the merge request and/or issue which was closed by (or was otherwise related to) a given git commit, in a git notes note for that commit. Either do that for individual commits, or once per merge commit.

Use a git notes tree (see its documentation on its --ref argument) which contains the path of the GitLab installation, so that repositories which are linked to multiple GitLab installations can have such multiple notes in parallel. This could happen if a commit is cherry-picked from an upstream git repository to a downstream packaging repository by a Linux distribution, and both repositories are managed by separate GitLab installations.

e.g. Augment each merge commit with something like the following:

echo -e "closes-issues=1234,2345\nmerge-request=456" | \
git notes --ref gitlab.com/gitlab-org/gitlab-ce add -F - "${merge_commit_checksum}"

What does success look like, and how can we measure that?

Using just a clone of the git repository, it’s possible to unambiguously and completely map each commit to the set of merge requests and issues which it closes or is related to, without having to parse human-readable commit messages.

Links / references

Desirable for https://gitlab.gnome.org/pwithnall/gitlab-changelog.