9
9
10
10
11
11
def get_config ():
12
- with open ('./changelog_conf.yaml' ) as stream :
12
+ filepath = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , 'config/changelog_conf.yaml' ))
13
+ with open (filepath ) as stream :
13
14
try :
14
15
config_yaml = yaml .safe_load (stream )
15
16
return config_yaml
@@ -21,7 +22,8 @@ def get_issue_structure(version, config):
21
22
projects = '("SERVER", "TOOLS", "WiredTiger")'
22
23
23
24
oauth_dict = {}
24
- with open ('./.mongodb-jira.yaml' ) as stream :
25
+ credentialPath = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , 'changelogs/.mongodb-jira.yaml' ))
26
+ with open (credentialPath ) as stream :
25
27
try :
26
28
jira_yaml = yaml .safe_load (stream )
27
29
oauth_dict = jira_yaml .get ('jira' )
@@ -35,11 +37,13 @@ def get_issue_structure(version, config):
35
37
# Run the JIRA query
36
38
query = "project in {0} and fixVersion = {1} and resolution = 'Fixed' ORDER BY key ASC" .format (
37
39
projects , version )
38
- print (query + '\n ' )
39
40
issues = auth_jira .search_issues (query , maxResults = 200 )
40
41
logger .info ("building changelog for {0} with {1} issue(s)" .format (
41
42
version , len (issues )))
42
43
44
+ print ("building changelog for {0} with {1} issue(s)" .format (
45
+ version , len (issues )))
46
+
43
47
# setup container of heading groups using the defined ordering.
44
48
headings = collections .OrderedDict ()
45
49
for k in config .get ('ordering' ):
@@ -54,7 +58,6 @@ def get_issue_structure(version, config):
54
58
# run through all issues, and put each one in the headings structure at the
55
59
# best place
56
60
for issue in issues :
57
- print (issue )
58
61
components = []
59
62
for c in issue .fields .components :
60
63
components .append (c .name )
@@ -166,15 +169,16 @@ def get_changelog_content():
166
169
r .newline ()
167
170
168
171
# Output the rst to source/includes/changelogs/releases
169
- cwd = os .getcwd ()
170
- sourceDir = os .path .dirname (cwd )
172
+ sourceDir = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' ))
171
173
fn = fixVersion + ".rst"
172
174
outputDir = os .path .join (
173
175
sourceDir , "source/includes/changelogs/releases" , fn )
174
176
r .write (outputDir )
175
- print (outputDir )
176
177
logger .info (
177
178
"wrote changelog '{0}'. Commit this file independently." .format (outputDir ))
178
179
180
+ print ("wrote changelog '{0}'. Commit this file independently." .format (outputDir ))
181
+
182
+
179
183
# main function
180
184
get_changelog_content ()
0 commit comments