New Skara feature: dependent pull requests
erik.joelsson at oracle.com
erik.joelsson at oracle.com
Tue Nov 2 16:18:30 UTC 2021
Hello Vladimir,
I've never used sync to get pr branches to my fork, but after a quick
peek at the source it seems Erik's instructions below are wrong. Just
using --branches will not override the default "ignore" of "pr/.*". I
think you can get around this by also overriding the ignore list with a
dummy value. Something like this:
git sync --branches pull/574 --ignore foo
I believe this should be fixed. If something is explicitly matched by
the --branches, it shouldn't also be ignored. Feel free to file an issue.
/Erik
On 2021-11-02 08:44, Vladimir Kempik wrote:
> Hello
> I’m tying to use dependent pr feautre in skara cli and I can’t
> I’m working in jdk11u-dev repo and
> the command
> git sync --branches pull/574
> doesn’t get me desired branch in my fork.
> any tips ?
> Regards, Vladimir
>> 23 марта 2021 г., в 10:41, Erik Helin <erik.helin at oracle.com> написал(а):
>>
>> Hi all,
>>
>> me and Robin are looking to deploy a new feature for the jdk [0] 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 [1] and an example of a pull request with a dependency can be seen here [2].
>>
>> For those of you using the Skara CLI tools [3] 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 [4] mailing list if you have any questions!
>>
>> Thanks,
>> Erik and Robin
>>
>> [0]: https://github.com/openjdk/jdk
>> [1]: https://github.com/openjdk/skara
>> [2]: https://github.com/openjdk/skara/pull/1087
>> [3]: https://wiki.openjdk.java.net/display/SKARA/CLI+Tools
>> [4]: https://mail.openjdk.java.net/mailman/listinfo/skara-dev
>>
More information about the skara-dev
mailing list