mockito / shipkit

Toolkit for shipping it used by Mockito library
http://shipkit.org
MIT License
158 stars 35 forks source link

Fixed NPE issue when finding existing pull requests #625

Closed mockitoguy closed 6 years ago

mockitoguy commented 6 years ago

Tested with mockito project - it eliminates the NPE.

I opened an issue to use Java8: #624 so that we can get rid of our current "Optional".

Here's my test with Mockito repo. It is convincing but I have not opened a real PR:

~/mockito/release/build/downstream/mockitoShipkit$ ./gradlew performVersionUpgrade -Pdependency=org.shipkit:shipkit:1.0.9 -s
  Building version '1.0.9' (value loaded from 'version.properties' file).
  [INCUBATING] upgrade-dependency plugin is incubating and may change in any version.
  [INCUBATING] downstream-testing plugin is incubating and may change in any version.
:checkoutBaseBranch
  Executing:
    git checkout master
:identifyGitOrigin
  Executing:
    git remote get-url origin
  Identified Git origin repository: mockito/shipkit
:pullUpstream
  'git pull' does not use GitHub write token because it was not specified
  Executing:
    git pull https://github.com/mockito/shipkit.git master
:findOpenPullRequest
  New pull request will be opened because we didn't find an existing PR to reuse.
:checkoutVersionBranch
  Executing:
    git checkout -b upgrade-shipkit-to-1.0.9
:replaceVersion
  Replacing version in '/Users/sfaber/mockito/release/build/downstream/mockitoShipkit/build.gradle' using pattern 'org.shipkit:shipkit:[0-9.]+' and version '1.0.9'.
:setGitUserEmail
  Setting git user email:
    git config --local user.email <shipkit.org@gmail.com>
  External process [config] completed.
:setGitUserName
  Setting git user name:
    git config --local user.name shipkit-org
  External process [config] completed.
:commitVersionUpgrade SKIPPED
:pushVersionUpgrade SKIPPED
:createPullRequest SKIPPED
:mergePullRequest SKIPPED
:performVersionUpgrade

BUILD SUCCESSFUL

Total time: 2.265 secs
mockitoguy commented 6 years ago

@epeee, what do you think?

mockitoguy commented 6 years ago

I applied your suggestion (and cleaned up one instance of duplication, too). Tested with Mockito code and the build scan was happy: https://scans.gradle.com/s/3hh7f62qeb2z6

epeee commented 6 years ago

thx! merging...