Code Versioning
DataONE follows a standard incremental versioning approach to its software packages whereby new features under developer are put under a version number.  This document describes in some detail the process to follow when we want to release a version and move mainline development to the next increment.

Note: Independently, DataONE tracks a service-interface version that indicates communication compatability between the independently managed nodes of DataONE.  These versions, while not 


Baseline assumptions

SCM practices
Build practices
Testing practices
Advancing code/package versions:
When a version is feature-complete, all necessary integration tests are written, the latest artifacts are deployed to DEV nodes*, and integration tests are passing on Hudson, it is time to "tag-and-release."

*otherwise d1_integration tests can pass in the DEV environment even though the the latest code in the trunk is faulty. 

Tag and Release Process
1.  check that all d1_integration tests are passing (no failures, and in general no ignores)
2. tell the team that they cannot commit code to the trunk while we are tagging and releasing code.
    (lock the trunk?)  
        cd /repos/path/of/interest
        find . -type f -exec svn lock '{}' ';'
        
3.  for each package, (starting with the deepest dependency):
     http://mule1.dataone.org/ArchitectureDocs-current/implementation/components.html#dependency-graph
    a.  in the package pom.xml, edit the version, removing the '-SNAPSHOT' suffix to 
         make it a permanent fixture in the project-local maven repository.
         <version>0.1.0-SNAPSHOT</version> 
            becomes
         <version>0.1.0</version> 
    b.  edit any dataone dependency versions as in step a, to point to the new maven artifacts.
    c.  run unit tests locally
    d.  commit to the repository
    
**Hudson will run mvn install command after commits and if successful, will deploy the artifact (jar) to its maven repository.  This will be needed so that downstream tests can find their new dependencies (see 3b).

4. create subversion "release" tag off the latest trunk.
    svn copy https://repository.dataone.org/software/cicore/trunk/ https://repository.dataone.org/software/cicore/tags/TAG_NAME

5. tell the team that they should update their local trunk checkouts, and can do commits again.
    (unlocking the trunk)
        find . -type f -exec svn unlock '{}' ';'

Comments:
Detail on Metacat versioning and integration testing:
Much of the CN interface is implemented by Metacat, whose code is maintained in a separate code repository (https://code.ecoinformatics.org/code/metacat/).  It also has its own set of tests that need to pass before being released to DataONE.  Still, metacat needs to pass d1_integration tests, so changes in metacat code need to be deployed into a testing environment for this to happen. 

Some relevant detail:
It is not practical in most cases for the metacat developer to deploy often to the DEV environment, so integration testing against a local metacat deployment is preferable, and has be facilitated.  In this way dataone integration tests (at least for member node functionality) can be run against the same locally deployed metacat instance used for metacat tests.

Local d1_integration testing of metacat as Member Node:
1.  checkout / update the d1_integration package 
2.  run integration tests from d1_integration directory with the command 
    mvn -Dcontext.label=LOCAL_METACAT -Dit.test=MNode* verify
   (additional properties can be defined in context.LOCAL_METACAT.test.properties file in d1_integration/src/main/resources)
   
Local d1_integration testing of metacat CN functionality
While not yet attempted, in theory and assuming a local cn is configured:
1. checkout / update the d1_integration package
2. run integration tests from d1_integration directory with the command
    mvn -Dcontext.label=LOCAL_METACAT -Dit.test=CNode* verify
    
Other integration tests (synchronization, replication require multiple MNs and CNs, so running the above maven commands without the "it.test" filtering property will undoubtedly fail.



Versioning Run-Through
==================
Development of version 4.2 seems to be complete.  The latest version of metacat is passing its own tests and d1_integration tests run against a local deployment.
1. Update the DEV environment