Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork849
Added rudimentary gitlab support#657
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
736b772
c2e9ed9
7e6d1e2
468a7cb
df91ce2
8905121
4f24ec0
4ef2033
18ede11
86b41c0
2c261cb
e696d2c
16fdb8d
d1004f7
681c4b4
3b5a974
2a1350f
1de4431
d62e1e1
d6e257f
264e6ba
b13d759
b1f9d09
0e66b15
182ff69
602a923
81b1a9a
d5fa89b
faf358a
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
bin/* | ||
!bin/git-generate-changelog | ||
!bin/github_changelog_generator | ||
!bin/gitlab_changelog_generator | ||
pkg/ | ||
coverage/ | ||
.bundle | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#! /usr/bin/env ruby | ||
olleolleolle marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
# frozen_string_literal: true | ||
require_relative "../lib/gitlab_changelog_generator" | ||
GitLabChangelogGenerator::ChangelogGenerator.new.run |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -10,7 +10,8 @@ def fetch_events_for_issues_and_pr | ||||||
print "Fetching events for issues and PR: 0/#{@issues.count + @pull_requests.count}\r" if options[:verbose] | ||||||
# Async fetching events: | ||||||
@fetcher.fetch_events_async(@issues) | ||||||
@fetcher.fetch_events_async(@pull_requests) | ||||||
end | ||||||
# Async fetching of all tags dates | ||||||
@@ -73,9 +74,11 @@ def associate_tagged_prs(tags, prs, total) | ||||||
# fetch that. See | ||||||
# https://developer.github.com/v3/pulls/#get-a-single-pull-request vs. | ||||||
# https://developer.github.com/v3/pulls/#list-pull-requests | ||||||
# gitlab API has this | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
| ||||||
merge_commit_sha = try_merge_commit_sha_from_gitlab(pr) | ||||||
if merge_commit_sha | ||||||
# Iterate tags.reverse (oldest to newest) to find first tag of each PR. | ||||||
if (oldest_tag = tags.reverse.find { |tag| tag["shas_in_tag"].include?(merge_commit_sha) }) | ||||||
pr["first_occurring_tag"] = oldest_tag["name"] | ||||||
found = true | ||||||
i += 1 | ||||||
@@ -95,6 +98,16 @@ def associate_tagged_prs(tags, prs, total) | ||||||
end | ||||||
end | ||||||
def try_merge_commit_sha_from_gitlab(merge_request) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The naming here has issues:
A method name such as | ||||||
merge_commit_sha = nil | ||||||
if merge_request.key?("merge_commit_sha") | ||||||
merge_commit_sha = merge_request["merge_commit_sha"] | ||||||
elsif merge_request["events"] && (event = merge_request["events"].find { |e| e["event"] == "merged" }) | ||||||
merge_commit_sha = event["commit_id"] | ||||||
end | ||||||
merge_commit_sha | ||||||
end | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
ifmerge_request.key?("merge_commit_sha")merge_request["merge_commit_sha"]elsifmerge_request["events"] &&(event=merge_request["events"].find{ |e|e["event"] =="merged"})event["commit_id"]end | ||||||
# Associate merged PRs by the HEAD of the release branch. If no | ||||||
# --release-branch was specified, then the github default branch is used. | ||||||
# | ||||||
@@ -157,7 +170,7 @@ def associate_rebase_comment_prs(tags, prs_left, total) | ||||||
# @param [Hash] issue | ||||||
def find_closed_date_by_commit(issue) | ||||||
unless issue["events"].nil? | ||||||
# if it's PR -> then find "merged event", in case of usual issue ->find closed date | ||||||
kreczko marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||
compare_string = issue["merged_at"].nil? ? "closed" : "merged" | ||||||
# reverse! - to find latest closed event. (event goes in date order) | ||||||
issue["events"].reverse!.each do |event| | ||||||
Uh oh!
There was an error while loading.Please reload this page.