Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow big bang release PR #100

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/git/pr/release/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def merge_pr_body(old_body, new_body)
merged_body = pr_body_lines.join("\n")
check_status.each { |issue_number, check_value|
say "Update pull-request checkbox \##{issue_number} to #{check_value}.", :trace
merged_body.gsub! /^- \[ \] \##{issue_number}/, "- [#{check_value}] \##{issue_number}"
merged_body.gsub! /^- \[ \] \##{issue_number}\b/, "- [#{check_value}] \##{issue_number}"
}

merged_body
Expand Down
20 changes: 20 additions & 0 deletions spec/git/pr/release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@
MARKDOWN
}
end
context "new pr added when the same numbers are included in a forward match" do
it {
actual = merge_pr_body(<<~OLD_BODY, <<~NEW_BODY)
- [x] #3 Provides a creating release pull-request object for template @hakobe
- [ ] #6 Support two factor auth @ninjinkun
OLD_BODY
- [ ] #3 Provides a creating release pull-request object for template @hakobe
- [ ] #4 use user who create PR if there is no assignee @hakobe
- [ ] #6 Support two factor auth @ninjinkun
- [ ] #30 Extract logic from bin/git-pr-release @banyan
NEW_BODY

expect(actual).to eq <<~MARKDOWN.chomp
- [x] #3 Provides a creating release pull-request object for template @hakobe
- [ ] #4 use user who create PR if there is no assignee @hakobe
- [ ] #6 Support two factor auth @ninjinkun
- [ ] #30 Extract logic from bin/git-pr-release @banyan
MARKDOWN
}
end
end

describe "#host_and_repository_and_scheme" do
Expand Down
Loading