Skip to content

Instantly share code, notes, and snippets.

@amercader
Last active May 9, 2018 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amercader/4ec55774b9a625e815bf to your computer and use it in GitHub Desktop.
Save amercader/4ec55774b9a625e815bf to your computer and use it in GitHub Desktop.
CKAN Changelog helpers

This is the process I use to get issues that have been actually merged between CKAN releases.

This assumes that the release branch has been created.

  1. Run the following to obtain an issues_2.3.txt file with the issue number of all issues that have been merged between releases:

    git log --pretty=format:%s --reverse --no-merges dev-v2.7...dev-v2.8 | grep -Po "^\[#\K[0-9]+(?=^\])?" | sort -u -n > issues_2.8.txt
    
  2. Use issues_github.py to obtain an issues_2.3_title.txt file with the actual issues title (You'll need to add a GitHub API token):

    python issues_github.py > issues_2.8_title.txt

  3. Manually triage issues into the "Major", "Minor" and "Bug fixes" sections (or discard if not relevant enough) of the CHANGELOG file

291
655
781
790
809
832
847
912
1022
1188
1193
1251
1278
...
Select boxes with autocomplete are clearing their placeholders (#1278)
More template blocks to allow for easier extension maintenance (#1301)
CKAN API - remove help string from standard calls (#1318)
Hide activity by selected users on activity stream (#1330)
Documentation and clarification about "CKAN Flavored Markdown" (#1332)
Resource formats are now guessed automatically (#1350)
Default search ordering on organization home page is broken (#1368)
New JavaScript modules tutorial (#1377)
related_list logic function throws a 503 without any parameters (#1384)
Exception on group dictize due to 'with_capacity' on context (#1390)
Wrong template on Add member page (#1392)
Overflowing email address on user page (#1398)
Allow overriding dataset, group, org validation (#1400)
...
import requests
TOKEN = 'YOUR_GITHUB_API_TOKEN_HERE'
ISSUES_LIST = 'issues_2.3.txt'
url = 'https://api.github.com/repos/ckan/ckan/issues/{0}'
headers = {
'Authorization': 'token {0}'.format(TOKEN)
}
with open(ISSUES_LIST, 'r') as f:
for issue_number in f:
r = requests.get(url.format(issue_number), headers=headers)
issue = r.json()
line = '{0} (#{1})'.format(issue['title'].encode('utf8'),
issue['number'])
print line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment