typedb/typedb-dependencies

Release note script does not handle rebase-merge

Closed this issue · 3 comments

Description

The release note generation script does not seem to handle rebase-merges, which is a common workflow now that we use development branches. This operation replays N commits from development to master. When releasing, we see a list of N commit messages that are all the message from the actual pull-request operation, rather than N original commit messages.

Reproducible Steps

  1. Create develpment branch
  2. Make some commits ("a", "b", "c")
  3. Rebase-merge development into master with pull request message ("development -> master")
  4. Release master

Expected Output

Master contains 3 new commits: "a", "b", "c". The release notes contain messages "a", "b", "c".

Actual Output

Master contains 3 new commits: "a", "b", "c". The release note contains "development -> master" 3 times.

It seems like the rebase merge seems to overwrite the associated pulls in GitHub's API.

Getting this information back might require us looking at the linked PR number and using that to find the original PR with info to create a release note. This is a not ideal as that PR number only exists in the commit message.

Example:
https://api.github.com/repos/vaticle/typedb/commits/05eb911f8b61545304dbb5e236a13bca85b04359
https://api.github.com/repos/vaticle/typedb/commits/05eb911f8b61545304dbb5e236a13bca85b04359/pulls

This commit should have the associated PR that created it, but instead it just has the development to master merge PR associated. No second associated PR is found.

Contrast with:
https://api.github.com/repos/vaticle/typeql/commits/5b89af40639d639c6962ed76f3f2522d18a93fe3
https://api.github.com/repos/vaticle/typeql/commits/5b89af40639d639c6962ed76f3f2522d18a93fe3/pulls

Which still has its associated PR.

From GitHub's API:
https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit

Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results only include open pull requests.

The PR that introduced the above example commit into the repository is the PR typedb/typedb#6660, not typedb/typedb#6686. Pretty confusing wording compared to outcome.

We've decided we aren't going to follow the rebase merge strategy in the future. As a consequence, our script that creates notes doesn't need to change. Additionally, we've tested that our strategy going forwards (merge commit) and are confident that our script is correct for that workflow.