fix release notes for final releases

We want release announcements for final releases, after release
candidates, to include all of the changes from the release. In a perfect
world, the tag history of the releases would be such that we could ask
git for the previous release. Unfortunately, the tag for the final
release from the previous series is not on the same branch where we are
tagging the final of the new release. It used to be merged in, but at
the wrong point. Now it isn't even being merged in.

Rather than trying to deduce the right start point in the announce
script, this change makes it an optional piece of the tag metadata. When
present, the diff-start value is used. When not present, the old
behavior of using the previous tag is retained.

Given our practice of creating new stable branches on the first release
candidate tag, we can also update propose-final-releases to
automatically set the diff-start value for new final releases to point
to the first release candidate of the last release series. If that
automatic value is wrong, it can be adjusted manually before the final
tags are applied.

See related work in I4dff3a57f4d0c8f625e789ec19683c47983b7877

Depends-On: I4dff3a57f4d0c8f625e789ec19683c47983b7877
Depends-On: If56bf1471659f8a27edbed840a880ac998e6759a
Change-Id: I79c3ff7cc07300af5336a0e9f232f8802d4b4c4a
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2016-08-08 14:17:32 -04:00
parent 13121d0d60
commit 7b38e4ba13
2 changed files with 21 additions and 2 deletions

View File

@ -107,6 +107,14 @@ function get_tag_meta {
echo "$TAG_META" | grep "^meta:$fieldname:" | cut -f2 -d' '
}
# How far back should we look for release info? If there is no
# explicit metadata (signaled by passing "-"), use whatever previous
# version number we were able to detect.
DIFF_START=$(get_tag_meta diff-start)
if [[ "$DIFF_START" == "-" ]]; then
DIFF_START="$PREVIOUS_VERSION"
fi
# The series name is part of the commit message left by release.sh.
SERIES=$(get_tag_meta series)
@ -148,7 +156,7 @@ if [[ "$INCLUDE_PYPI_LINK" == "yes" ]]; then
include_pypi_link="--include-pypi-link"
fi
echo "$PREVIOUS_VERSION to $VERSION on $SERIES"
echo "$DIFF_START to $VERSION on $SERIES"
relnotes_file="$RELNOTESDIR/$SHORTNAME-$VERSION"
@ -159,7 +167,7 @@ release-notes \
--series $SERIES \
$stable \
$first_release \
. "$PREVIOUS_VERSION" "$VERSION" \
. "$DIFF_START" "$VERSION" \
$include_pypi_link \
| tee $relnotes_file

View File

@ -28,11 +28,19 @@ PROJECT_TEMPLATE = '''\
VERSION_TEMPLATE = '''\
- version: {version}
diff-start: {diff_start}
projects:
{projects}
'''
def get_prior_branch_point(version):
"Assuming we always branch on the rc1 tag..."
parts = version.split('.')
prior = int(parts[0]) - 1
return '{}.0.0.0rc1'.format(prior)
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
@ -88,8 +96,10 @@ def main():
print('# not a release candidate')
continue
new_version = latest_release['version'].split('.0rc')[0]
diff_start = get_prior_branch_point(new_version)
deliverable_data['releases'].append({
'version': new_version,
'diff_start': diff_start,
'projects': latest_release['projects'],
})
print('new version for {}: {}'.format(os.path.basename(filename),
@ -101,6 +111,7 @@ def main():
for p in latest_release['projects'])
new_block = VERSION_TEMPLATE.format(
version=new_version,
diff_start=diff_start,
projects=projects,
).rstrip() + '\n'
with open(filename, 'a') as f: