Documentation on basic versioning strategy (as of March 2017)
The develop branch of the git repository is where features are pushed and deployed to UAT for testing.
NOTE: When doing this process, make sure that eclipse is closed! This process can be run with a combination of cygwin and tortoise git.
The develop branch should always be one minor version ahead of master. For example
- master = 1.3.1
- develop = 1.3.2-SNAPSHOT
When it comes time to deploy features to PROD, the master branch needs to be updated/synchronized before that happens.
The basic process is this:
- Pull latest changes for the repository.
- Ensure the project is set to the "develop" branch.
Use "mvn versions:set" to change the versions of the develop branch to the next release version (e.g. 1.3.2)
- Commit the "develop" branch changes (but not need to push)
- Switch to the "master" branch
- Merge changes from "develop" to "master" (resolve any conflicts, rebuild code completely, confirm that ui deploys as expected)
- Push the "master" branch (it now has the next release version)
- Switch back to the "develop" branch.
Use "mvn versions:set" to change the versions to the next develop version
- Commit the "develop" branch and push this change
- Redeploy UAT to reflect the next dev version
NOTE: Confirm that pom-us.xml also gets versioned appropriately. If not, update manually.
NOTE: you may notice the complexity of running versions:set twice. This is because of the split nature of the parent and aggregator modules. It is recommended in the future that parent project be merged into the aggregator and removed. Thant involves:
- Moving the dependencyManagement section from parent/pom.xml to pom.xml
- Moving the pluginManagement section from parent/pom.xml to pom.xml
- Removing "parent" from the modules list in pom.xml
- Updating pom.xml to remove the "<parent>" section at the top (it is now the parent)
- Also change pom.xml description to indicate that it is both parent and aggregator
- in particular, change the artifactId to be "...-parent" instead of "...-aggregator" (this is for the next part)
- update all other pom.xml files in submodules to change the relativePath to the parent module
- from "../parent" to ".."
- OR from "../../parent" to "../.."
Occasionally, only a select few commits from develop need to be deployed on production as a hotfix. In these cases, the full merging from develop to master is inappropriate, and the following steps should be followed instead:
- Switch to the "master" branch. Do a pull if you don't have the latest changes on the "master" branch.
- Use CherryPick in TortoiseGit to merge the desired commit(s) from develop into master:
- Using TortoiseGit, select Show Log.
- In the top left-hand corner there will be a hyperlink saying "master". Hit that to open a dialog box showing other branches, and select the "develop" branch.
- Select the commit(s) to be included in the hotfix, right-click, and choose "Cherry pick this commit". Follow the prompts to in the next screen to merge this/these commits into master.
Use "mvn versions:set" to change the versions of the master branch. For hotfixes, the convention is to add an underscore+letter to the current version. e.g. If the current version is 1.5.2, then update the version to 1.5.2_a. If another hotfix is deployed before the next full merge from develop into master, increment the letter to 1.5.2_b, and so on.
- Commit the "master" branch changes and push.
NOTE: For hotfixes, no version changing is done on the develop branch. So in the above example, the develop version will remain at "1.5.2-SNAPSHOT".
NOTE: As with standard merges, confirm that pom-us.xml also gets versioned appropriately. If not, update manually.
Creating Release Notes Page
Whether for a full deployment or a hot fix, whenever code is versioned and deployed to production, create a release notes page to document the update.
- Navigate to the main page for mapping tool release notes, here: Mapping Tool - Release Notes
- Open a few of the existing release note pages listed in new tabs, for use as templates.
- Hit the blue Create button on the top of the screen.
- Using the other previously created pages for guidance, fill in the new page. Sections include:
- The title should be: ('US' if for NLM) Mapping Tool Version (VERSION) - (TODAY'S DATE in DD Mmm YYYY format) - Release Notes
- Tables for Defects Corrected, and/or New Features/Improvements.
- Copy/paste Ticket numbers and descriptions from Jira.
- Additional Notes, describing the release
- Module versions in this deployment
- Related dependencies for information
- Once finished, hit the "Save" button to publish the page.
- Copy the URL from the newly created page, and paste it on the top of the main Mapping Tool - Release Notes page. It will automatically format it to match the title of the new page.