sbt-release icon indicating copy to clipboard operation
sbt-release copied to clipboard

Add branch change tasks to allow for gitflow releasing

Open jakehschwartz opened this issue 8 years ago • 12 comments

  • Add inquireBranches, setReleaseBranch and setNextBranch which mimic the version setting/changing commands
  • Add gitflow test case

jakehschwartz avatar Feb 20 '17 04:02 jakehschwartz

My tests fail (because I just blindly copied another test). What test framework are the tests in sbt-test package using? Does anyone have any resources that I could look at to figure out how to structure a test?

jakehschwartz avatar Feb 23 '17 05:02 jakehschwartz

http://www.scala-sbt.org/0.13/docs/Testing-sbt-plugins.html

xuwei-k avatar Feb 23 '17 05:02 xuwei-k

Thanks @xuwei-k. Now that my tests pass, I still need some guidance on how make this work with hg and svn. Thanks in advance!

jakehschwartz avatar Feb 23 '17 13:02 jakehschwartz

Thanks for the review @jroper. I assumed those were not the correct implementations for hg and svn, that's why I added //FIXMEs and hopefully someone who did know what do to could help out. But if it is acceptable to just throw an exception, then I will do that, in addition to adding documentation.

jakehschwartz avatar Mar 07 '17 05:03 jakehschwartz

When/if someone goes to use this feature with hg/svn, it will be nice if rather than getting a nondescript error due to the wrong commands being run, they get an error that says exactly what the problem is - that is that the commands haven't been implemented. I don't think anyone is going to come and implement them for you anytime soon, I certainly don't have the time to do it, and I guess over 90% of sbt release users use git anyway, so I don't see any reason to hold back adding this feature until all backends are supported.

jroper avatar Mar 07 '17 06:03 jroper

@jroper I have added the documentation that you requested. I also made a major change. I realized the branch switching would not work with pushing because of the tracking remote/branch requirement. Now when creating a new branch, the tracking remote will be set the tracking remote of the current branch. This will allow us to use git push -u REMOTE BRANCH as you mentioned in the other PR. What do you think about this approach?

jakehschwartz avatar Mar 10 '17 05:03 jakehschwartz

While I do not use GitFlow, being able to switch branches would be very useful to me, as my team protects the master branches of all repositories, and hence, I would like to create new release branches so they can be approved by pull request.

Is any help needed with testing/reviewing/improving this PR?

danielkza avatar Jun 17 '17 20:06 danielkza

In terms of testing, this should work as described, I have been using it for several weeks.

jakehschwartz avatar Jun 18 '17 01:06 jakehschwartz

How exactly does this PR follow the git-flow process? If it doesnt follow it exactly the docs should be clear on that.

The (git flow page)[http://nvie.com/posts/a-successful-git-branching-model/] talks about release branches and merging back to develop, which I dont see in this PR. Or is it that this just merges to a release branch and never to master.

I think these are nice additions and they should not be held back, but think we should be a little clearer in the docs. Maybe call it "Simplified GitFlow".

stephennancekivell avatar Aug 19 '17 13:08 stephennancekivell

These changes would be very useful to me. It is possible to fix the conflicts and get this merged?

noelwelsh avatar Dec 07 '17 10:12 noelwelsh

It would be great if conflicts could be resolved !!!!!

ouriel26 avatar Jan 07 '18 12:01 ouriel26

@jakehschwartz Thanks for the awesome improvement :) It would be really great if you could finalize this pull request!

Meehau avatar Sep 13 '18 12:09 Meehau