summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-08-13 02:08:44 +0000
committerBundlerbot <bot@bundler.io>2019-08-13 02:08:44 +0000
commitde3c5692dd6651f76f26487de64f2f493e3f093f (patch)
treeca3fbb0e888575b597b6af7b0b383e03ffd6ac07
parent421ceeca55871e8887f3290325078b5946798aa5 (diff)
parente168b2efbd0ffad3c6f41827107a9298f11dafbe (diff)
downloadbundler-de3c5692dd6651f76f26487de64f2f493e3f093f.tar.gz
Merge #7256
7256: Document changelog handling for releases r=indirect a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that I'm not sure how to release bundler. ### What was your diagnosis of the problem? My diagnosis was that the part about how to handle the changelog is the most unclear step. ### What is your fix for the problem, implemented in this PR? My fix is to _guess_ how we are currently managing that, and document that. ### Why did you choose this fix out of the possible options? I chose this fix because it improves our docs, while starting a PR at the same time where I can incorporate feedback if this is not the right way. While I read the release scripts, I also added a couple of improvements to the `rake release:open_unreleased_prs` task. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--doc/playbooks/RELEASING.md18
-rw-r--r--task/release.rake29
2 files changed, 34 insertions, 13 deletions
diff --git a/doc/playbooks/RELEASING.md b/doc/playbooks/RELEASING.md
index 3eca974b6e..9cfdeda58b 100644
--- a/doc/playbooks/RELEASING.md
+++ b/doc/playbooks/RELEASING.md
@@ -54,12 +54,17 @@ The `rake release:patch` command will automatically handle cherry-picking, and i
Bundler maintains a list of changes present in each version in the `CHANGELOG.md` file.
Entries should not be added in pull requests, but are rather written by the Bundler
-maintainers in the [bundler-changelog repo](https://github.com/bundler/bundler-changelog).
-That repository tracks changes by pull requests, with each entry having an associated version,
-PR, section, author(s), issue(s) closed, and message.
+maintainers before the release.
-Ensure that repo has been updated with all new PRs before releasing a new version,
-and copy over the new sections to the `CHANGELOG.md` in the Bundler repo.
+To fill in the changelog, maintainers can go through the relevant PRs using the
+`rake release:open_unreleased_prs` and manually add a changelog entry for each
+PR that it's about to be released.
+
+If you're releasing a patch level version, you can use `rake
+release:open_unreleased_prs` to instead label each relevant PR with the proper
+milestone of the version to be release. Then the `rake release:patch` task will
+go _only_ through those PRs, and prompt you to add a changelog entry for each of
+them.
## Releases
@@ -79,8 +84,7 @@ Here's the checklist for releasing new minor versions:
* [ ] Create a new stable branch from master (see **Branching** below)
* [ ] Update `version.rb` to a prerelease number, e.g. `1.12.pre.1`
* [ ] Update `CHANGELOG.md` to include all of the features, bugfixes, etc for that
- version, from the [bundler-changelog](https://github.com/bundler/bundler-changelog)
- repo.
+ version.
* [ ] Run `rake release`, tweet, blog, let people know about the prerelease!
* [ ] Wait a **minimum of 7 days**
* [ ] If significant problems are found, increment the prerelease (i.e. 1.12.pre.2)
diff --git a/task/release.rake b/task/release.rake
index 8aeaa0bfee..73d3d5045c 100644
--- a/task/release.rake
+++ b/task/release.rake
@@ -75,7 +75,10 @@ namespace :release do
loop do
print(prompt)
print(": ") unless prompt.empty?
- break if $stdin.gets.strip == "y"
+
+ answer = $stdin.gets.strip
+ break if answer == "y"
+ abort if answer == "n"
end
rescue Interrupt
abort
@@ -215,14 +218,28 @@ namespace :release do
commits.reverse_each.map {|c| c =~ /(Auto merge of|Merge pull request|Merge) #(\d+)/ && $2 }.compact
end
- last_stable = `git ls-remote origin`.split("\n").map {|r| r =~ %r{refs/tags/v([\d.]+)$} && $1 }.compact.map {|v| Gem::Version.create(v) }.max
- last_stable = last_stable.segments[0, 2].<<("stable").join("-")
+ def minor_release_tags
+ `git ls-remote origin`.split("\n").map {|r| r =~ %r{refs/tags/v([\d.]+)$} && $1 }.compact.map {|v| Gem::Version.create(Gem::Version.create(v).segments[0, 2].join(".")) }.sort.uniq
+ end
+
+ def to_stable_branch(release_tag)
+ release_tag.segments[0, 2].<<("stable").join("-")
+ end
+
+ last_stable = to_stable_branch(minor_release_tags[-1])
+ previous_to_last_stable = to_stable_branch(minor_release_tags[-2])
+
+ in_release = prs("HEAD") - prs(last_stable) - prs(previous_to_last_stable)
- in_release = prs("HEAD") - prs(last_stable)
+ print "About to review #{in_release.size} pending PRs. "
+
+ confirm "Continue? (y/n)"
in_release.each do |pr|
- system("open", "https://github.com/bundler/bundler/pull/#{pr}")
- confirm
+ url_opener = /darwin/ =~ RUBY_PLATFORM ? "open" : "xdg-open"
+ url = "https://github.com/bundler/bundler/pull/#{pr}"
+ print "#{url}. (n)ext/(o)pen? "
+ system(url_opener, url, :out => IO::NULL, :err => IO::NULL) if $stdin.gets.strip == "o"
end
end
end