Skip to content

Fixups to changelog generation #3728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ primer/source/includes/*.cs
primer/source/includes/table-linux-kernel-version-production.yaml
venv
.vscode
changelogs/.mongodb-jira.yaml
18 changes: 11 additions & 7 deletions changelogs/generatechangelogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@


def get_config():
with open('./changelog_conf.yaml') as stream:
filepath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'config/changelog_conf.yaml'))
with open(filepath) as stream:
try:
config_yaml = yaml.safe_load(stream)
return config_yaml
Expand All @@ -21,7 +22,8 @@ def get_issue_structure(version, config):
projects = '("SERVER", "TOOLS", "WiredTiger")'

oauth_dict = {}
with open('./.mongodb-jira.yaml') as stream:
credentialPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'changelogs/.mongodb-jira.yaml'))
with open(credentialPath) as stream:
try:
jira_yaml = yaml.safe_load(stream)
oauth_dict = jira_yaml.get('jira')
Expand All @@ -35,11 +37,13 @@ def get_issue_structure(version, config):
# Run the JIRA query
query = "project in {0} and fixVersion = {1} and resolution = 'Fixed' ORDER BY key ASC".format(
projects, version)
print(query + '\n')
issues = auth_jira.search_issues(query, maxResults=200)
logger.info("building changelog for {0} with {1} issue(s)".format(
version, len(issues)))

print("building changelog for {0} with {1} issue(s)".format(
version, len(issues)))

# setup container of heading groups using the defined ordering.
headings = collections.OrderedDict()
for k in config.get('ordering'):
Expand All @@ -54,7 +58,6 @@ def get_issue_structure(version, config):
# run through all issues, and put each one in the headings structure at the
# best place
for issue in issues:
print(issue)
components = []
for c in issue.fields.components:
components.append(c.name)
Expand Down Expand Up @@ -166,15 +169,16 @@ def get_changelog_content():
r.newline()

# Output the rst to source/includes/changelogs/releases
cwd = os.getcwd()
sourceDir = os.path.dirname(cwd)
sourceDir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
fn = fixVersion + ".rst"
outputDir = os.path.join(
sourceDir, "source/includes/changelogs/releases", fn)
r.write(outputDir)
print(outputDir)
logger.info(
"wrote changelog '{0}'. Commit this file independently.".format(outputDir))

print("wrote changelog '{0}'. Commit this file independently.".format(outputDir))


# main function
get_changelog_content()
File renamed without changes.