Version 1.2, Jan. 2013 Subversion 1/64WW Winter School 2013 Subversion: A True Community Modeling Paradigm Jose-Henrique Alves The WAVEWATCH III Team +

Slides:



Advertisements
Similar presentations
Week 2 DUE This Week: Safety Form and Model Release DUE Next Week: Project Timelines and Website Notebooks Lab Access SharePoint Usage Subversion Software.
Advertisements

Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could.
Version Control System (Sub)Version Control (SVN).
Version Control 1.  Version control (or revision control) is the term for the management of source files, and all of the intermediate stages as development.
Software Configuration Management Donna Albino LIS489, December 3, 2014.
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
Prof. Aiken CS 169 Lecture 71 Version Control CS169 Lecture 7.
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
The Design Workshop Introduction to Version Control 1.
1 Lecture 19 Configuration Management Software Engineering.
1 Software Development Configuration management. \ 2 Software Configuration  Items that comprise all information produced as part of the software development.
Git – versioning and managing your software L. Grewe.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
CVS 簡介 數位芝麻網路公司蔡志展 2001/8/18 大綱 • CVS 簡介 • CVS 安裝 • CVS 設定 (Linux/Windows) • CVS 指令簡介 • CVS 多人環境的應用.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Version 1.2, Feb. 2013Modular structure 1/22WW Winter School 2013 Modular structure of WAVEWATCH III and general features Arun Chawla The WAVEWATCH III.
Paul van Delst Betty Petersen Memorial Library Technical Seminar Series Subversion 2.Branching, Merging, and Tagging. Common Use Cases and Practices.
Version control Using Git Version control, using Git1.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
CSE 219 Computer Science III CVS
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala.
Copyright © Curt Hill Tortoise SVN A Subversion Client.
L.T.E :: Learning Through Experimenting Using google-svn for MtM Docs Development Denis Thibault Version 3.2 Mar 12 th, 2009.
Part 4: FCM and the UM University of Reading, December 2015.
Version Control and SVN ECE 297. Why Do We Need Version Control?
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
© CGI Group Inc. User Guide Subversion client TortoiseSVN.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Problem Solving With C++ SVN ( Version Control ) April 2016.
Subversion Subversion is a brand of version control software that is frequently used to store the code and documentation of a project so as to permit.
11 Version control (part 2)
LECTURE 2: Software Configuration Management
Discussion 11 Final Project / Git.
Version Control with Subversion (SVN)
Subversion.
Concurrent Version Control
Version Control System
LECTURE 3: Software Configuration Management
Git CS Fall 2018.
Prof. Hilfinger CS164 Lecture 4
Systems Analysis and Design I
Presentation transcript:

Version 1.2, Jan Subversion 1/64WW Winter School 2013 Subversion: A True Community Modeling Paradigm Jose-Henrique Alves The WAVEWATCH III Team + friends Marine Modeling and Analysis Branch NOAA / NWS / NCEP / EMC

Version 1.2, Jan Subversion 2/64WW Winter School 2013 Overview Developers’ Best Practices Model development paradigms: why use Subversion How Subversion works How we use Subversion

Version 1.2, Jan Subversion 3/64WW Winter School 2013 Best practices For those who want to modify / contribute to WAVEWATCH III, a best practices guide is available. Note that as a part of the license, additions made to the model have to be offered to NCEP for inclusion in future model distributions. Best practices cover :  Programming style  Adding to the model.  Manual and documentation.  Subversion repository.  Regression testing. Best practices guide

Version 1.2, Jan Subversion 4/64WW Winter School 2013 Best practices Programming style: Use WAVEWATCH III documentation style (see templates). Use coding style:  Free format but layout as in old fixed format.  Upper case for permanent code, lower case for temporarily code. Latter can be included as permanent testing using !/Tn switches. Maintain update log at header for documentation. Embed all subroutines in modules or main programs, using naming convention outlined before. Follow FORTRAN 90 standard, with best practices as outlined in section 2 of the guide. Provide appropriate documentation in LaTeX format for inclusion in the manual.

Version 1.2, Jan Subversion 5/64WW Winter School 2013 Best practices Adding to the model (with NCEP subversion access) Same rules apply as for those without svn access with following exceptions:  NCEP code managers will assign switches to new sources and propagation scheme to be used instead of the ‘X’ switches.  Developers will be responsible for integration in the data structure:  Do this only after rigorous testing of self-contained system.  NCEP code managers will add new code to the TRUNK of the repository. Changes to be provided relative to most recent TRUNK, not to most recent distributed version

Version 1.2, Jan Subversion 6/64WW Winter School 2013 Best practices Manual and documentation. Provide full LaTeX documentation for inclusion in the manual:  NCEP svn users have access to manual, and are expected to add to it directly.  NCEP will provide editing.  Others provide separate files.  NCEP will integrate.  Use BibTEX.  Use dynamic references to equations, figures and tables only.

Version 1.2, Jan Subversion 7/64WW Winter School 2013 Best practices Testing Regression testing are based on previous WAVEWATCH III tests and new materials and tools provided by Erick Rogers and Tim Campbell from NRL Stennis.  nrltest, will replace current test directory in near future

Version 1.2, Jan Subversion 8/64WW Winter School 2013 Model Development Framework Developer’s Universe Development work involves including new features to the wave model, upgrading existing features, as well as bug fixing, clean up etc Modifying the code will lead to changes in the whole system Developers should be aware of what all the components are and what needs to be changed Approach changes as a system, looking at all components: .ftn files  Pre-compiler (ww3_make and associated programs)  FORTRAN compiler specifics (comp and link scripts)  Regression tests (make new friends, but keep the old)  Integrating a lot of developers, developing a complex system: communication + centralized repository = SVN!

Version 1.2, Jan Subversion 9/64WW Winter School 2013 Model Evolution Communication: the big leap forward We asked our top model to pose beside the SD model

Version 1.2, Jan Subversion 10/64WW Winter School 2013 The “Usual” Development Model A Self Disgruntling Model Individual development  Each one comes up with a different solution  Each one has his/her own code writing standards End up with a set of many versions, diverging = diversions Clunky communication Open loops: difficult to debug, reconcile Time consuming

Version 1.2, Jan Subversion 11/64WW Winter School 2013 NOOK mod.ftn files make.f90 The Usual Development Model make exetests w3_makeYour favorite FORTRAN compiler Your favorite tests Your WW3 version User 2 NO OK mod.ftn files make.f90 make exe tests Her WW3 version w3_makeHer favorite FORTRAN compiler Her favorite tests

Version 1.2, Jan Subversion 12/64WW Winter School 2013 Version 1Version 2Version 3Version 4Version 5 The Usual Development Model

Version 1.2, Jan Subversion 13/64WW Winter School 2013 The Community Development Model A Self Sufficient Model Collective, simultaneous development  Each one comes up with a different solution  Solutions are integrated and reconciled  All should follow same code writing standards Subversion: a single version, with many options = convergence Streamlined communication Consistent codes, easy to debug and reconcile Time saving

Version 1.2, Jan Subversion 14/64WW Winter School 2013 The Community Development Model w3_makeYour favorite FORTRAN compiler Shared tests WW3 trunk mod.ftn files function branch NO OK make.f90 make exe tests Stable cut Reintegration

Version 1.2, Jan Subversion 15/64WW Winter School 2013 The Community Development Model w3_makeYour favorite FORTRAN compiler Shared tests WW3 trunk mod.ftn files function branch NO OK make.f90 make exe tests Stable cut Reintegration NO OK mod.ftn files make.f90 make exe tests w3_makeHer favorite compiler Shared tests other branch Sync

Version 1.2, Jan Subversion 16/64WW Winter School 2013 Context: What is Subversion? Subversion is an open source centralised version control system (i.e. accesses a central repository) that allows one or more users to easily share and maintain collections of files. IOW: it’s a database that keeps track of changes made to files What it is not. Magic. It is not a substitute for management. It is not a substitute for developer communication. There is nothing inherently special about subversion. Many other revision control systems exist. Git, Mercurial, CVS, Bazaar, darcs, etc Reference:

Version 1.2, Jan Subversion 17/64WW Winter School 2013 EMC and NCO Subversion Servers NCEP repository URL: /ww3

Version 1.2, Jan Subversion 18/64WW Winter School 2013 Repository organisation (1) Project ww3 has four main directories: trunk The main line of development. Typically in an “almost ready for release” state. branches Where development is done. Experimental development branches sandbox Are available for developers to store branches that are kept out of sync on purpose tags Snapshots and releases No development ww3/ trunk/ branches/ ST4/ curvilinear/ REL-2.0.2/ projX directories, source files, fix files, scripts, etc tags/ playroom/ sandbox/

Version 1.2, Jan Subversion 19/64WW Winter School 2013 Repository organisation (2) trunk/, branches/,tags/, and sandbox/ are just directories. Subversion has no concept of a “branch” or “tag”. When the trunk is copied, it is a branch or tag only because we attach that meaning to it. Repository copies (i.e. branches and tags) are “cheap”. That is, you are not actually copying all of the source/data - you are just creating a reference to a particular revision. Subversion stores only the diff content when changes are made, still referencing to the originating files.

Version 1.2, Jan Subversion 20/64WW Winter School 2013 Repository revision numbering When subversion repo is created, starts at revision 0. Each subsequent commit to the repository increments the revision number by 1. The revision number is repository-wide so any commit in any project increments the revision number NCEP, currently has 69 registered projects, all share revision numbers Typically, don’t need to worry about a revision number value But need to be aware of the numbers related to your codes The trac source browser provides easily navigable information about what was done at which revision.

Version 1.2, Jan Subversion 21/64WW Winter School 2013 Checking out files Two ways of getting repository content: 1. Grabbing an unversioned copy: svn export 2. Checking out a versioned copy: create local workcopy $ cd $HOME/workcopy $ svn checkout URL rev ][ wcPATH ] The repository URL of the project you want to checkout The revision number of the project you want to checkout. Defaults to HEAD, i.e. the latest version. The path where you want to create your working copy. Defaults to the basename of URL.

Version 1.2, Jan Subversion 22/64WW Winter School 2013 Editing existing files Once you have created a working copy of your project(s), edit, compile, debug, and test as usual The files are the same as when they were unversioned To avoid creating junk (compiled code, output etc) in your svn folder, a good practice is to create symbolic links Changes made to linked files are propagated to svn area. Compiled codes and outputs etc are kept out of svn area. $ cd $HOME/workcopy $ mkdir svn; cd svn $ svn checkout URL rev ][ wcPATH ] $ cd..; ln –s./svn/*.

Version 1.2, Jan Subversion 23/64WW Winter School 2013 Adding new files When you create a new file – for svn means creating from scratch or copying from outside the versioned workcopy – it remains local until you commit. If adding an entire directory, this will work recursively on all its contents. $ touch newfile.txt $ cp outsider.txt $ svn status ? newfile.txt ? outsider.txt $ svn add newfile.txt outsider.txt A newfile.txt A outsider.txt $ svn commit –m “1st commit” newfile.txt outsider.txt Adding new_script.sh Transmitting file data Committed revision

Version 1.2, Jan Subversion 24/64WW Winter School 2013 Deleting files Deleting using local command has no effect to versioning. Versioning requires svn command, which also deletes the file from your working copy. Local delete does not affect repository: commit required! $ rm old_script.sh $ svn status ! old_script.sh $ svn delete old_script.sh D old_script.sh $ svn commit –m “Removed file” old_script.sh Deleting old_script.sh Transmitting file data Committed revision

Version 1.2, Jan Subversion 25/64WW Winter School 2013 But I didn’t want to delete it! If you svn deleted now want it back to have it available in future revisions/checkouts, need to undo the commit. This can be done using svn merge but specifying the revision numbers in reverse order (reverse merge). $ svn merge –r12084: Reverse-merging r12084 into '.': A old_script.sh $ svn status A + old_script.sh $ svn commit –m “undoing deletion in r12084” Adding old_script.sh Transmitting file data.... Committed revision r12087.

Version 1.2, Jan Subversion 26/64WW Winter School 2013 Undoing local changes If you haven’t committed changes: svn revert If there are no targets, svn revert will do nothing. IOW: revert will make you lose any local changes you have made. $ svn status changed_script.sh added_script.sh A added_script.sh M changed_script.sh $ svn revert changed_script.sh added_script.sh Reverted ‘changed_script.sh’ Reverted ‘added_script.sh’

Version 1.2, Jan Subversion 27/64WW Winter School 2013 Checking file status svn status check the status of a file in your working copy: Check if you have made any local changes. Check for new changes in the repository (-u flag) Local-changes case: $ svn status ? SensorInfo ! source.comment M osrf__load_viirs.pro D viirs-i_npp-S1-04.inp A viirs-iS1 A + viirs-iS1/viirs-i_npp-04.inp The “?” indicates this is an unversioned file in your working copy. The “!” indicates this is a versioned file that is missing from your working copy. The “M” indicates this file has been locally modified. The “D” and “A” indicate these are versioned files that have been scheduled for deletion and addition respectively. The “A” with the “+” in the 4 th column indicates this file has been scheduled for addition with history.

Version 1.2, Jan Subversion 28/64WW Winter School 2013 Checking file status Use svn status to check for changes in the repository: $ svn status --show-updates #or -u M CRTM_Fastem4.f90 ? Reflection_Correction.f90 * 9675 SensorInfo/SensorInfo * 9675 MW_SensorData/MW_SensorData_Define.f90 * Create_SpcCoeff/Create_SpcCoeff.f90 * Create_SpcCoeff/Makefile * Create_SpcCoeff/make.dependencies Status against revision: With a trailing revision number, the 8 th column ‘*’ indicates the local file is outdated (there’s a newer version in the repository). With no trailing revision number, the ‘*’ in 8 th column indicates a file was added to the repository, but never existed in the working copy.

Version 1.2, Jan Subversion 29/64WW Winter School 2013 Updating files After changes are done, you want to commit them to the repository, but what if another user has changed and committed the same file(s)? Communication between developers is important Use of svn status helps the process Subversion handles this potential “overlap” by requiring you to update your working copy to the current repository version before you can commit. This merges changes (assuming no conflicts) found in the repository (only run_modelX.sh) into your working copy. $ svn update run_modelX.sh U run_modelX.sh Updated to revision 12034

Version 1.2, Jan Subversion 30/64WW Winter School 2013 Updating files: solving conflicts What if your svn update subcommand produces the following: Look at the svn status output: $ svn update run_modelX.sh C run_modelX.sh Updated to revision $ svn status ? run_modelX.sh.mine ? run_modelX.sh.r11987 ? run_modelX.sh.r12034 C run_modelX.sh The file as it existed in your working copy prior to the update This is the file that was the BASE revision before the update. That is, the file that was checked out before the latest edits. This is the file that the Subversion client just received from the server due to the update. This file corresponds to the HEAD revision of the repository. The merged file containing the conflict between conflict markers: >>>>> ===== <<<<<

Version 1.2, Jan Subversion 31/64WW Winter School 2013 Updating files What if there is a conflict? To resolve conflicts we use svn resolve with --accept 1. To keep the version that you last checked out before your edits (in example the.r11987 file), use base argument 2. To keep the version that contains only your edits (the.mine file), use the mine-full argument 3. To keep version update pulled from the server (.r12034 file, discards all your edits), use theirs-full 4. To edit the conflicted text “by hand” (follow conflict markers) and use working $ svn resolve --accept base run_modelX.sh Resolved conflicted state of run_modelX.sh $ svn resolve --accept theirs-full run_modelX.sh $ svn resolve --accept mine-full run_modelX.sh $ svn resolve --accept working run_modelX.sh

Version 1.2, Jan Subversion 32/64WW Winter School 2013 Updating files What if there is a conflict? Another option is to throw out your changes and start your edits over again, run svn revert If you choose to revert to avoid the conflict, you do not have to run the svn resolve subcommand. Remember though: Using svn revert will discard all your local edits! $ svn revert run_modelX.sh Reverted ‘run_modelX.sh’

Version 1.2, Jan Subversion 33/64WW Winter School 2013 Committing files When working copy is up to date, commit changes to the repository using svn commit Subversion will start an editor allowing you to enter a log message that describes the change. Briefly describe changes and why they were made. Shared format allows logs to become ChangeLog files. Exiting the editor, Subversion will commit changes to the repository, where they will become the latest version of the shared code, visible to all users. $ svn commit run_modelX.sh Sending run_modelX.sh Transmitting file data Committed revision

Version 1.2, Jan Subversion 34/64WW Winter School 2013 Trunk to branch merges: Why? Best Practice: Frequent updates on branches minimize the likelihood of conflicts (the branch will be merged back into the trunk someday, right?) Usually referred to as “sync” [with the trunk] Also makes available to the branch any updates or bug- fixes that have been implemented in the trunk (or merged into the trunk from a different branch.) Each development team needs to determine the “best” frequency of regular trunk  branch updates. Once a week? First merges may be a painful experience, but persistence pays off for all! Next: Zen & the Art of Merging (or, How is it done, now?!)

Version 1.2, Jan Subversion 35/64WW Winter School 2013 What is merging? (1) From the Subversion manual: Subversion’s differencing algorithms work on text (including non-English, non-Roman alphabet languages apparently) as well as binary files. Even though subversion’s diff subcommand only provides output for textual differences, internally subversion can handle binary file differences efficiently between versions. The main source of confusion is the name of the command. The term “merge” somehow denotes that branches are combined together, or that there's some sort of mysterious blending of data going on. That's not the case. A better name for the command might have been svn diff-and-apply because that's all that happens: two repository trees are compared, and the diffs are applied to a working copy.

Version 1.2, Jan Subversion 36/64WW Winter School 2013 Merge command syntax (v1.4) Examples of svn merge : Specifying all three arguments explicitly Shorthand (comparing two different revisions of same URL) Working-copy argument optional (defaults to current directory) $ svnmerge \ \ \ my-branch-working-copy $ svnmerge-r 100:200 \ $ svnmerge-r 100:200 \ \ my-branch-working-copy We’ll be discussing this form for the trunk-to-branch merging

Version 1.2, Jan Subversion 37/64WW Winter School 2013 Merging the first time (1) 1. Determine the trunk revision from which the branch was created; let’s say it was Determine the current trunk revision in repository; say it is 1050 ( svn also recognises HEAD for this case). 3. Test the merge subcommand with --dry-run switch, This will list all the changes that will occur, without actually doing anything to your branch working copy, so you can see if there are any conflicts. $ svn merge --dry-run \ -r 1001:1050 \

Version 1.2, Jan Subversion 38/64WW Winter School 2013 Merging the first time (2) 4. If there are no conflicts, or their number is reasonable (more later), reissue merge without the --dry-run switch to perform the merge in your branch working copy. 5. Deal with any files in conflict and resolve them. 6. Commit the merge changes with a useful log message. $ svn commit-m \ “Synced EXP-TestX branch with latest trunk r1001:1050”

Version 1.2, Jan Subversion 39/64WW Winter School 2013 r1001 EXP-TestX Merging the first time (3) Trunk r1000 r1010 r1021 r1015 r1050 r1054 $ svn merge –r 1000: $ svn commit –m “EXP-TestX branch. Merged trunk r1001:1050” The Art of Merging (or, how was that done, now?!) Work copy (local) commit svn commit svn merge svn co svn cp

Version 1.2, Jan Subversion 40/64WW Winter School 2013 Trunk to branch merges: Next time 1. Determine the end revision of the last trunk merge into the branch by looking at the log message for the branch, In our example that was Follow the same procedure as for the first time. Without manually tracking the merged revisions in the commit log message, there is no simple way to determine which revisions from the trunk have been merged! If you remerge previously merged revisions, you will typically get many, many conflicts. If this happens, it’s a clue that the merge revision range is probably incorrect. $ svn log | more 40 v1.4

Version 1.2, Jan Subversion 41/64WW Winter School 2013 Handling merge conflicts (1) What if your svn merge produces the following: Look at the svn status output: 41 $ svn status ? run_modelX.sh.working ? run_modelX.sh.merge-left.r1001 ? run_modelX.sh.merge-right.r1050 C run_modelX.sh The file as it existed in your working copy prior to the merge. This is the initial, or “left”, side of the double tree comparison. This is the final, or “right”, side of the double tree comparison. Merged file with the conflict between conflict markers: >>>>> ===== <<<<< $ svn merge -r 1001:1050 \ C run_modelX.sh

Version 1.2, Jan Subversion 42/64WW Winter School 2013 Handling merge conflicts (2) To resolve the conflict svn resolve with --accept 1. To keep the version that exists in your branch, use the mine-full or mine-conflict argument 2. To keep the version that was pulled from the trunk, use theirs-full or theirs-conflict 3. To edit the conflicted text “by hand” (follow conflict markers) and use working 4. Typically, you never want to use the base argument in this case. 42 $ svn resolve --accept theirs-full run_modelX.sh $ svn resolve --accept mine-full run_modelX.sh $ svn resolve --accept working run_modelX.sh

Version 1.2, Jan Subversion 43/64WW Winter School 2013 The TRAC Wiki The TRAC wiki: using your new friend to help out understanding what’s going on  Directly linked with svn repository change log  Real-time availability of information about repository dynamics Major features  General information page (wiki)  Timeline  Roadmap: milestones, model versions  Browse source  View repository structure  View change sets and logs  Tickets  Viewing  Opening new

Version 1.2, Jan Subversion 44/64WW Winter School 2013 Best practices For those who want to modify / contribute to WAVEWATCH III, a best practices guide is available.  Link via the wiki page of the SVN TRAC Note that as a part of the license, additions made to the model have to be offered to NCEP for inclusion in future model distributions. Best practices cover :  Programming style  Adding to the model.  Manual and documentation.  Subversion repository.  Regression testing. Best practices guide

Version 1.2, Jan Subversion 45/64WW Winter School 2013 Best practices Common SVN Server Practice Server will follow the structure:  trunk – will contain the “developed” WW3 version  branches – contain the under-development codes  tags – contain relevant static copies, snapshots of the trunk (before branch reintegrations etc)  sandbox – area for development that may diverge from trunk  released – area for tags pointing to release versions

Version 1.2, Jan Subversion 46/64WW Winter School 2013 Best practices Common SVN Server Practice Branch philosophy  Active development areas  Should remain in sync with the trunk  Regular sync  Sync after new trunk is announced  Should only be created by admins  Will be full copies of the trunk  Contain preferably only one development item (ie, ST4, BT4, nonlinear interactions, multigrid, esmf, nrltest etc)  Branch names will reflect such “function”  If changes require new switch: request to admins  Recommend: local copies should be full branch copies  Use the install_ww3_svn_trunk script

Version 1.2, Jan Subversion 47/64WW Winter School 2013 Best practices Stable version complete: back to trunk Before reintegration  Branch is fully tested  Branch is in sync with the latest trunk Communicate to admins that a branch reintegration is needed/imminent with some notice (at least a few days) Branch reintegration can only be done by svn admins After reintegration Any conflicts should be solved by the admins  But these will not exist since you will have tested, right?  The clean new trunk on a local admin copy will be regression tested  All good, the new local trunk is committed (we go out for beers and one ginger ale) All branches are synced with the new trunk

Version 1.2, Jan Subversion 48/64WW Winter School 2013 Best practices Common SVN Server Practice Bugfixes  Special case of changes to code  Developers should communicate bugs that are common to other parts of the code  A Ticket will be created  A branch will be created for fixing that bug  The branch will be reintegrated to trunk  The bugfix will be propagated to all branches via regular synchronizations

Version 1.2, Jan Subversion 49/64WW Winter School 2013 Best practices Programming style: Use WAVEWATCH III documentation style (see templates). Developers, responsible for integration in the data structure: do only after rigorous testing of self-contained system. Use coding style:  Free format but layout as in old fixed format.  Upper case for permanent code, lower case for temporarily code. Maintain update log at header for documentation. Embed all subroutines in modules or main programs, using naming convention outlined before. Follow FORTRAN 90 standard, with best practices as outlined in section 2 of the guide.

Version 1.2, Jan Subversion 50/64WW Winter School 2013 Best practices Manual and documentation. Provide full LaTeX documentation for inclusion in the manual:  NCEP svn users have access to manual, and are expected to add to it directly.  NCEP will provide editing.  Others provide separate files.  NCEP will integrate.  Use BibTEX.  Use dynamic references to equations, figures and tables only.

Version 1.2, Jan Subversion 51/64WW Winter School 2013 Best practices Testing Regression testing are based on previous WAVEWATCH III tests and new materials and tools provided by Erick Rogers and Tim Campbell from NRL Stennis.  nrltest, will replace current test directory in near future

Version 1.2, Jan Subversion 52/64WW Winter School 2013 The end End of lecture