You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2017/07/17 11:35:34 UTC

svn commit: r1802130 - in /subversion/trunk/tools/dist: release.py templates/rc-release-ann.ezt templates/stable-release-ann.ezt

Author: danielsh
Date: Mon Jul 17 11:35:34 2017
New Revision: 1802130

URL: http://svn.apache.org/viewvc?rev=1802130&view=rev
Log:
release.py: Add details to email announcements.

* tools/dist/templates/rc-announce-ann.ezt,
* tools/dist/templates/stable-announce-ann.ezt:
    Say "This is a feature/security/bugfix release"
    and "Subversion is an open-source version control system" [quoted
    from our homepage] to make the announcements self-contained for
    readers of announce_at_apache.org and other aggregators.

* tools/dist/release.py
  (): Tell Python this file is UTF-8 encoded, because there is a UTF-8 comment.
  (ezt_False, ezt_True, ezt_bool): New.
  (write_announcement): Pass two new parameters, 'security' and 'dot-zero',
    to the ezt templates.
  (main): New --security option to write-announcement.

Suggested by: sebb 

Apologies to: gstein
(for that ezt API workaround)

Modified:
    subversion/trunk/tools/dist/release.py
    subversion/trunk/tools/dist/templates/rc-release-ann.ezt
    subversion/trunk/tools/dist/templates/stable-release-ann.ezt

Modified: subversion/trunk/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1802130&r1=1802129&r2=1802130&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Mon Jul 17 11:35:34 2017
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#
+# python: coding=utf-8
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -268,6 +268,20 @@ def download_file(url, target, checksum)
                            (target, checksum, checksum2))
 
 #----------------------------------------------------------------------
+# ezt helpers
+
+# In ezt, «[if-any foo]» is true when «data['foo'] == False»,
+# hence, provide this constant for readability.
+ezt_False = ""
+
+# And this constant for symmetry.
+ezt_True = True
+
+# And this for convenience.
+def ezt_bool(boolean_value):
+    return ezt_True if boolean_value else ezt_False
+
+#----------------------------------------------------------------------
 # Cleaning up the environment
 
 def cleanup(args):
@@ -803,8 +817,19 @@ def write_announcement(args):
     if args.version.is_prerelease():
         template_filename = 'rc-release-ann.ezt'
     else:
+        data['dot-zero'] = ezt_bool(args.version.patch == 0)
+        # TODO: instead of requiring the RM to remember to pass --security,
+        #   read the private repository where CVE announcements are staged,
+        #   parse the json file that identifies which versions are affected,
+        #   and accordingly automagically set data['security'].
+        data['security'] = ezt_bool(args.security)
         template_filename = 'stable-release-ann.ezt'
 
+        # The template text assumes these two are mutually exclusive.
+        # If you ever find a reason to make a x.y.0 release with a security
+        # bug, just comment this out and update the template before sending.
+        assert not (data['dot-zero'] and data['security'])
+
     template = ezt.Template(compress_whitespace = False)
     template.parse(get_tmplfile(template_filename).read())
     template.generate(sys.stdout, data)
@@ -1077,6 +1102,9 @@ def main():
                     help='''Output to stdout template text for the emailed
                             release announcement.''')
     subparser.set_defaults(func=write_announcement)
+    subparser.add_argument('--security', action='store_true', default=False,
+                    help='''The release being announced includes security
+                            fixes.''')
     subparser.add_argument('--target',
                     help='''The full path to the directory containing
                             release artifacts.''')

Modified: subversion/trunk/tools/dist/templates/rc-release-ann.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/templates/rc-release-ann.ezt?rev=1802130&r1=1802129&r2=1802130&view=diff
==============================================================================
--- subversion/trunk/tools/dist/templates/rc-release-ann.ezt (original)
+++ subversion/trunk/tools/dist/templates/rc-release-ann.ezt Mon Jul 17 11:35:34 2017
@@ -26,9 +26,10 @@ PGP Signatures are available at:
 For this release, the following people have provided PGP signatures:
 
 [siginfo]
-This is a pre-release for what will eventually become Apache Subversion
-[major-minor-patch].  It may contain known issues, a complete list of
-[major-minor-patch]-blocking issues can be found here:
+This is a pre-release for what will eventually become version [major-minor-patch] of the
+Apache Subversion open source version control system.  It may contain known
+issues, a complete list of [major-minor-patch]-blocking issues can be found
+here:
 
     http://subversion.tigris.org/issues/buglist.cgi?component=subversion&issue_status=NEW&issue_status=STARTED&issue_status=REOPENED&target_milestone=[major-minor-patch]
 

Modified: subversion/trunk/tools/dist/templates/stable-release-ann.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/templates/stable-release-ann.ezt?rev=1802130&r1=1802129&r2=1802130&view=diff
==============================================================================
--- subversion/trunk/tools/dist/templates/stable-release-ann.ezt (original)
+++ subversion/trunk/tools/dist/templates/stable-release-ann.ezt Mon Jul 17 11:35:34 2017
@@ -1,17 +1,23 @@
 From: ...@apache.org
 To: announce@subversion.apache.org, users@subversion.apache.org, dev@subversion.apache.org, announce@apache.org
-Subject: [[]ANNOUNCE] Apache Subversion [version] released
-
-From: ...@apache.org
-To: announce@subversion.apache.org, users@subversion.apache.org, dev@subversion.apache.org, announce@apache.org
-Cc: security@apache.org
-Subject: [[]SECURITY][[]ANNOUNCE] Apache Subversion [version] released
-
+[if-any security]Cc: security@apache.org
+[end][if-any security]Subject: [[]SECURITY][[]ANNOUNCE] Apache Subversion [version] released
+[else]Subject: [[]ANNOUNCE] Apache Subversion [version] released
+[end]
 I'm happy to announce the release of Apache Subversion [version].
 Please choose the mirror closest to you by visiting:
 
     http://subversion.apache.org/download.cgi#[anchor]
-
+[if-any dot-zero]
+This is a stable feature release of the Apache Subversion open source
+version control system.
+[else][if-any security]
+This is a stable bugfix and security release of the Apache Subversion
+open source version control system.
+[else]
+This is a stable bugfix release of the Apache Subversion open source
+version control system.
+[end][end]
 The SHA1 checksums are:
 
 [for sha1info]    [sha1info.sha1] [sha1info.filename]