Source Release for BES: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
No edit summary
(77 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Note that the old pages with the tables of version numbers are gone. Use the web pages themselves as documentation of what has or has not been built. For the current release, include grayed-out links to binaries we do plan to make but keep the grayed-out links in place for the current version only!


== When we decide to release software ==
This pages covers the steps required to release the BES software for Hyrax.  
Use the developers at opendap.org list to send out notices to all the developers about pending releases.


=== Planned release ===
We now depend on the CI/CD process to build binary packages and to test the source builds.
If this is a planned release, send out a notice at least two weeks in advance to anyone who likely has made changes to the software. More lead time is, of course, better. This will allow developers time to get their code and documentation changes into github and onto the master branch in time for the release.  


Run Coverity!
== The Release Process ==
:'''Tip''': If, while working on the release, you find you need to make changes to the code and you know the CI build will fail, do so on a ''release branch'' that you can merge and discard later. Do not make a release branch if you don't '''need''' it, since it complicates making tags.
 
===  Verify the code base ===
# We release using the ''master'' branch. The code on ''master'' must pass the CI build.
# Make sure that the source code you're using for the following steps is up-to-date. (''git pull'')
 
=== Determine the scope of API/ABI changes in C++ sources ===
Determine the new software version (assuming you don't already know the extent of the changes that have been made)
: For C++, build a file of the methods and their arguments using the command:
:: <tt style="font-size: 1.1em; font-weight: bold;">nm .libs/libdap.a | c++filt | grep ' T .*::' | sed 's@.* T \(.*\)@\1@' > libdap_funcs</tt>
: and compare that using <tt>diff</tt> on the previous release's library.
Assess the changes you find based on the following rules for the values of <tt>CURRENT</tt>,<tt>REVISION</tt>, and <tt>AGE</tt>
* No interfaces changed, only implementations (good): ==> Increment REVISION.
* Interfaces added, none removed (good): ==> Increment CURRENT, increment AGE, set REVISION to 0.
* Interfaces removed or changed (BAD, breaks upward compatibility): ==> Increment CURRENT, set AGE and REVISION to 0.
The current value of  <tt>CURRENT</TT>,<tt>REVISION</tt>, and <tt>AGE</tt> can be found in <tt>configure.ac</tt>:
<source lang="bash">
LIB_DIS_CURRENT=14
LIB_DIS_AGE=6
LIB_DIS_REVISION=1
</source>
 
=== Update Release Files ===
Once you have determined the new values of  the <tt>CURRENT:REVISION:AGE</tt>  strings then:
* Edit the configure.ac and update the version values to the new ones.
* Update the text documentation files and version numbers in the configuration files:
 
==== Update the '''ChangeLog''' file. ====
Use the script <tt>gitlog-to-changelog</tt> (which can be found with Google) to update the '''ChangeLog''' file by running it using the <tt>--since="<date>"</tt> option with a date one day later in time than the newest entry in the current ChangeLog.
: <tt style="font-size: 1.1em; font-weight: bold;">gitlog-to-changelog --since="1970-01-01"</tt>
:: (''Specify a date one day later than the one at the top of the existing ChangeLog file.'')
Save the result to a temp file and combine the two files: <br/>
: <tt style="font-size: 1.1em; font-weight: bold;">cat tmp ChangeLog > ChangeLog.tmp; mv ChangeLog.tmp ChangeLog</tt>
If you're making the first ChangeLog entries, then you'll need to create the ChangeLog file first. <br/>
'''Tip''': ''When you're making the commit log entries, use line breaks so ChangeLog will be readable. That is, use lines < 80 characters long.''
 
==== Update the NEWS file ====
To update the NEWS file, just read over the new ChangeLog entries and summarize.
 
==== Update the Version Numbers for Humans ====
# Determine the human version number. This appears to be a somewhat subjective process.
# Edit each of the ''Affected Files'' and update the human version number.
 
:;Affected Files:
:: configure.ac
:: *.spec (In the BES it's ''bes.spec.*'')
:: debian/changelog (see [https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#changelog] Debian ChangeLog)
:: travis.yml (for BES only)
:: NEWS
:: README.md (Add the libdap version the README.md)
:: INSTALL
 
It's helpful to have, in the '''NEWS''' file and the Web site and the release notes, a list of the Jira tickets that have been closed since the last release. The best way to do this is to goto ''Jira's Issues'' page and look at the ''Tickets closed recently'' item. From there, click on ''Advanced'' and edit the time range so it matches the time range since the past release to now, then ''Export'' that info as an excel spreadsheet (the icon with a hat and a down arrow). YMMV regarding how easy this is and Jira's UI changes often.


=== Emergency releases ===
==== Update the RPM dependencies ====
If this is an 'emergency' release, then send out a notice to developers as soon as the decision to release is made, since this will give a chance for other developers to lets us know if there are new changes in the master branch that are ready for release. if we don't get an email from those developers of a particular component, then we should assume that the code might not be 100% ready for release and we should use the version tagged with/for the last release if possible.  
In the RPM ''.spec'' file, update the dependencies as needed.


Maybe run Coverity - depends on the scope of the changes.
;Affected Files:
: *.spec (In the BES it's ''bes.spec.*''')


== The Release Process ==
==== Update the internal library version numbers ====
:'''Tip''': If, while working on the release, you find you need to make changes to the code and you know the CI build will fail, do so on a ''release branch'' that you can merge and discard later. If you don't need to do this, skip it. Also, note that the umpteen handlers really make this a hassle, so feel free to skip this step or do it only for the BES itself, etc.
There are really 2 version numbers for each of these project items. The ''human'' version (like bes-3.17.5) and the ''library'' API/ABI version which is represented as <tt>CURRENT:REVISION:AGE</tt>. There are special rules for when each of the numbers in the library API/ABI version get incremented that are triggered by the kinds of changes that where made to the code base. The human version number is more arbitrary. So for example, we might make a major API/ABI change and have to change to a new Libtool version like <tt>25:0:0</tt> but the human version might only change from bes-3.17.3 to bes-3.18.0
:'''Create the release branch.'''
 
:* ''git checkout -b hyrax_release_0.0.0''  
The rules for shared image version numbers:
:* ''git push --set-upstream origin hyrax_release_0.0.0''
# No interfaces changed, only implementations (good): Increment REVISION.
: For the bes, also make the branch for each submodule:
# Interfaces added, none removed (good): Increment CURRENT, increment AGE, set REVISION to 0.
:* ''git submodule foreach 'git checkout -b hyrax_release_0.0.0' ''
# Interfaces removed or changed (BAD, breaks upward compatibility): Increment CURRENT, set AGE and REVISION to 0.
===  Verify the code base ===
 
# Make sure that the source code you're using is up-to-date. (''git pull'')
See ''How to see the scope of API/ABI changes in C++ sources'' below for gruesome details. Often basic knowledge of the edits is good enough.
# Have all tickets for the release milestone been resolved?
# Does the code pass it's tests?
#;Note
#: For the BES (''or any software that requires parameters passed to configure'') use <tt>DISTCHECK_CONFIGURE_FLAGS=...</tt> when you run <tt>make</tt> For running tests, using <tt>TESTSUITEFLAGS=-j9</tt> will speed up the autconf/autotest tests if the version of autoconf supports parallel testing (but not on CentOS 6 because it's not supported by the stock version of autoconf on that OS).
#* ''libdap4''
#:: '''make check -j9'''
#:: '''make distcheck -j9'''
#* ''bes''
#:: '''make check -j9'''
#:: '''make distcheck -j9 DISTCHECK_CONFIGURE_FLAGS=--with-dependencies=$prefix/deps'''
#: How did that go, with the <tt>distcheck</tt> target there? [[Debugging the distcheck target|Look here for help]]


=== Check the <tt>make rpm</tt> target ===
;Affected Files:  
Running the <tt>make rpm</tt> target is useful because it will find problems that can slow the process once the final edits are done and the RPMs are being built.
: configure.ac
# Make sure to install the libdap rpms before you build the bes rpms and uninstall them afterwards.:
#: '''sudo yum install ~/rpmbuild/RPMS/x86_64/libdap-*'''
# Make sure that the bes dependencies have been built using the static option so that the BES rpm will have modules that are statically linked to their dependencies. To check this look at the libraries in <tt>$prefix/deps/lib</tt>. There should be no <tt>*.so</tt> files in the <tt>lib</tt> dir, only <tt>*.a</tt>, <tt>*.la</tt>, and some other directories. To build a new set of dependencies that provide only static libraries, use:
#: '''make for-static-rpm -j9 CONFIGURE_FLAGS=--disable-shared'''
# Build the BES rpm using those snazzy static libraries, use
#: '''make all-static-rpm -j9'''
# When finished, uninstall the libdap rpms:
#: '''sudo yum uninstall ~/rpmbuild/RPMS/x86_64/libdap-*'''


=== Update Release Related Files ===
==== For the BES HDF4/5 modules (BES only) ====
# Update the text documentation files and version numbers in the configuration files:
# Goto those directories and update the ChangeLog, NEWS, README, and INSTALL files (even though INSTALL is not used by many).
#* Update the '''ChangeLog''' file using the script ''gitlog-to-changelog'' which can be found with Google. Run it using the --since="<date>" option and use a date one day later then the newest entry in the current ChangeLog. Save the result to a temp file and combine the two files (''cat tmp ChangeLog > ChageLog.tmp, ...''). If you're making the first ChangeLog entries, then you'll need to create the ChangeLog file first. Here's a key tip: When you're making the commit log entries, use line breaks so ChangeLog will be readable. That is, use lines < 80 characters long.
# Update the module version numbers in their respective Makefile.am files.
#* Then to write the NEWS file, just read over the new ChangeLog entries and summarize. In the old days of CVS, the logs automatically included the names of the changed files, but subversion and git don't do that.
# Commit and Push these changes.
#* Make sure that the version number is set in the '''configure.ac''' and '''*.spec''' files! For the BES handlers, the version information is also int he Makefile.am (look for the '''M_VER=''' line). When the version number changes, reset the RPM release number to '1' in the '''*.spec''' files ("Release:    1"). For several releases of the same version, increment the release number (the number after the dash in the RPM file name; we don't have release numbers for the tar files). ''I generally update the ChangeLog before updating the version numbers or NEWS, et c., files because the ChangeLog gives me a bird's eye view of what happened since the last release.''
#* libtool versioning rules: What the ''CURRENT[:REVISION[:AGE]]'' string passed to ''libtool means:'' (Note these are set using variables in the configure.ac script.)
#** No interfaces changed, only implementations (good): ==> Increment REVISION.
#** Interfaces added, none removed (good): ==> Increment CURRENT, increment AGE, set REVISION to 0.
#** Interfaces removed or changed (BAD, breaks upward compatibility): ==> Increment CURRENT, set AGE and REVISION to 0.
#** So how do you know? For C++, build a file of the methods and their arguments using ''nm .libs/libdap.a | c++filt | grep ' T .*::' | sed 's@.* T \(.*\)@\1@' > libdap_funcs'' and compare that using diff on the previous release's library.
#* Make sure that '''README''', '''INSTALL''' and '''NEWS''' are updated (setting ''check-news'' in ''Makefile.am'' ''AUTOMAKE_OPTIONS'' will enforce this).
# Commit & Push these changes.
=== Build And Upload Distribution Files ===
# Make the tar file
#* '''make dist'''
#* '''Sign''' the tar file. [[SecureEmail | See the help item on the main trac wiki page if you need instructions.]]
#* Move the file to the web site for distribution.
# For the BES, see below
# Make the [[RPM]]
#*'''Sign''' the RPM
#*Move to a directory on the web site and use script to move the RPM around (later, once all the RPMs are uploaded). -->
# Update the web pages: A complex and (at this time - 2/21/06) changing process.


=== Tag The Release ===
=== Commit Changes ===
# ''git tag -a version-<numbers> -m "Version <number>"''
# Commit and push the BES code. Wait for the CI/CD builds to complete. You must be working on the ''master'' branch to get the CD package builds to work.
# ''git push origin version-<numbers>''


If this is part of Hyrax, also tag this point in the master branch with the Hyrax release number:
=== Tag & Release ===
# ''git tag -a hyrax-<numbers> -m "Hyrax <number>"''
==== Tag the BES code ====
# ''git push origin hyrax-<numbers>''
# Tag the bes code using command line git in your local (up-to-date) '''bes''' project
#: NB: Instead of tagging all of the modules, use the saved commit hashes that git tracks for submodules. This cuts down on the bookkeeping for releases and removes one source of error; recording the wrong version for one of the 17 or so modules. thus, there is no need to tag the code in the modules.
#* <tt style="font-size: 1.1em; font-weight: bold;">git tag -a version-<numbers> -m "Version <number>"</tt>
# Mark the release on Github:
#* <tt style="font-size: 1.1em; font-weight: bold;">git push origin version-<numbers></tt>
#* Goto the 'releases' page and click the 'Tags' tab. There:
#: <br/>
#** Enter a ''title'' for the release
# If this is part of a Hyrax Release, then tag this point in the master branch with the Hyrax release number
#** Copy the most recent text from the NEWS file into the ''describe'' field
#* <tt style="font-size: 1.1em; font-weight: bold;">git tag -a hyrax-<numbers> -m "Hyrax <number>"</tt>
#** Click ''Update this release'' or ''Save draft''
#* <tt style="font-size: 1.1em; font-weight: bold;">git push origin hyrax-<numbers></tt>
#: '''NB:''' ''Instead of tagging the HDF4/5 modules, use the saved commit hashes that git tracks for submodules. This cuts down on the bookkeeping for releases and removes one source of error.''


== For the BES ==
==== Create the release on Github ====
This may change if the BES project is restructured.
# [https://github.com/OPENDAP/bes Goto the BES project page in GitHub]
# Choose the '''releases''' tab.
# On the [https://github.com/OPENDAP/bes/releases Releases page] click the 'Tags' tab.
# On the [https://github.com/OPENDAP/bes/tags Tags page], locate the tag (created above) associated with this new release.
# Click the ellipses (...) located on the far right side of the ''version-x.y.z'' tag 'frame' for this release and and choose ''Create release''.
#* Enter a ''title'' for the release
#* Copy the most recent text from the NEWS file into the ''describe'' field
#* Click '''Publish release''' or  '''Save draft'''.
#** If you have previously edited the release page you can click '''Update this release'''


Do the release items above for the source release and then, for the modules, do the following:
=== Get the DOI from Zenodo ===
* git submodule foreach 'git status'
# [https://zenodo.org Goto Zenodo]
* cd modules and ./version_update_modules.sh -v `cat all_modules.txt`
# Look at the 'upload' page. If there is nothing there (perhaps because you are not ''jhrg'' or whoever set up the connection between the BES project and Zenodo) you can use the search bar to search for '''bes'''.
* git submodule foreach 'git status'
#: Since the libdap, BES and OLFS repositories are linked to Zenodo, the newly-tagged code is uploaded to Zenodo automatically and a DOI is minted for us.
* git submodule foreach 'git commit -a -m "updated for Hyrax 1.13.3"'
# Click on the new version, then click on the DOI tag in the pane on the right of the page for the given release.
* git submodule foreach 'git push'
# Copy the DOI as markdown from the window that pops up and paste that into the info for the version back in Github land.
# Also paste that into the README file. Commit using ''[skip ci]'' so we don't do a huge build (or do the build, it really doesn't matter that much).


These steps update the modules (sub-projects) and get the new version numbers up into GitHub.
'''Tip:''' ''If you are trying to locate the '''libdap''' releases in Zenodo you have to search for the string:'' <tt style="font-size: 1.1em; font-weight: bold;">libdap4</tt>


Then ''git commit -a'' and '' git push'' in the ''bes'' dir to make sure that the new commit hashes get pushed.
===== Images =====
[[File:Screenshot 2018-12-06 11.06.44.png|none|thumb|400px|border|left|Zenodo upload page]]

Revision as of 16:57, 23 February 2019

This pages covers the steps required to release the BES software for Hyrax.

We now depend on the CI/CD process to build binary packages and to test the source builds.

The Release Process

Tip: If, while working on the release, you find you need to make changes to the code and you know the CI build will fail, do so on a release branch that you can merge and discard later. Do not make a release branch if you don't need it, since it complicates making tags.

Verify the code base

  1. We release using the master branch. The code on master must pass the CI build.
  2. Make sure that the source code you're using for the following steps is up-to-date. (git pull)

Determine the scope of API/ABI changes in C++ sources

Determine the new software version (assuming you don't already know the extent of the changes that have been made)

For C++, build a file of the methods and their arguments using the command:
nm .libs/libdap.a | c++filt | grep ' T .*::' | sed 's@.* T \(.*\)@\1@' > libdap_funcs
and compare that using diff on the previous release's library.

Assess the changes you find based on the following rules for the values of CURRENT,REVISION, and AGE

  • No interfaces changed, only implementations (good): ==> Increment REVISION.
  • Interfaces added, none removed (good): ==> Increment CURRENT, increment AGE, set REVISION to 0.
  • Interfaces removed or changed (BAD, breaks upward compatibility): ==> Increment CURRENT, set AGE and REVISION to 0.

The current value of CURRENT,REVISION, and AGE can be found in configure.ac:

LIB_DIS_CURRENT=14
LIB_DIS_AGE=6
LIB_DIS_REVISION=1

Update Release Files

Once you have determined the new values of the CURRENT:REVISION:AGE strings then:

  • Edit the configure.ac and update the version values to the new ones.
  • Update the text documentation files and version numbers in the configuration files:

Update the ChangeLog file.

Use the script gitlog-to-changelog (which can be found with Google) to update the ChangeLog file by running it using the --since="<date>" option with a date one day later in time than the newest entry in the current ChangeLog.

gitlog-to-changelog --since="1970-01-01"
(Specify a date one day later than the one at the top of the existing ChangeLog file.)

Save the result to a temp file and combine the two files:

cat tmp ChangeLog > ChangeLog.tmp; mv ChangeLog.tmp ChangeLog

If you're making the first ChangeLog entries, then you'll need to create the ChangeLog file first.
Tip: When you're making the commit log entries, use line breaks so ChangeLog will be readable. That is, use lines < 80 characters long.

Update the NEWS file

To update the NEWS file, just read over the new ChangeLog entries and summarize.

Update the Version Numbers for Humans

  1. Determine the human version number. This appears to be a somewhat subjective process.
  2. Edit each of the Affected Files and update the human version number.
Affected Files
configure.ac
*.spec (In the BES it's bes.spec.*)
debian/changelog (see [1] Debian ChangeLog)
travis.yml (for BES only)
NEWS
README.md (Add the libdap version the README.md)
INSTALL

It's helpful to have, in the NEWS file and the Web site and the release notes, a list of the Jira tickets that have been closed since the last release. The best way to do this is to goto Jira's Issues page and look at the Tickets closed recently item. From there, click on Advanced and edit the time range so it matches the time range since the past release to now, then Export that info as an excel spreadsheet (the icon with a hat and a down arrow). YMMV regarding how easy this is and Jira's UI changes often.

Update the RPM dependencies

In the RPM .spec file, update the dependencies as needed.

Affected Files
*.spec (In the BES it's bes.spec.*')

Update the internal library version numbers

There are really 2 version numbers for each of these project items. The human version (like bes-3.17.5) and the library API/ABI version which is represented as CURRENT:REVISION:AGE. There are special rules for when each of the numbers in the library API/ABI version get incremented that are triggered by the kinds of changes that where made to the code base. The human version number is more arbitrary. So for example, we might make a major API/ABI change and have to change to a new Libtool version like 25:0:0 but the human version might only change from bes-3.17.3 to bes-3.18.0

The rules for shared image version numbers:

  1. No interfaces changed, only implementations (good): Increment REVISION.
  2. Interfaces added, none removed (good): Increment CURRENT, increment AGE, set REVISION to 0.
  3. Interfaces removed or changed (BAD, breaks upward compatibility): Increment CURRENT, set AGE and REVISION to 0.

See How to see the scope of API/ABI changes in C++ sources below for gruesome details. Often basic knowledge of the edits is good enough.

Affected Files
configure.ac

For the BES HDF4/5 modules (BES only)

  1. Goto those directories and update the ChangeLog, NEWS, README, and INSTALL files (even though INSTALL is not used by many).
  2. Update the module version numbers in their respective Makefile.am files.
  3. Commit and Push these changes.

Commit Changes

  1. Commit and push the BES code. Wait for the CI/CD builds to complete. You must be working on the master branch to get the CD package builds to work.

Tag & Release

Tag the BES code

  1. Tag the bes code using command line git in your local (up-to-date) bes project
    • git tag -a version-<numbers> -m "Version <number>"
    • git push origin version-<numbers>

  2. If this is part of a Hyrax Release, then tag this point in the master branch with the Hyrax release number
    • git tag -a hyrax-<numbers> -m "Hyrax <number>"
    • git push origin hyrax-<numbers>
    NB: Instead of tagging the HDF4/5 modules, use the saved commit hashes that git tracks for submodules. This cuts down on the bookkeeping for releases and removes one source of error.

Create the release on Github

  1. Goto the BES project page in GitHub
  2. Choose the releases tab.
  3. On the Releases page click the 'Tags' tab.
  4. On the Tags page, locate the tag (created above) associated with this new release.
  5. Click the ellipses (...) located on the far right side of the version-x.y.z tag 'frame' for this release and and choose Create release.
    • Enter a title for the release
    • Copy the most recent text from the NEWS file into the describe field
    • Click Publish release or Save draft.
      • If you have previously edited the release page you can click Update this release

Get the DOI from Zenodo

  1. Goto Zenodo
  2. Look at the 'upload' page. If there is nothing there (perhaps because you are not jhrg or whoever set up the connection between the BES project and Zenodo) you can use the search bar to search for bes.
    Since the libdap, BES and OLFS repositories are linked to Zenodo, the newly-tagged code is uploaded to Zenodo automatically and a DOI is minted for us.
  3. Click on the new version, then click on the DOI tag in the pane on the right of the page for the given release.
  4. Copy the DOI as markdown from the window that pops up and paste that into the info for the version back in Github land.
  5. Also paste that into the README file. Commit using [skip ci] so we don't do a huge build (or do the build, it really doesn't matter that much).

Tip: If you are trying to locate the libdap releases in Zenodo you have to search for the string: libdap4

Images
Zenodo upload page