Fix changelog generation for non-default versions
Currently if you generate a changelog for r0.1.1 of an API, you'd get "No significant changes" which is wrong. You should get a real changelog for the version. This is now handled by generating a "preferred" changelog which acts as the default for version variables in the RST. Using a specific version's changelog is still supported for the rare cases where that is desired.
This commit is contained in:
parent
baf00ba6d1
commit
54ee861b5f
2 changed files with 14 additions and 2 deletions
|
@ -903,9 +903,17 @@ class MatrixUnits(Units):
|
|||
|
||||
return schema
|
||||
|
||||
def load_changelogs(self):
|
||||
def load_changelogs(self, substitutions):
|
||||
changelogs = {}
|
||||
|
||||
preferred_versions = {
|
||||
"server_server": substitutions.get("%SERVER_RELEASE_LABEL%", "unstable"),
|
||||
"client_server": substitutions.get("%CLIENT_RELEASE_LABEL%", "unstable"),
|
||||
"identity_service": substitutions.get("%IDENTITY_RELEASE_LABEL%", "unstable"),
|
||||
"push_gateway": substitutions.get("%PUSH_GATEWAY_RELEASE_LABEL%", "unstable"),
|
||||
"application_service": substitutions.get("%APPSERVICE_RELEASE_LABEL%", "unstable"),
|
||||
}
|
||||
|
||||
# Changelog generation is a bit complicated. We rely on towncrier to
|
||||
# generate the unstable/current changelog, but otherwise use the RST
|
||||
# edition to record historical changelogs. This is done by prepending
|
||||
|
@ -1007,6 +1015,10 @@ class MatrixUnits(Units):
|
|||
title_part = keyword_versions[title_part]
|
||||
changelog = "".join(changelog_lines)
|
||||
changelogs[name][title_part.replace("^[a-zA-Z0-9]", "_").lower()] = changelog
|
||||
preferred_changelog = changelogs[name]["unstable"]
|
||||
if name in preferred_versions:
|
||||
preferred_changelog = changelogs[name][preferred_versions[name]]
|
||||
changelogs[name]["preferred"] = preferred_changelog
|
||||
|
||||
return changelogs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue