Releasing Breezy
################

This document describes the processes for making and announcing a Breezy
release, and managing the release process.  This is just one phase of the
`overall development cycle
<https://www.breezy-vcs.org/developers/cycle.html>`_, (go re-read this
document to ensure it hasn't been updated since you last read it) but it's
the most complex part.

If you're doing your first release you can follow this document and read
each step explanation. It's also a good practice to read it for any release
to ensure you don't miss a step and to update it as the release process
evolves.

If you're helping the Release Manager (RM) for one reason or another, you
may notice that he didn't follow that document scrupulously. He may have
good reasons to do that but he may also have missed some parts.

.. contents::


Preconditions
=============

#. Be a member of https://launchpad.net/~brz (or you won't be able to land
   any change)

What do we release
==================

In this document, we're talking about source releases only, packages and
installers are built from this but we won't talk about them here.

Every release is part of a series, ``brz-3.0.0`` is part of series ``3.0``.

We do two different kind of releases: the betas releases and the stable
releases for a given series.

For a given series, releases will be done to deliver new versions of brz to
different kinds of users:

#. beta releases: named ``x.ybn`` where ``x.y`` is the series and ``n``
   starts at 1 and is incremented. These releases are targeted to beta
   testers who don't want to run from source but are interested in features
   or improvements.

#. stable releases: name ``x.y.z`` where ``x.y.`` is the series and ``z``
   starts at 0 and is incremented. These releases are targeted at people
   that want bugfixes only and no new features.


Differences in the release process between beta and stable release will be
mentioned when needed.

When do we release ?
====================

As of May 2020, we maintain a two series: 3.1 and trunk (3.2).

#. as much as possible releases should not disturb development, and
   ongoing development should not disturb releases,

#. the most recent development series should release once a month during
   the beta period (see `Development cycles <cycle.html>`_ for more
   details),

#. the most recent stable series should release every other month (based
   on the amount of bug fixes, this can be shorter or longer depending on
   the bugs importance),

#. previous series should release on a regular basis without interfering
   with the most recent series with a decreasing order of priority (again
   this should be based on bugs importance and user feedback),

#. the death of a series should be planned ahead of time. 6 months should
   give enough time to our users to migrate to a more recent series. This
   doesn't mean we will make a release at the end of the series, just that
   before the end date we *could* possibly put out another release if
   there was a sufficiently important fix.  Beyond that date, we won't
   even land changes on that branch (unless something causes a miraculous
   resurrection.)

#. there should not be more than 2 releases in the same week (but the
   Release Manager is free to ignore this (get in touch with packagers
   though),

At the start of a series cycle
==============================

To start a new series cycle:

#. Create a new series ``x.y`` at <https://launchpad.net/brz/+addseries>.

#. Add milestones at <https://launchpad.net/brz/x.y/+addmilestone> to that
   series for the beta releases and the stable series mentioning their
   expected dates. Only the milestone associated to the next release in
   this series should be left active to avoid clutter when targeting bugs.

#. If you made a new series, you will need to create a new branch for this
   release series. This branch will be used only from the first non-beta
   release onwards. It needs to be created by a https://launchpad.net/~brz
   member (ask the core devs for instructions or to do it for you).

#. Start a new release-notes file::

       cd doc/en/release-notes
       cp series-template.txt brz-x.y.txt  # e.g. brz-3.1.txt
       brz add brz-3.1.txt

#. Start a new whats-new file::

       cd doc/en/whats-new
       cp template.txt brz-x.y.txt  # e.g. brz-3.1.txt
       brz add brz-x.y.txt

#. Update ``doc/en/index.txt`` to point to the new whats-new file.

At the start of a release cycle
===============================

To start a new release cycle:

#. Send mail to the list with the key dates, who will be the release
   manager, and the main themes or targeted bugs.  Ask people to nominate
   objectives, or point out any high-risk things that are best done early,
   or that interact with other changes. This is called the metronome mail
   and is described in `Development cycles <cycle.html>`_.

#. Make a local branch to prepare the release::

        brz branch lp:brz/x.y x.y-dev

   If you're doing your first beta release, branch from trunk::

       brz branch lp:brz x.y-dev

   Note that you will generally reuse the same branch for all releases in a
   given series.

#. Add a landing job for the release branch at https://ci.breezy-vcs.org/

#. Update the version number in the ``brz`` script, and the
   ``breezy/__init__.py`` file::
   
       version_info = (x, y, z, 'dev', 0)
   
#. Add a new section at the top of the current release notes (in
   ``doc/en/release-notes``) about the new release, including its version
   number and the headings from ``release-template.txt``.

#. Update the "What's New" documents in ``doc/en/whats-new``.

#. Make sure a milestone exists for your release and that it is active,
   <https://launchpad.net/brz/x.y> lists the existing milestones,
   <https://launchpad.net/brz/x.y/x.y.z/+edit> allows you to toggle the
   active flag.

#. Commit this and make a proposal against the release branch. Self approve
   it (you're the release manager).


Doing a particular release
==========================

alpha releases
--------------

3.0.0 will start to be released as alpha as integrating plugins and porting
to python3 (while maintaining python2 compatiblity) desserve to be testing
in the wild by people understanding the risks.

That being said, the whole test suite has been preserved and enriched in the
process.

Alpha releases will happen as source only (tarballs) and the process is
simplified.

Note that the intent is to come back to beta releases as soon as possible so
the alpha releases won't happen again.

The process for releasing an alpha release is therefore:
- upload a tarball to launchpad,
- upload a tarball to pypi,
- mail bazaar@lists.ubuntu.com,
- post an announcement on the home page.  

Uploading tarballs are described below, just use alpha versions (3, 0, 0,
'alpha', 1) in ``./breezy/__init__.py``

Update the source code
----------------------

#. Check that there is a milestone for the release you're doing. If there
   is no milestone it indicates a process problem - make the milestone but
   also mail the list to raise this issue in our process. Milestones are
   found at <https://launchpad.net/brz/+milestone/x.y.z>.

#. Merge into your branch all previous stable series fixes that haven't been
   merged yet. For example, if you're releasing 3.2.x, make sure the fixes
   on 3.1, 3.0 have already been merged up::

     brz merge lp:brz/3.1

   and commit that merge in its own commit. This should happen only if the
   devs landing changes in previous releases forgot to merge them up. Since
   this can slow down the freeze, feel free to gently remind them about
   their duties ;) If you feel unsafe resolving the conflicts or it's too
   time consuming, contact the related devs and skip this merge.
     
   Alternatively, think about automating these merges.
    
#. In the release branch, update  ``version_info`` in ``./breezy/__init__.py``.
   Make sure the corresponding milestone exists.
   Double check that ./brz ``_script_version`` matches ``version_info``. Check
   the output of ``./brz --version``.

   For beta releases use::

       version_info = (3, 0, 0, 'beta', SERIAL)

   For instance 3.0b1::

       version_info = (3, 0, 0, 'beta', 1)

   For stable releases use::

       version_info = (3, 0, 0, 'final', 0)

#. Update the ``./doc/en/release-notes/`` section for this release.

   Check that all news entries related to this release have been added in
   the right section. For example, if you're releasing 3.0b3, the following
   command should display a a single chuk diff for the 3.0b3 release::

     brz diff -rbrz-3.0b2.. doc/en/release-notes/brz-3.0.txt

   Fill out the date and a description of the release under the existing
   header (the diff above will help you summarizing). If there isn't one,
   follow the instructions above for using the ``release-template.txt`` file
   and remind people that they should document their changes there ;)

   See *3.0b1* or similar for an example of what this looks like.

#. Add or check the summary of the release into the "What's New" document.

  If this is the first release in a new series make sure to update the
  introduction mentioning:

  * the date of this first release,
  * until when the series is expected to be supported.

  Looking at ``brz annotate`` for previous series should give you the right
  hints. The ``doc/en/_templates/index.html`` file should also be updated.

#. To check that all bugs mentioned in the release notes are actually
   marked as closed in Launchpad, you can run
   ``tools/check-newsbugs.py``::

     ./tools/check-newsbugs.py doc/en/release-notes/brz-x.y.txt

   As of 2011-07-18, all bugs mentioned in the output of the script requires
   some sort of intervention (either changing the status if it's not 'Fix
   Released' or setting a different milestone if the bug hasn't been
   fixed). A few false positives may remain in the older series, don't let
   this slow you down too much. This script accepts options you may find
   useful, use ``./tools/check-newsbugs.py`` to display its usage (``-w``
   will open each bug in your browser for example).

#. For beta releases update the translation template::

     BRZ_PLUGIN_PATH=-site make po/brz.pot

   This is especially important for the final beta release which is when
   translations are frozen and translators are requested (see `The final
   beta - branching and translations`_) to make the translations.

#. For stable releases update the translations::

     brz merge lp:~brz-core/brz/brz-translations-export-x.y

#. Commit these changes to the release branch, using a command like::

     brz commit -m "Release 3.0.0"

   The diff before you commit will be something like::

      === modified file 'breezy/__init__.py'
      --- breezy/__init__.py	2011-02-09 06:35:00 +0000
      +++ breezy/__init__.py	2011-03-10 10:24:47 +0000
      @@ -52,7 +52,7 @@
       # Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
       # releaselevel of 'dev' for unreleased under-development code.
       
      -version_info = (2, 3, 1, 'dev', 0)
      +version_info = (2, 3, 1, 'final', 0)
       
       # API compatibility version
       api_minimum_version = (2, 3, 0)
      
      === modified file 'doc/en/release-notes/brz-2.3.txt'
      --- doc/en/release-notes/brz-2.3.txt	2011-03-09 08:30:16 +0000
      +++ doc/en/release-notes/brz-2.3.txt	2011-03-10 10:40:47 +0000
      @@ -8,23 +8,10 @@
       brz 2.3.1
       #########
       
      -:2.3.1: NOT RELEASED YET
      -
      -External Compatibility Breaks
      -*****************************
      -
      -.. These may require users to change the way they use Breezy.
      -
      -New Features
      -************
      -
      -.. New commands, options, etc that users may wish to try out.
      -
      -Improvements
      -************
      -
      -.. Improvements to existing commands, especially improved performance 
      -   or memory usage, or better results.
      +:2.3.1: 2011-03-10
      +
      +This is a bugfix release. Upgrading is recommended for all users of earlier
      +2.3 releases.
       
       Bug Fixes
       *********
      
      === modified file 'doc/en/whats-new/whats-new-in-2.3.txt'
      --- doc/en/whats-new/whats-new-in-2.3.txt	2011-02-03 16:29:18 +0000
      +++ doc/en/whats-new/whats-new-in-2.3.txt	2011-03-10 11:10:36 +0000
      @@ -17,8 +17,13 @@
       improvements made to the core product, it highlights enhancements within the
       broader Breezy world of potential interest to those upgrading.
       
      -Breezy 2.3.0 is fully compatible both locally and on the network with 2.0 2.1,
      -and 2.2, and can read and write repositories generated by all previous
      +Breezy 2.3.1 includes all the fixes in the un-released 2.0.7, 2.1.4 and 2.2.5
      +versions that weren't included in 2.3.0 and fixes some bugs on its own.
      +
      +See the :doc:`../release-notes/index` for details.
      +
      +Breezy 2.3 is fully compatible both locally and on the network with 2.0, 2.1,
      +and 2.2. It can read and write repositories generated by all previous
       versions.
       
       Changed Behaviour
      

#. Tag the new release::

     brz tag brz-3.0.0

#. Push those changes to a brz branch and make a merge proposal::

     brz push

   Use a commit message formatted like::
  
     Release 3.0.0

   Note that ``brz push`` should mention updating one tag (which you just
   created). If it doesn't, double-check that you created (and pushed) this
   tag.

#. Once the merge proposal has landed, pull down the master release branch.


Making the source tarball
-------------------------

#. Change into the source directory and run ::

     make dist

#. Now we'll try expanding this tarball and running the test suite
   to check for packaging problems::

     make check-dist-tarball | subunit2pyunit

   You may encounter failures while running the test suite caused by your
   locally installed plugins. Use your own judgment to decide if you can
   release with these failures. When in doubt, disable the faulty plugins
   one by one until you get no more failures. Alternatively, you can use
   ``BRZ_DISABLE_PLUGINS`` or ``BRZ_PLUGIN_PATH=-site`` to disable one or
   all plugins.

   Remember that this branch has already been tested on
   https://ci.breezy-vcs.org, this step is particularly testing that the
   cython extensions, which are updated by your local cython version when
   you run make dist, are in good shape.


Publishing the source tarball
-----------------------------

#. Go to the relevant <https://launchpad.net/brz/x.y> series page in Launchpad.

#. Create a release of the milestone, and upload the source tarball and
   the GPG signature.  Or, if you prefer, use the
   ``tools/packaging/lp-upload-release`` script to do this. Note that
   this changes what the download widget on the Launchpad brz home
   page shows, so don't stop the release process yet, or platform binary
   installers won't be made and the download list will stay very small!
   <https://bugs.launchpad.net/launchpad/+bug/586445>


Kick off the next cycle
-----------------------

From that point, there is no possible return, the tarball has been uploaded
so you can relax a bit.

You're still holding a "social" lock on the launchpad branch though. Until
your start the next cycle, nobody should land anything on this branch. If
they do, they either targeted the wrong branch or didn't update the news
file correctly, so the sooner the branch is opened again, the better.

This matters more for ``lp:brz`` than for ``lp:brz/x.y``, ``lp:brz`` should
always be open for landing, so you should do `At the start of a release
cycle`_ as soon as possible (i.e. update the version number in ``brz`` and
``breezy/__init__``, create/update the news files and create/update the
milestone for the next relase).

You may also need to do `At the start of a series cycle`_ if you're starting
a new series.

The final beta - branching and translations
-------------------------------------------

A word of caution: the instructions above works well for all releases but
there is one special case that requires a bit more care: when you release
the *last* beta for a given ``x.y`` series (from trunk aka lp:brz), you need
to setup *two* branches for the next cycle:

#. ``lp:brz`` needs to be opened for the next *series* ``x.(y+1)``.

#. ``lp:brz/x.y`` needs to be opened for the next *release* ``x.y.0`` in the
   series. Since this is first real use of ``lp:brz/x.y``, this is also the
   deadline for the https://ci.breezy-vcs.org/ landing job to be created.

Both are important as ``lp:brz`` should remain open so any change can be
landed, ``lp:brz/x.y`` on the other hand should be ready to receive bug
fixes.

``lp:brz`` is generally more important as the bug fixes on ``lp:brz/x.y``
won't be released sooner than a month from now whereas people may already
been waiting to land on ``lp:brz``.

In a nutshell:

#. Open ``lp:brz`` for ``x.(y+1)``

#. Create https://ci.breezy-vcs.org/ landing job and/or update the
   ``lp:brz/x.y`` branch based on whatever revision you want to release.

#. Release ``x.y.0`` from ``lp:brz/x.y``

#. Open ``lp:brz/x.y`` for bug fixes

You also need to ensure Launchpad is set up to import/export translations
for the new branch and inform translators.

#. Push the last beta release to a new branch::

     brz push lp:~brz-core/brz/brz-translations-export-x.y

#. On the translations series synchronization settings page
   <https://translations.launchpad.net/brz/x.y/+translations-settings>
   turn on ``Import template files`` then for exports click ``Choose a
   target branch`` and point it at the branch you just pushed.

#. E-mail translators to announce that the forthcoming stable release of brz
   is ready for translations.  Send to
   ``launchpad-translators@lists.launchpad.net`` and
   ``ubuntu-translators@lists.ubuntu.com``.

#. The series is now frozen for strings and API, see below for adding
   that to the announcement.

Announcing the source freeze
----------------------------

#. Post to the ``bazaar@lists.ubuntu.com`` list and
   ``breezy-vcs@googlegroups.com`` , saying that the source has been
   frozen. Be extra clear that this is only a *source* release targeted at
   packagers and installer builders (see
   <https://bugs.launchpad.net/launchpad/+bug/645084>).  This is the cue for
   platform maintainers and plugin authors to update their code.  This is
   done before the general public announcement of the release.

   The freeze announcement generally guess the date of the official public
   announcement, for the most recent stable series (the one supported by the
   installers and most of the distributions) it's generally a few days after
   the freeze. For older series supported only via SRUs for Ubuntu, we don't
   control the process as tightly so guessing the date is not appropriate.

   For the final beta release include in your announcement a notice of
   API and translation freezes noting that public methods should not
   be removed or changed and strings should not be added or changed.

#. Pause for a few days. 


Publishing the release
----------------------

There is normally a delay of a few days after the source freeze to allow
for binaries to be built for various platforms. Once they have been built,
we have a releasable product.  The next step is to make it generally
available to the world.

#. Go to the release web page at <https://launchpad.net/brz/x.y/x.y.z>

#. Announce on the Breezy website.

#. Check that the documentation for this release is available in
   <https://www.breezy-vcs.org/doc/en/>.  It should be automatically build when
   the branch is created, by a cron script ``update-brz-docs`` on
   ``escudero``. When the first release is created in a new series, a branch
   needs to be created on ``escudero``::

     ssh escudero.canonical.com
     sudo -u brz-web -s
     cd /srv/doc.bazaar.canonical.com/
     brz branch lp:brz/2.7 brz/brz.2.7

   And the ``brz/bin/update-brz-docs`` script needs to refer to it.

   The ``lp:brz-alldocs`` branch also needs to be updated when a new series
   is introduced, see the ``README`` file there for more instructions
   (looking at the branch history is also a good way to understand what
   needs to be done and to document any policy changes).

Announcing the release
----------------------

Now that the release is publicly available, tell people about it.

#. Make an announcement mail.

   For beta releases, this is sent to the ``bazaar@lists.ubuntu.com`` and
   ``bazaar-announce@lists.ubuntu.com`` lists.

   For stable releases (excluding SRUs which are for older stable releases),
   it should also be cc'd to ``info-gnu@gnu.org``,
   ``python-announce-list@python.org``, ``bug-directory@gnu.org``.

   In all cases, it is good to set ``Reply-To: bazaar@lists.ubuntu.com``,
   so that people who reply to the announcement don't spam other lists.

   The announce mail will look something like this::

      Subject: brz x.y.z released!

      The Breezy team is happy to announce availability of a new
      release of the brz adaptive version control system.

      Breezy is a fork of the Bazaar version control system.

      <<Summary paragraph from news>>

      Thanks to everyone who contributed patches, suggestions, and
      feedback.

      Breezy is now available for download from
      https://launchpad.net/brz/x.y/x.y.z/ as a source tarball; packages
      for various systems will be available soon.

      <<release notes from this release back to the last major release>>

   Feel free to tweak this to your taste.

#. Make an announcement through <https://launchpad.net/brz/+announce>
   mentioning the milestone URL <https://launchpad.net/brz/+milestone/x.y.z>
   so people get an easy access to details.

#. Update `<http://en.wikipedia.org/wiki/Breezy_(software)>`_ -- this should
   be done for the stable and beta releases.

#. Update the python package index: <http://pypi.python.org/pypi/breezy>

   From the tarball created and tested earlier ::

     twine upload ../breezy-3.0.0.tar.gz ../breezy-3.0.0.tar.gz.asc

   Remember to check the results afterward -- this should be done for
   stable releases but not for beta releases nor SRUs.

   The ``twine`` command is provided by the ``twine`` package on Debian and
   Ubuntu. Beware that you need at least ``twine-1.10``.

   If in doubt, you can test with <https://testpypi.python.org/pypi> where
   you can register yourself, register the brz project and upload (and then
   remove the upload and delete the project so a new release manager can
   enjoy the same facilities). If the project already exists, have one of
   the existing owners of the project add you to the group.

   To use the pypi test site, you need to record your credentials for an
   existing user (the registration process is manual and starts at
   <https://testpypi.python.org/pypi?%3Aaction=register_form>.

   Once registered, you can record your crdentials in your ``~/pypirc`` file
   with ::

     [testpypi]
     username:<login on testpypi>
     password:<password on testpypi>
     repository = https://testpypi.python.org/pypi

   Registering the breezy project if doesn't exist is achieved with::

     python setup.py -r https://testpypi.python.org/pypi register

  Uploading is done with::

    twine upload -r testpypi ../breezy-3.0.0.tar.gz ../breezy-3.0.0.tar.gz.asc

   To be able to upload the release you must create an account on
   <http://pypi.python.org/pypi> and have one of the existing owners of the
   project add you to the group and update your ``[pypi]`` section in your
   ``~/.pypirc`` file.


Merging the released code back to trunk
---------------------------------------

Merge the release branch back into the trunk.  The ``doc/en/release-notes``
changes should be merged into the right place because each release series
has its own release-notes file, but double-check.

If it's not already done, advance the version number in ``brz`` and
``breezy/__init__.py``. File a merge proposal against ``lp:brz``.

As soon as you change the version number in trunk, make sure you have
created the corresponding milestone to ensure the continuity in bug
targeting or nominating. Depending on the change, you may even have to
create a new series (if your change the major or minor release number), in
that case go to `At the start of a series cycle`_ and follow the
instructions from there.


Releases until the final one
----------------------------

Congratulations - you have made your first release.  Have a beer or fruit
juice - it's on the house! If it was a beta, you're not finished
yet. Another beta or hopefully a stable release is still to come.

The process is the same as for the first release. Goto `Doing a particular
release`_ and follow the instructions again. Some details change between
beta and stable releases, but they should be documented. If the instructions
aren't clear enough, please fix them.


Getting the release into Ubuntu
-------------------------------

/!\ Nothing in this section has been validated for breezy yet.

(Feel free to propose or add new sections here about what we should do to
get brz into other places.)

For the currently-under-development release of Ubuntu, no special action
is needed: the release should be picked by Debian and synced from there into
Ubuntu.

Releases off stable brz branches should go in to the ``-updates`` of the
Ubuntu release that originally contained that branch.  (Ubuntu Lucid had
brz 2.2.0, so should get every 2.2.x update.)  This means going through
the `SRU (Stable Release Updates)
<https://wiki.ubuntu.com/StableReleaseUpdates>`__ process.   

Since September 2010, brz has received approval by the technical
board for the `MicroReleaseExceptions
<https://wiki.ubuntu.com/StableReleaseUpdates/MicroReleaseExceptions>`__
category so that whole bugfix releases can more easily be
approved.

Progress on these realeases is tracked on the `SRU wiki
<http://wiki.bazaar.canonical.com/UbuntuStableReleaseUpdates>`_
page.

**After making a brz stable-release release, nominate the most serious bug
for the appropriate Ubuntu release and subscribe the `ubuntu-sru` team.**

This requires a couple of tricks (please reconsider and tweak as things
evolves from one release to the other):

 * create a distro task with the ``Also affects distribution`` button and
   select ``brz (Ubuntu)``.

 * change the *URL* to point to ``ubuntu/+source/brz`` instead of ``brz``
   (this is needed if you create the distro task but not if it exists
   already). You should now be able to click the ``Nominate for release``
   button and select the right Ubuntu release. As of September 2010, this
   means:

  * ``quantal`` for the 2.6 series,
  * ``precise`` for the 2.5 series,
  * ``oneiric`` for the 2.4 series,
  * ``natty`` for the 2.3 series,
  * ``maverick`` for the 2.2 series,
  * ``lucid`` for the 2.1 series,

 * Subscribe the ``~ubuntu-sru`` team to the bug.

 * Add a comment targeted to ``~ubuntu-sru`` explaining the expectations
   (we are targeting running the test suite during the build which, as of
   September 2010, fails for known reasons that are currently addressed).
   Search for bugs tagged with ``sru`` for examples and don't forget to tag
   the bug you selected.


See also
--------

* `Packaging into the brz PPA <ppa.html>`_ to make and publish Ubuntu
  packages.
* `Breezy Developer Document Catalog <index.html>`_
* `Development cycles <cycle.html>`_: things that happen during the cycle
  before the actual release.

..
   vim: filetype=rst textwidth=74 ai shiftwidth=4
