-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add script to generate release notes changelog #243
Conversation
Example of output: What is
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this @macumber.
I made some changes and improvement of my own. If you can take a look at those that'd be great, and shed some light on the Fixed/Improve link/image too please
|
||
def print_issue(issue) | ||
is_feature = false | ||
issue.labels.each {|label| is_feature = true if label.name == "Enhancement Request"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the right label, it works and I see from "Improved"
developer/ruby/GitHubIssueStats.rb
Outdated
# Get the begin date, by finding the last major/minor (X.Y.0) release | ||
# that is at least a week old | ||
def get_begin_date_and_previous_tag() | ||
a_week_ago = Time.now - (60*60*24*7) | ||
|
||
@github.repos.releases.list(owner: @repo_owner, | ||
repo: @repo).each_page do |page| | ||
page.each do |release| | ||
next if release.tag_name !~ /^v\d\.\d\.0$/ | ||
release_date = Time.parse(release.created_at) | ||
next if release_date > a_week_ago | ||
puts "Found previous major/minor release: #{release.tag_name}, #{release_date}" | ||
return release_date, " (#{release.tag_name})" | ||
end | ||
end | ||
puts "Cannot find previous release, setting time to 2005" | ||
return Time.new(2005, 01, 01), "" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of harcoding the begin_date, infer it: look at a X.Y.0 release (patch level is 0) that is at least a week old (that should be sufficient to not get the current, freshly created release)
developer/ruby/GitHubIssueStats.rb
Outdated
if is_feature | ||
"- ![Improved:][improved] [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}" | ||
else | ||
"- ![Fixed:][fixed] [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not following what ![Improved:][improved]
is supposed to be. It seems halfways between an Image 
and a icon or something? @macumber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were buttons on a page a long time ago, I guess when we hosted release notes outside of GitHub. There is no need to keep them
name: Create release notes changelog | ||
on: | ||
release: | ||
types: [created] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a github actions that will do:
ruby GithubIssueStats.rb > changelog.txt
Then a python script that will locate the created release, and basically do current_release.body += changelog
This is untested since it will not run until it's on develop and I create a release, but I have tested it that the python script works fine.
developer/ruby/GitHubIssueStats.rb
Outdated
next if release.tag_name !~ /^v\d\.\d\.0$/ | ||
release_date = Time.parse(release.created_at) | ||
next if release_date > a_week_ago | ||
puts "Found previous major/minor release: #{release.tag_name}, #{release_date}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe skip pre-releases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next if release.prerelease
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matching to /^v\d\.\d\.0$/
, so that will skip anything that isn't tagged like X.Y.Z. A pre-release should have a a suffix, like -alpha1 or -rc1 or whatnot.
Above and beyond as always @jmarrec, looks good, I left one suggestion |
…r draft when looking for previous release
No description provided.