Skip to content

Commit bfb011c

Browse files
jeff-allen-mongokay-kim
authored andcommitted
Fixups to changelog generation
1 parent 3b90ec3 commit bfb011c

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ primer/source/includes/*.cs
8787
primer/source/includes/table-linux-kernel-version-production.yaml
8888
venv
8989
.vscode
90+
changelogs/.mongodb-jira.yaml

changelogs/generatechangelogs.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010

1111
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:
1314
try:
1415
config_yaml = yaml.safe_load(stream)
1516
return config_yaml
@@ -21,7 +22,8 @@ def get_issue_structure(version, config):
2122
projects = '("SERVER", "TOOLS", "WiredTiger")'
2223

2324
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:
2527
try:
2628
jira_yaml = yaml.safe_load(stream)
2729
oauth_dict = jira_yaml.get('jira')
@@ -35,11 +37,13 @@ def get_issue_structure(version, config):
3537
# Run the JIRA query
3638
query = "project in {0} and fixVersion = {1} and resolution = 'Fixed' ORDER BY key ASC".format(
3739
projects, version)
38-
print(query + '\n')
3940
issues = auth_jira.search_issues(query, maxResults=200)
4041
logger.info("building changelog for {0} with {1} issue(s)".format(
4142
version, len(issues)))
4243

44+
print("building changelog for {0} with {1} issue(s)".format(
45+
version, len(issues)))
46+
4347
# setup container of heading groups using the defined ordering.
4448
headings = collections.OrderedDict()
4549
for k in config.get('ordering'):
@@ -54,7 +58,6 @@ def get_issue_structure(version, config):
5458
# run through all issues, and put each one in the headings structure at the
5559
# best place
5660
for issue in issues:
57-
print(issue)
5861
components = []
5962
for c in issue.fields.components:
6063
components.append(c.name)
@@ -166,15 +169,16 @@ def get_changelog_content():
166169
r.newline()
167170

168171
# 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__), '..'))
171173
fn = fixVersion + ".rst"
172174
outputDir = os.path.join(
173175
sourceDir, "source/includes/changelogs/releases", fn)
174176
r.write(outputDir)
175-
print(outputDir)
176177
logger.info(
177178
"wrote changelog '{0}'. Commit this file independently.".format(outputDir))
178179

180+
print("wrote changelog '{0}'. Commit this file independently.".format(outputDir))
181+
182+
179183
# main function
180184
get_changelog_content()
File renamed without changes.

0 commit comments

Comments
 (0)