Conversation
Signed-off-by: Shon Feder <shon.feder@gmail.com>
Sudha247
left a comment
There was a problem hiding this comment.
LGTM! Some comments below, but I'm in favour of merging this and adding more improvements if needed, as we use it.
| # | ||
| # Usage: | ||
| # | ||
| # $ VERSION=X.Y.Z PR=<pr-number> ./backport.sh |
There was a problem hiding this comment.
It would be nice to have a real example here: something like (I'm making up the numbers)
$ VERSION=3.22.0 PR=#13472
I realized only later in the script that this version does not include rc, which is clear in hindsight, and the description below also helps.
| # Validate and prepare input variables | ||
| [ ! -z "${PR}" ] || (echo >&2 "error: variable 'PR' is not set"; exit 1) | ||
| [ ! -z "${VERSION}" ] || (echo >&2 "error: variable 'VERSION' is not set"; exit 1) | ||
| PR_ONLY=${PR_ONLY:-false} |
There was a problem hiding this comment.
Moving this block before checking for utils would fail faster if the variables are not set. Either way doesn't matter too much.
| rc_branch="${VERSION}-rc" | ||
| backport_branch="backport-${PR}" | ||
|
|
||
| configured_remote=$(git config remote.pushdefault || echo "") |
There was a problem hiding this comment.
This is worth documenting, I think! What origin means depends on the user.. are we assuming origin here is ocaml/dune, or the user's personal fork? (I reckon it's the former)
|
Thanks for the review! Good suggestions that we should indeed incorporate in follow-ups. :) |
Adds a script to automate most of the work of backporting fixes. Makes the process less error prone, more uniform, and much quicker.