New Skara feature: dependent pull requests
erik.helin at oracle.com
Tue Mar 23 07:41:09 UTC 2021
me and Robin are looking to deploy a new feature for the jdk 
repository this week: dependent pull requests. Dependent pull requests
are used when you have a change that depends on work in a pull request
that is not yet integrated.
For an example, lets say that you are fixing a bug and realize that you
first need to refactor a piece of code in order to make the bugfix
cleaner. To aid reviewers you do *not* want to create a pull request
containing both the refactoring and the bugfix - they are distinct
changes and should be reviewed independently. You create a pull request
for the first change, the refactoring, but then what? You cannot create
a pull request for the bugfix only since the refactoring is not yet
integrated. The review of the refactoring might take a while and during
this time you cannot receive reviews for the bugfix.
Dependent pull requests will help in the above scenario. When a pull
request is created then the Skara bots will automatically create a
branch in the upstream repository named `pr/<ID>` where `<ID>` is the
id of the pull request (e.g. `17`). This `pr/<ID>` branch can then be
used as the target branch when creating a pull request. A pull request
with a dependency is automatically targeted to the dependency's target
branch when the dependency is integrated. For example, if the first pull
request (with id `17`) targets the `master` branch and the second pull
request targets the `pr/17` branch, then the second pull request will be
automatically re-targeted to the `master` branch when the first pull
request (with id `17`) is integrated. It is not possible to integrate a
pull request with a dependency on an open pull request (i.e. the
dependency must be integrated first). The branches named `pr/<ID>` are
automatically removed when the corresponding pull request is closed.
Dependent pull requests have been enabled for a long time for the skara
repository  and an example of a pull request with a dependency can be
seen here .
For those of you using the Skara CLI tools  then `git-sync` will by
default *not* sync branches named `pr/<ID>` to the personal fork. If it
did then you would have to delete all `pr/<ID>` branches in your
personal fork yourself. This default behavior can be overridden by
passing `--branches` to `git-sync`.
Let us know on the skara-dev  mailing list if you have any questions!
Erik and Robin
More information about the skara-dev