Skip to content

Commit 2151988

Browse files
author
Jonathan Chauncey
committed
chore(changelog): Add changelog script
1 parent e9d102b commit 2151988

4 files changed

Lines changed: 238 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
### v2.0.0-beta4
2+
3+
#### Features
4+
5+
- [`e9d102b`](https://github.com/deis/monitor/commit/e9d102b06667efadb43c34d9e1b6dd08e5ee6efd) grafana: Use grafana to calc request per second
6+
- [`5ce1dbf`](https://github.com/deis/monitor/commit/5ce1dbf3484eb3a43b60f6f8c3cdd62b56f06fe3) telegraf: Add the ability to poll kubernetes prometheus endpoints
7+
8+
#### Fixes
9+
10+
- [`7a156c4`](https://github.com/deis/monitor/commit/7a156c47e50ecdcad1af2068a5bab34720a0bc70) telegraf: Set insecure verify to true
11+
- [`6b2f8bb`](https://github.com/deis/monitor/commit/6b2f8bbba593412cf0811c46c952cd4465df95df) telegraf: dont remove curl
12+
- [`2fe7927`](https://github.com/deis/monitor/commit/2fe79274650d141febce12dcf3fbfabdb1b0e600) telegraf: Document agent configuration
13+
- [`8ea1bd7`](https://github.com/deis/monitor/commit/8ea1bd79c96ee6d7491baa2aecb11e335a454406) influx: Make influx config a go template
14+
15+
#### Documentation
16+
17+
18+
#### Maintenance
19+
20+
- [`0a474e2`](https://github.com/deis/monitor/commit/0a474e2d99b035ff14805ca8009c834994b36469) grafana: Update to 3.0.0-beta7
21+
- [`309a589`](https://github.com/deis/monitor/commit/309a589d10ca46e03adebc708bfc8739c8866ea8) grafana: Add node health and kubernetes graphs
22+
- [`b231c1b`](https://github.com/deis/monitor/commit/b231c1bd834c692176ddbc6e4358c9d1a776fb41) influx: Turn off logging by default
23+
- [`f63e4b4`](https://github.com/deis/monitor/commit/f63e4b4824deef4b2e2a45af737323345ccc8081) telegraf: Copy paste fail
24+
- [`eed5d62`](https://github.com/deis/monitor/commit/eed5d6227d214b857a770dae86bb9f67c55eeece) telegraf: Use env var to quiet telegraf instead of cli arg
25+
- [`9beef58`](https://github.com/deis/monitor/commit/9beef585a96fb3f96eed0bc803e5c3fedb2c03cb) telegraf: Make telegraf run in quiet mode
26+
- [`c30e88e`](https://github.com/deis/monitor/commit/c30e88ea60780ac6ef238e05e584c4677c5b8aab) telegraf: Update envtpl to 0.1.2

_scripts/generate-changelog.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
# vim: et tw=0 sw=4 ts=4
3+
4+
REPOROOT=${REPOROOT:=https://github.com/deis/monitor}
5+
TYPES=${TYPES:=feat(;Features fix(;Fixes docs(;Documentation chore(;Maintenance}
6+
7+
usage() {
8+
echo "Usage: $0 <from> [to]
9+
10+
The REPOROOT and TYPES variables may be used to customize what links are
11+
generated and what is scraped from the commit logs. Current settings are:
12+
13+
REPOROOT=$REPOROOT
14+
TYPES=$TYPES
15+
"
16+
}
17+
18+
# Print the information scraped from git
19+
retrieve() {
20+
while read -r commit hash message; do
21+
# Extract the subsystem where type(subsystem): message
22+
SUBSYSTEM=$(echo "$message" | cut -d'(' -f2 | cut -d')' -f1 | sed 's/\*/\(all\)/g')
23+
# Extract the message where type(subsystem): message
24+
MESSAGE=$(echo "$message" | awk -F ")" '{ print $2}' | sed 's/://' | cut -f2- -d' ')
25+
# Generate a link to the full legal commit on GitHub
26+
LINK="$REPOROOT/commit/$hash"
27+
# Echo all this in a way that makes the commit hash and message a link
28+
# to the commit in markdown
29+
echo ' -' "[\`$commit\`]($LINK)" "$SUBSYSTEM": "$MESSAGE"
30+
done < <(git --no-pager log --oneline --merges --oneline --format="%h %H %b" --grep="$1" "$FROM".."$TO")
31+
# Scrape the information from git
32+
}
33+
34+
# Wrap feature type and show its relevant commits
35+
subheading() {
36+
echo "#### $1"
37+
echo
38+
retrieve "$2"
39+
echo
40+
}
41+
42+
main() {
43+
# Print usage summary if user didn't specify a beginning
44+
if [ -z "$1" ]; then
45+
usage
46+
exit 1
47+
fi
48+
49+
FROM=$1
50+
TO=${2:-"HEAD"}
51+
52+
printf "### %s -> %s\n\n" "$FROM" "$TO"
53+
54+
# Iterate over the types of messages specified
55+
for LEGALTYPE in $TYPES; do
56+
SHORT=$(echo "$LEGALTYPE" | cut -f1 -d';')
57+
LONG=$(echo "$LEGALTYPE" | cut -f2 -d';')
58+
subheading "$LONG" "$SHORT"
59+
done
60+
}
61+
62+
if [ $SHLVL -eq 2 ]; then
63+
# If this is being run as a command
64+
main "$@"
65+
else
66+
# Otherwise this is being sourced
67+
unset -f main
68+
unset -f usage
69+
fi

_scripts/util/commit-msg

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This hook verifies that the commit message follows deis commit style
4+
# To install this hook run the following command from the deis git root
5+
# cp contrib/util/commit-msg .git/hooks/commit-msg
6+
set -eo pipefail
7+
8+
RED=$(tput setaf 1)
9+
YELLOW=$(tput setaf 3)
10+
NORMAL=$(tput sgr0)
11+
subject_regex="^(feat|fix|docs|style|ref|test|chore)\(.+\): [\w\s\d]*"
12+
capital_regex="^.+\): [a-z][\w\s\d]*"
13+
14+
MESSAGE[1]="file"
15+
16+
i=1 # the first array variable is at index 1
17+
while read line
18+
do
19+
MESSAGE[$i]=$line
20+
let i++
21+
done < "$1"
22+
23+
SUBJECT=${MESSAGE[1]}
24+
25+
if ! [[ $SUBJECT =~ $subject_regex ]]; then
26+
echo "${RED}ERROR - Invalid subject line."
27+
echo ""
28+
echo "$SUBJECT"
29+
echo ""
30+
echo "It must be in the format: {type}({scope}): {subject}"
31+
echo ""
32+
echo "The following {type}s are allowed:"
33+
echo "feat"
34+
echo "fix"
35+
echo "docs"
36+
echo "style"
37+
echo "ref"
38+
echo "test"
39+
echo "chore"
40+
echo ""
41+
echo "Read more at http://docs.deis.io/en/latest/contributing/standards/$NORMAL"
42+
exit 0
43+
fi
44+
45+
if ! [[ $SUBJECT =~ $capital_regex ]]; then
46+
echo "${RED}ERROR - Don't the capitalize commit message."
47+
echo ""
48+
echo "$SUBJECT"
49+
echo ""
50+
echo "Read more at http://docs.deis.io/en/latest/contributing/standards/$NORMAL"
51+
exit 0
52+
fi
53+
54+
if [[ ${#SUBJECT} -gt 50 ]]; then
55+
echo "${YELLOW}WARNING - Subject shouldn't be longer than 50 characters."
56+
echo ""
57+
echo "Read more at http://docs.deis.io/en/latest/contributing/standards/$NORMAL"
58+
exit 0
59+
fi
60+
61+
if [[ ${#MESSAGE[2]} -gt 0 ]]; then
62+
echo "${RED}ERROR - Second line must be blank"
63+
echo ""
64+
echo "Read more at http://docs.deis.io/en/latest/contributing/standards/$NORMAL"
65+
exit 0
66+
fi
67+
68+
cnt=${#MESSAGE[@]}
69+
for (( i = 3 ; i <= cnt ; i++ ))
70+
do
71+
if [[ ${#MESSAGE[$i]} -gt 72 ]] && [[ ${MESSAGE[$i]:0:1} != '#' ]]; then
72+
echo "${RED}ERROR on line $i - can't be longer than 72 characters."
73+
echo ""
74+
echo "Read more at http://docs.deis.io/en/latest/contributing/standards/$NORMAL"
75+
exit 0
76+
fi
77+
done
78+
79+
echo "Your commit message follows the deis commit style."
80+
81+
exit 0
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'octokit'
4+
5+
date_since = ARGV.first
6+
7+
if date_since.nil? or date_since.empty?
8+
puts "Usage: deis-contributions-since <yyyy-mm-dd>"
9+
exit 1
10+
end
11+
12+
# ignore project maintainers
13+
ignored_contributors = %w[adamreese aledbf bacongobbler carmstrong dwmcallister gabrtv helgi iancoffey jackfrancis jchauncey kalbasit kmala krancour johanneswuerbach lanej mboersma michelleN mikedup rimusz sgoings slack smothiki technosophos]
14+
15+
# make our GitHub calls here
16+
client = Octokit::Client.new(:access_token => ENV['GITHUB_ACCESS_TOKEN'])
17+
prs_obj = client.search_issues("repo:deis/deis is:pr is:merged merged:>#{date_since}", {:sort => 'updated', :order => 'desc', :per_page => 1000})
18+
issues_obj = client.search_issues("repo:deis/deis is:issue created:>#{date_since}", {:per_page => 1000})
19+
20+
contributors = {}
21+
22+
puts "-----"
23+
puts "Found #{issues_obj.items.size} issues opened on or after #{date_since}"
24+
puts "Found #{prs_obj.items.count} pull requests merged on or after #{date_since}"
25+
puts "-----"
26+
puts
27+
28+
issues_obj.items.each do |issue|
29+
author = issue.user.login.to_s
30+
title = issue.title.to_s
31+
if contributors[author].nil?
32+
contributors[author] = [title]
33+
else
34+
contributors[author].push(title)
35+
end
36+
end
37+
38+
prs_obj.items.each do |pr|
39+
author = pr.user.login.to_s
40+
title = pr.title.to_s
41+
if contributors[author].nil?
42+
contributors[author] = [title]
43+
else
44+
contributors[author].push(title)
45+
end
46+
puts "- #{pr.title} - [\##{pr.number}](#{pr.pull_request.html_url}) ([@#{pr.user.login}](#{pr.user.html_url}))"
47+
end
48+
puts
49+
50+
# remove project maintainers from the list of contributors
51+
contributors.reject! {|k,v| ignored_contributors.include?(k) }
52+
53+
puts '## Community Shout-Outs'
54+
puts
55+
puts 'We want to thank the following Deis community members for creating GitHub issues, providing support to others, and working on various Deis branches:'
56+
puts
57+
contributors.sort_by {|k,v| k.downcase}.map do |author, titles|
58+
puts "- @#{author}: #{titles.join(", ")}"
59+
end
60+
puts
61+
puts "The Deis community continues to grow, and Deis wouldn't be here without you! If we slighted your contribution to this release, please let us know so we can update."
62+
puts

0 commit comments

Comments
 (0)