MASARYK UNIVERSITY FACULTY OF INFORMATICS

Master’sThesis SCM – Configuration Management Marek Bokes 2006

Declaration

Ideclarethatthisthesisistheoriginalauthor’swork;doneindependentlybymyself.Allthe data,informationandresourcesaswellaspublicationsusedwithintheworkarequotedwith aqualifiedreferencetotheorigin. Supervisor: Mgr.MiroslavKubásek

ii

Acknowledgements

ThiswayIwouldliketothanktothethesissupervisor,toMgr.MiroslavKubásek,forallthe guidelinesandwillingness. Furthermore,mythanksgoestoUdoWeberaswellastoHendrikHempelforthe consultationsregardingreleasemanagement.

iii

Syllabus

Sourcecodeandconfigurationversioningitselfaswellaslabellingtechniqueiswidespread inITworldofsoftwaredevelopment. Thehavegotfullcontroloverreleasemanagementandconsequentlyoverdeployment processitrequirestheproperandsuitableusageofaversioningsystem.Onlywithfull controlandappropriateusageareleasemanagementcan’tbecameaseriousbottleneckofthe deliveryprocess. Asasolutionthismaster’sthesisprojectbringscomprehensivepackage–asetofdefined approachofsoftwareversioningandreleasemanagementbesidescooperationwithabug trackingsystemononehand,andtoolstofollowthisapproachup,i.e.enablethistohappen inpraxis,ontheotherhand. Toolstoworkwithversioningsystemareprovidedforbothdeveloperandconfiguration (release)managerforspecificplatformandversioningsystem.

iv

Keywords

SoftwareConfigurationManagement,SourceCodeVersioning,SoftwareDeployment Approach,SoftwareReleaseApproach,CVS,BugTrackingSystem(Tool),Software Release,Tag,Label,Revision,ConsistencyChecking

v

Preface

"Source Control is as much a way of thinking about software development as it is a tool. It can facilitate parallel development and enable developmental isolation, but it can ensure neither. Only by establishing and following through on a strategy can a team use Source Control to its fullest potential " TheCorporation Themanagedwayofsourcecodeversioning(alsoknownassourcecoderevisioncontrol)is tobeassumedasageneralmethodologyofsoftwaredevelopmentnowadays.Thisallis coveredbythesoftwareconfigurationmanagement(SCM),whichunderliesthegeneral configurationmanagement(CM). BesidesprojectmanagementtheareaofSCMhasquitesimilarimportance.Itsabsencevery likelyleadstoseriousissuesduringsoftwarequalityassurancecheckpointsorduringa deliveryprocessingeneral.Theeventualexpositionisincreasedtimetodeliverofbudget cost.Forfixpriceprojectthiswouldbeadisaster. TheamountofresourcesrelatedtoSCMorCMingeneralisquiterich,unfortunately oftenoffersonlytoogeneralpointofvieworobviousfacts.Ifonesearchesforspecificand directlyapplicablemethodologyhewillfail,Iassume.Mysuchresearchandinvestigationin theareafailedeither. RoughideaoflabelspromotionwhatI’mawareofcomesfromapproachimplementedupon versioningsystemofnameClearCasefromtheRational 1company.Theversioningsystem itselfisstrictlycommercialandexpensive,onotherhandthedetailsoftheapproachwerenot exposedtomeoranypublicduetoitsproprietarynature. WithkeepingtheSCM’simportanceinmindandbasedonabsenceofthirdpartysolutionto useortobuildon,thismaster’sthesisprojectsetstoitselfanambitiousaimtoprovide(if possible)generalizedversioningapproachandasetoftoolstotechnicallysupportthat.

1Note:TheRationalCompanydevelopedseveraltoolstosupportdevelopment,mainlytoincreasecodequality; inmajorityforUNIXsystem.ThecompanyhasbeenboughtbyIBM. vi

Table of contents

1 Introduction ...... 1 1.1 Overview ...... 2 1.2 Terminology ...... 2 1.3 Commoninappropriateusageofaversioningsystem ...... 6 1.3.1 Casestudy ...... 7 2 Source code versioning approach ...... 8 2.1 Generalassumptions...... 8 2.2 Maingoalsoverview ...... 8 2.3 Actors ...... 9 2.4 Predefinedlabeltags ...... 10 2.5 Whoisapplyingthelabel ...... 10 2.6 Dispositionoflabels...... 10 2.7 Whentolabel...... 10 2.8 Whentolabelforafirsttime...... 10 2.9 Thedefecttrackingcycle...... 12 3 Preparing a release – deploying with versioning system...... 13 3.1 Considerationsforfollowingexample...... 13 3.2 Theapproach ...... 13 3.2.1 Zerothstep–putnewreleaselabelacrossrepository...... 13 3.2.2 Stepone–extractlistoffilestobereleasedfrombugtrackingtool...... 14 3.2.3 Steptwo–movethenewreleaselabel,i.e.promotetherevision...... 14 3.2.4 Stepthree–obtainallfilesofnewrelease ...... 16 3.2.5 Stepfour–buildthereleasepackage ...... 16 3.2.6 Stepfive–completion...... 16 4 Branching approach ...... 17 4.1 Generalassumptions...... 17 4.2 Proposedsolution ...... 17 4.2.1 Whentocreateaseparaterepository ...... 17 4.2.2 Howtocreateaseparaterepository...... 18 4.2.3 Howtoworkwithseparaterepositories–theapproachbasis ...... 19

vii

5 The tools ...... 20 5.1 Generalassumptions...... 20 5.2 Targetversioningsystem...... 20 5.3 Preimplementationconsiderations...... 22 5.3.1 Therepositoryaccessapproach...... 22 5.3.2 CVSrepositorydatabaseformatfiles...... 22 5.3.3 CVSrepositorydatabaseformatfolders...... 24 5.3.4 CVSrepositorydatabaselocation ...... 24 5.3.5 CVSlocalcheckedoutcopyadminstructures...... 24 5.3.6 Theprogramminglanguage...... 25 5.4 Theimplementation...... 25 5.4.1 Commonfunctionality...... 26 5.4.2 Thedeveloperspacetool–mklabel ...... 27 5.4.3 Thereleasemanagerspacetool–cvs_rcheck ...... 28 6 The conclusion...... 33

7 Literature and resources...... 34

A Appendix ...... 35 a. Thecvs_rcheckscriptoutput...... 35 b. AnexampleofhistorygraphofafileinVSrepository...... 36 c. Themklabelinaction ...... 37

viii SOFTWARE CONFIGURATION MANAGEMENT

1 Introduction

Thesourcecodeversioningitself,oralsoknownasrevisioncontrolisnothingspecialtobe explainedthesedays.Thuslet’sjustbrieflymentionthatit’sbasedonprincipleofseveral versions–socalledrevisions–ofthesameobjectorunitofinformation;intheareaof softwareengineeringit’stypicallyasourcecodeofconfigurationfile,binaryobject respectively.Arevisionisordinarilyidentifiedbyitsnumber.Ontopofthisthereliesa conceptofmarkingarevisionbyatag,creatingsomekindofalias,virtualrevisionidentifier, thelabel.Thishappensonssinglefilelevel;whileit’sanorganizedgroupofversioned objects,togetherwithwrapperhandlingversioningoperations,it’stobecalledrepository,or versioningsystemrespectively. Theversioningsystemaimstostorerevisions,butthisisnotstandalonefunctionality.This wayitprovidesoverviewofchangesdone,whenandwhomby–importantthing,butthe focustomentionistheideatoassistorsupporttheproject(application)build,whichisapart ofreleasemanagement. Thereleasemanagementhasbuildsuponversioningsystemandprovidesasanoutcomethe (software)release.Releaseisbasicallythedelivery. Todelivertherelease,italwaysgoesthroughseveralprojectstages,i.e.theteststagefor instance.Toeachstage,toeachitsenvironmentthereleaseshallbedeployableassmoothly aspossible.Anyunexpectedmajorissuecosttheprojectalotfromprojectmanagementpoint ofview. Deploymentisergooneofthesignificantpartsofthedeliveryprocess.Butit’sfully dependantonthereleasequality.Thedependencyconsequentlydescendsincascadetothe versioningsystemusage.Thisistobecontrolledbythereleasemanagement. Sotherésuméisthattohaveafullcontroloverdeploymentandtoavoidanyissuesduring thatrelatedtoqualityandthefullnessofthedeliveredrelease,thereleasemanagementis majoractor.Versioningsystemshallsupportthereleasemanagement,buttheprerequisiteis therightinformationabouttheversionedobjects.Andthisneedstobestoredbythemost appropriateactor,bysomebodywhoactuallydoestheversioningsysteminteractionfrom bottomperspective–bythedeveloper. Whilethereissetapproachoftasksandstepsforeachactorandthetoolstakeplace,the releasequalityassuranceisamust,inheritedconsequentlytothedeploymentprocesseither. Thismaster’sthesisprovidesboth–theapproach(ormethodology)tofollowupbytheactors andthetoolstointeractwiththeversioningsystemandchecktheconsistencyofversioned data. Thedeploymentprocessthiswayemploysthereleasemanagementbasedonrevisionscontrol toachievedesiredqualitythedelivery. 1 SOFTWARE CONFIGURATION MANAGEMENT 1.1 Overview

Thismaster’sthesisreportdealswiththetoolsandtheirimplementationinthelastfew chapters. Theversioningandreleasemanagementapproachissetupafterthetermsareexplainedtothe reader. Thereportbeginswithtotheterminologyexplanationfollowedbyexamplesofimproper versioningsystemutilisation(asobservedthisisrighttobementionedduetoitsstill occurrenceintherealpraxis). Thewayofpresentationofthetermshasbeenchosentobeasmuchclearandstructuredas possiblewithfocusonvisualinterpretation 2. Theexperienceshowsthevisualinterpretationismuchmorecomprehensiblethenaplain text.BestinstanceofthisapproachisITworld’sfocusonUMLnowadays.

1.2 Terminology

Project acompilationof(source,configuration,binaries,dataetc.)fileswhichmakethe mainapplication,e.g.ApacheHTTPserverincludingallmodules,oradatawarehouse applicationconsistingfromcombinationofshellandPL/SQLscripts;technicallyany combinationoffiletoenabletheapplicationtorunwhendeployed. Delivery compiledapplication/projectincludingallnecessaryfiles 3neededforruntime, configurationfile(s),allotherfiles 4supposedtobeincludedinapplicationpackage, installationtoolandit’sseparateconfigurationeventually,releasenotesdocument, installationhintsassocalledREADMEfile. Source code –commonlyaplaintextfile;basicallyasinglefilecontaining(source)codeto becompiledintoaproject. Binary object –binaryfileingeneral;instances:precompiledexecutable(deliveredbythird partyforexample),sharedobjectorlibrary(thirdparty)anypartofadeliveryofnonplain textnature Versioning system (VS)asystemwhichprovidesfunctionalitytostore,retrieve,compare, annotateandotherfunctionalityuponanobject 5tobeversioned;possiblyawrappedonsingle filerevisioncontroltool. Repository (REPO)–structuredandorganizedgroupofversionedobject,adatabasewhere versioningsystemstorestherevisionsofeachversionedobject;typicallyflattextfilebased database,oftencapabletobeparsedbyexternaltools

2tofollowthisIdarehaveprepareddrawingstovisualizethediscussedmatter. 3libraries,sharedobjects,scripts,thirdpartydeliveredbinariesetc. 4examples:licensefile,datafilesetc. 5(mainly)plaintextfiles(sourcecode,scripts,configuration,data)aswellasbinaryfiles(executables,libraries, binarydata,archivesetc.) 2 SOFTWARE CONFIGURATION MANAGEMENT Repository module logicalpartitionofrepositoryrepresentedbythename,commonlyit’s subfolderofrepositoryofsuchaname(e.g./dba);aliascanbeconfigured foramoduleforeaseofuseortocheckoutalistofmodulesonasingletokendemand,e.g.: /dba_module; dba_module~dba /appl_module,/lib_module; appl_module,lib_module~project) Revision internalversionofasinglefilewithidentifierofnumberofformatX.Y,whereX representsmajorrelease/functionality/branchnumberandYisinternalversioncounter (technicallyY th update/revisionofafileunlesssetexplicitlydifferentway) Figure 1.1 Shows growth of single file revisions number

Version –i.e.asoftwarerelease,usuallydifferentandindependentfromanyrevisionnumber, releaseasasoftwarepackagecontainsdifferentrevisionsofsinglefiles;theformatisfor instanceX.Y[.Z],whereXismajorreleasenumber(mainfunctionalitysignificance),Y meansminorreleasenumber(iterationstofix/improvetheXversion),Zstandsforeventual hotfixversionflag. Label (tag) –considerableasasymbolicrevision,chosen(alphanumerical)tokenoccurring onsinglefilelevelandpointstothespecificrevisionofsinglefile,pointsonlytoonerevision atatime,usuallythesamelabelwhichregardssinglereleaseversionpointstodifferent revisiononasinglefilelevelfordifferentfiles6.Singlefileisabletohasgotmultiplelabels present–eachcapablepointeithertothesamerevisionortothedifferentone 7.

6thereasonisthatnoteveryfileisbeingupdatedwiththesamefrequency 7eachoflabelsappearingonasinglefilecanrepresentdifferentreleaseversionswherethesinglefileis participatingin;onotherhandthesamerevisioncanbeusedforseveralreleases(usuallyinrow)andupdated forsomelaterversion,e.g.:r1.1>v1.0.0;r1.2>v1.1.0,v1.2.0,v1.3.0,v1.4.0;r1.3>v1.5.0 3 SOFTWARE CONFIGURATION MANAGEMENT

Figure 1.2 Label(s) presence on single file

Figure 1.3 Label presence from repository point of view; every single file has got the same label, but pointing to the different revision file1.c file2.c file3.c file4.c file5.c

1.1 1.1 1.1 1.1 1.1 LABEL

1.2 1.2 1.2 1.2

1.3 1.3 1.3 1.3

1.4 1.4 1.4

1.5 1.5

1.6

4 SOFTWARE CONFIGURATION MANAGEMENT Figure 1.4 Shows how the label puts different revisions of different files virtually to one line. The line represents one specific release.

file1.c file2.c file3.c file4.c file5.c

have a look at 1.1 this ‘level’

1.2

1.1 1.3

1.1 1.2 1.4 1.1

1.2 1.3 1.5 1.2 1.1 LABEL

1.3 1.6 1.3

1.4 1.4

version 1.5 e.g. release v1.1.0

Label moving –technicallymeansachangewherethelabelispointingto.Whenthelabelhas beenmovedpointstootherrevisionofthesamesinglefile.Technicallycouldberealizedas atomicremovalofexistinglabelandcreationofanotheronewiththesamename.Example situationwhenthelabelmovingisneeded:developerdidputanupdatedfileafterabug fixingintoaversioningsystemandnowneedstolabelthenewcreatedrevisionastestready (insteadofthepreviousone).

Figure 1.5 The situation when head revision of the file has been promoted to be test- ready.

5 SOFTWARE CONFIGURATION MANAGEMENT Check-in –aliasforcommitinversioningsystemworld;putsnewrevisionofversioned objectintotheversioningsystem.Commonprerequisiteisthatversioningsystemneedsto knowtheobject,i.e.itneedstobeaddedfirstly. Check-out –getslocal(socalledworking)copyofaprojectfromversioningsystem.Checked outcanbewholeproject,moduleorsubfolder.Manyversioningsystemssupportsinglefile checkout.Ingeneraltechnicallyitcreateslocalcopyaswellaslocalcontrolstructuresof versioningsystemanditstools. Update –getsspecificorlatestrevisionoffile(orfiles)fromversioningsystem;updates localcopies.Donotmismatchwithrepositorysideupdate,i.e.checkin.Common prerequisiteischeckedoutstructurewherethefile(s)locatedis(are). Defect (DT)anybugwithinthesoftwaretobedelivered8 Change request (CR)anyrequestedchangeinthefunctionalityorcodenotbasedonafound defect,inotherwordsanyupdateoffunctionalityorcodebasedonrequesttomodifyoriginal requirements

1.3 Common inappropriate usage of a versioning system

Usagesimilartocentralstoragepoint • miscellaneousfilesarebeingcheckedinwithouthavinganystructuredapproach;not followingany(orjustweak)namingconventionforfiles,directoriesandrepository modulesneither • revisionsofthefilearenotstoredasanothercommitsofthesamefilenamebutas severalcheckedinfileswithdifferentfilenamecontainingsomepostfixdeclaringa version Labellingusagemisunderstood,rareornone • releasesourcecodeischeckedoutformversioningsystem,built,packaged 9and consequentlythepackageischeckedinintoaVSandlabelledastherelease (excellentwrongversioningapproachinstance;touseVSforareleasepackage storageisquiteok,butthelabellingconceptiscompletelymisplacedwhileusedin suchawayandshouldtakeplacemuchsoonerbefore) Developer’ssemifinishedworksavedintoaversioningsystem,whatpreventsthefreshly checkedout(thelatest)projectversionevenfrombeingbuiltorcompiled; NewversiontobereleasedconsideredasthesetoflatestrevisionsanditsretrievalfromVS exactlyinthismannerby“getlatest”functionality(command).

8tobeconsideredasanofficialdefect,notonefoundduringunittest,usuallyfoundduringanofficialproject’s testphase 9usuallypackagedoesnotcontainapplicationsourcesbutbuiltbinaryobjects;howeverevenifpackageconsists onlyfromsomeplaintextfiles(ofscriptsforinstance)themethodologyofthiskindiswrong 6 SOFTWARE CONFIGURATION MANAGEMENT 1.3.1 Case study

(Note:Thefollowingcaseisnotarealcasestudyinrightsenseotheexpressionduetothe factitreallyhappened) Thedeploymentofnewversionontheapplicationtothetestingenvironmentwastriggered bytheregularschedulesetupwithintheproject.Thatrequestedthenewreleasetobebuilt. Releasemanagerannouncedthecodefreezetimelineandatthecertaintimeputalabelacross therepository,taggingaltheheadrevisionsastheonestobereleasedasthenewapplication version.Onwardheretrievedthereleaseformversioningsystemandbuiltitintotherelease package.Thepackagewasdeployedtothetestingenvironment. Shortlyafterwards,duringfirsttestanewcriticaldefectwasfoundandraised.Theteam decidedtodeliveranondemandhotfixduetoquickpossibilitytofixthat.Theresponsible developerperformedthedefectfixinsourcecodelevel,didcommitthechangeintothe repository.Releasemanagerissuedextrahotfixedreleasewiththesameapproachasrecently fortheregularrelease,whatwasdeployedtothetest. Immediatelytheblockingissuewasraisedandthecompleteendtoendtestingstoppedfor theday. Investigationfoundthereason:duringthehotfixingsomeotherdeveloper(s)didcommitsof sourcecodenotsupposedtobereleased.Butwithouthavingapproachtoselectspecific revisionforthereleaseonsinglefilelevelaswellaswithoutanyconsistencycheckthey didn’thavecontroloverthedeliveredcontent.Bythisthedeploymentcompletelyfailed. Thisexamplecaseshowsclearlytheneedofappropriateusageofaversioningsystemanda needofwelldefined,structuredandclearsoftwarereleasemanagement,i.e.goodsoftware configurationmanagement,whichissubjecttotheoveralldeploymentprocessand applicationdelivery. Thismaster’sthesisprojectassetshallpreventsuchaissuesfromhappening.

7 SOFTWARE CONFIGURATION MANAGEMENT

2 Source code versioning approach

2.1 General assumptions

(Tobecomprehendedastherequirementsontheapproachitselfandonthesoftwaretools lateron) Approachsupportsthereleasemanagementwhichisemployedbythedeploymentprocess fromdeliverypointofview. Allchangesorupdatesaretobetrackedinadefectorchangerequesttrackingtool.All requestedandchangesdoneneedtobeenteredinthere. Adeveloperisrequestedtofillintoabugtrackingsystemalistofnew,changed,removed filesand/ordirectoriesrelevanttothedefect/changerequestwhilehe(she)describesthebug fixsolution.Pathsaretoberelativetocheckoutpoint. Thedeveloperisrequestedtocommitworkdaily.Theminimalextentofcheckedinupdateis topreserveabilitytocompiletheapplication/projectwhileanyteammemberchecksoutthe latestversion.Ideabehindistosafelystorealltheworkdonetoavoidanytime(resources) loss(andmoneylossconsequently).Onotherhandthereneedstobeasolutionhowto‘mark’ arevisionasreadytobetestedorreleased,becausecommonlyitwon’tbethelatestone always. Moreover,thereisaneedtoseparateadeveloperfromusingvariousversioningsystem commandsandparametersduetolabellingpurposesaswellasfromenteringthelabel manuallytoavoidanyincorrectness,evenjustmistyping. Finally,thereleasemanagerhastohaveanabilitytochecktheconsistencybetweena versioningsystemandabugtrackingtool.Thisissupposedtobeasmuchautomatedas possible.Onerepositorycouldcontainseveralsystems(modules)includedtotheproject (application),butthereleasecanregardsinglemodule,subsetofmodulesrespectively,thusa featuretoskipacheckoflistofmodulesisrequired.

2.2 Main goals overview

Let’sgoshortlythroughthelistinthestructuredway: • includetothereleaseanddeployconsequentlyonlyandonlythefilesoftherevisions whicharesupposedtobethere • enableatanytimepreciseoverviewwhichrevisionsofthefilesmaketherelease

8 SOFTWARE CONFIGURATION MANAGEMENT • enableretrievalofanyversionreleasedinpastondemandinfuturewithoutexplicitly spenteffort • makepossibletobeinlinewithstatusinbugtrackingtool • catchupanyinconsistencybetweenversioningandbugtrackingsystem • topreserveabilityofadeveloperdoanothercommitsaftertheoneconsideredastest readywhilethereleaseconsistencyisnotharmed • basicallyhavethefullcontrolovertheobjectsreleasedandtherevisionchosenona singlefilelevel

2.3 Actors

Human: Thebasicroleisthe developer (DV).Heiswhoprovidesthecontenttoversionandfurtherto bereleased.Heknowstheobjecttodeliver,thusheprovidestheinfowhichitsrevisionisthe onetobelabelled,i.e.released. Configuration manager (CM)istheactorwhocheckstheconsistencybetweenversioning systemandbugtrackingtool,performsneededinterventions. ReleaseManager(RM)ispreparingthereleasebyemployingthedata(tags)setbythe developerandappliesthelabellingtechniques.Frequentlytheroleiscombinedwith configurationmanager,definitelynotexclusiveagainstroleofdeveloper(generalsituationon smallsizedprojects). Code migration responsibleperson(MR)theoneresponsibleformergingchangeswithin differentdevelopmentalbranched.Inourproposalformergingbetweenrepositoriesof modulesrepresentingdifferentmajorreleases. Application: Versioning system (VS)–canstandforalmostofanykindofrevisioncontrolsystemcapable ofthelabellingandlabelmoving Bug tracking tool (BT)canbeatoolwhichprovidesfunctionalityofDFsorCRsrecordswith savingthestatusandcommentpossibility.Includedaccessandusermanagementsuitsmore aswellasanextradatatostore,theenvironmentforinstance. (Note:rolesarenotexclusivetoeachother,perhapsonlythegroups)

9 SOFTWARE CONFIGURATION MANAGEMENT 2.4 Predefined label tags

Basicallytherearetwokindsofalabeltoconsider.Fromthedeveloper’ssideit’sthe test- ready label(e.g.testready).Releasemanagertakescareofthe release label (e.g.v1.1.0 10 ).

2.5 Who is applying the label

Thetestreadylabelistobeappliedbyadeveloper.Incaseofconsistencyfixthelabelcanbe applied(moved)bythereleasemanager. Thereleaselabelistobeappliedbyareleasemanageronly.Nodeveloperisallowedto interactwiththereleaselabel(s)inanywaytopreservetheconsistentstate.

2.6 Disposition of labels

The test-ready labelissupposedtobemovedbecausetherewillnextdifferentrevision readytobereleased,deployedandtested.Atanynewrevisiontobetested(deployed) occurrencethelabelhastobemoved. Inopposite,the release label issupposedtopointtothesamerevisionafterhasbeenfinally applied 11 –it’sconsideredasastillorstickylabel.

2.7 When to label

Labelwiththe test-ready tagwhenanew(updatedrespectively)revisionofafileischecked inintoVS(it’sthelatestrevisionatamomentinfact;butthiswouldn’tbenecessarily fulfilledinfuturethat’sthereasonwhyweneeda‘checkpoint’,technicallyspeakinga label). Labelwith‘release’tagwhenanewreleaseisbeingbuilt. Refertothe“Defecttrackingcyclediagram”belowtocheckcertainpointstoapplythelabel. Applyinganyextralabel 12 (duetocommittedthirdpartyforinstance)is(concurrently) possibleanytime.

2.8 When to label for a first time

Duringfirstphaseofadevelopmentprojecttherearejustunittestsintheplaceandno softwarereleases,thuslabellingisneededjustlateron. Thetriggertostartlabellingistherequestofveryfirstprojectversionrelease,commonly priortofirsttestphase,e.g.beforeFAT 13 .‘Codefreeze’14 timelinehastobeintroducedat

10 technicallywouldn’tbepossibletostoreexactlyinformof‘v1.1.0’forinstance;ifso,commonlabelslook like‘V1_1_0’instead 11 Beforefinallyappliedthelabelingmethodologyenforcesoncetomoveofthereleaselabel–thepromotionto thenewrelease. 12 labelcouldbeforinstance‘PATCH_NO0123456’ 10 SOFTWARE CONFIGURATION MANAGEMENT thistimebasedcheckpointallsoftwarerevisionsareconsideredastestready,i.e.labelled withtestreadylabel.Forpurposesofveryfirstreleaseallfileswithtestreadylabelare labelledbythereleasetag. Figure 2.1 Labelling has been applied for the very first time. There is no other release label except initial-version and test-ready label, both pointing to the same revision of a single file.

13 FAT~FactoryAssemblyTest;singlemoduleofsystemincludedtoprojectisbeingtestedwithout interconnectivitynorinteractionwithothermodulesorsystems;maximallythestubsareused 14 ‘codefreeze'isanexpressionfordisallowanceofanothercodecommitstoversioningsystem;aneedforthis popsupwhenthefirstreleaserelatedlabelsaregoingtobeapplied(testreadyandreleaselabel,e.g.v1.0.0); becausetherewasnotestreadyrevisionsofar,theonedeliveredat‘codefreeze’timeistheone 11 SOFTWARE CONFIGURATION MANAGEMENT

2.9 The defect tracking cycle

Thediagramrepresentstheactionsflowandshowswhenandwhattolabelduring development(fixing,testing)projectphase.

Figure 2.2 The defect tracking cycle [8]

Under Discussion Test Commitee Postponed No Defect Defect is Defect is closed closed

2. Assigned Under Solution is Repair Delivering the fix identified Review of the defect (Developer) (Dev. Lead) - Fill in changes made - Name new, deleted and changed files - Label files in VS Implementation of as test-ready Review of the bug solution Dev. Lead (Developers) Test lead

5. Reopened 1. New Defect is 6. Solved 3.Repaired A defect is reopened after Defect is Defect is found testing closed corrected

Closing defect ( Test Lead) A defect is found during ( Dev. Lead) test execution (Test lead / Tester) Retesting of solution (Test Lead / Tester)

Delivering the release Reopening of bug (Configuration manager) (Test lead / Tester) 4. To test Defect is - Label files with release delivered tag in VS Not to the testing - Build package Solved environment - Create release notes

12 SOFTWARE CONFIGURATION MANAGEMENT

3 Preparing a release – deploying with versioning system

3.1 Considerations for following example

Let’sconsiderthelastreleasedversionhasbeenv1.0.0andnewonetoreleaseisv1.1.0 Figure 3.1 Example of labels layout in VS repository on single file level. Two labels present, pointing to different revisions.

3.2 The approach

Letthereaderbyguidedthroughtheactionstotake.Thefocusistokeepsmall,clearand isolatedsteps,i.e.tokeepitassimpleaspossible.

3.2.1 Zeroth step – put new release label across repository

Putthelabelofnewreleaseontoeachfilewhichhasgotlast(previous)releaselabelandletit pointtothesamerevisionofthesinglefile,i.e.newrelease~lastrelease.

13 SOFTWARE CONFIGURATION MANAGEMENT Figure 3.2 Status of single file after the zeroth step. Observe the new release label being added and pointing to the same revision as the older one

3.2.2 Step one – extract list of files to be released from bug tracking tool

Obtainalistofupdated(new)fileswhicharefilledintotheBTforeachspecificbugfix (implementedCRrespectively)andaresupposedtobedelivered(i.e.BTstatusofthebugis ‘repaired’ 15 ). Runconsistencycheckerontherepositoryagainstlistofupdatedfilestobereleasedand checktheresult,performnecessaryfixes 16 inVSandcorrectthelistoffilestobereleasedif required.

3.2.2.1 What could be a VS repository inconsistency Thereareseveralpotentialpossibilities: • fileismodifiedinVS,notlistedinBTforany‘repairedbug’ • fileismodifiedinVS,notlabelledastestready • fileisnotmodifiedinVS,listedasmodifiedbyabugfixinBT • fileisnotcheckedinintoVS,listedasmodifiedbyabugfixinBT • fileisnotcheckedinintoVS,hasnolabelatall

3.2.3 Step two – move the new release label, i.e. promote the revision

Moverecentlyplacednewreleaselabelfromoldreleaserevisiontoonelabelledastestready, i.e.makereleaselabeltopointtothesamerevisionofsinglefileasthetestreadylabeldoes. Thisistobeperformedforeachfilefromlistoffilestobereleased.

15 tocheckthedefectstatusesrefertothechapter2.9“Thedefecttrackingcycle” 16 forexamplewhenthefileislistedastobepromoted(withitsnewrevision)tothenewrelease,butthetest readylabelpointsstilltotheolderrevisionthedeveloperprobablyhasforgottentoapplythelabelaftercheck in;theactiontotakeistomovethetestreadylabeltoproperrevision 14 SOFTWARE CONFIGURATION MANAGEMENT Figure 3.3 Status of single file after the second step. See the new release label moved to other revision, i.e. ‘v1.1.0’ label points now to the ‘test-ready’ labelled revision

3.2.3.1 What happens with not modified file NotmodifiedfileisafileinVSrepositorywithoutanewrevisioncheckedin.

Figure 3.4 Status of single which has not been modified from last release. Head revision has

file.c the test-ready label as well as the last release label.

1.1 v1.0.0

1.2 test-ready

Inthezerothstepthereisappliedanewreleaselabelonthesamerevisionaspreviousrelease. Figure 3.5 Status of a single - not modified - file in VS repository after the zeroth step. Head revision has the test-ready label as well as the last release label – on top of it the file.c label of new release is added, pointing to the same revision as previous one.

1.1 v1.0.0

1.2 test-ready

v1.1.0

Duetothatthereisnonewerrevision,thisfileisnotlistedinBTandcouldnotappearas inconsistencywithinVSrepositorycheck.Nootherstepwillaffectthisfileandrevision labelledasnewreleasewillbedeliveredwithinnewrelease(technicallythatisthesame revisionastheonewhichhasbeenreleasedasthepreviousversion).Inthisexample:as v1.0.0hasbeenreleasedrevision1.2andasv1.1.0shallbereleasedrevision1.2aswell. Ifthereinthefuturewon’tbeanymodificationofthefile,anynewlabelpointstothesame revisionaspreviousone,i.e.totheonestilllabelledastestready. 15 SOFTWARE CONFIGURATION MANAGEMENT

Figure 3.6 status of a single file in VS repository after many new release labels have been applied and the file is kept unmodified; i.e. all the labels point to the same revision (in this example to the 1.2). file.c

1.1 v1.0.0

1.2 test-ready

v1.1.0

v1.2.0

v1.3.0

v1.n.0

3.2.4 Step three – obtain all files of new release

Checkoutorgetallfilessupposedtobedeliveredwithinnewrelease(orwhicharenecessary tocreate/compilethissoftwarerelease),i.e.obtainfromVSallthefileswiththenewrelease label,e.g.with‘v1.1.0’label.

3.2.5 Step four – build the release package

Compile;donecessarystepslikereconfigureinstallationconfigurationfileandcreatenew releaseinstallationpackageasrequiredbytheprojectdesignorpolicy.

3.2.6 Step five – completion

Createreleasenotes,mentionalldeployedbugsandchangerequests(includedinthe package)andupdatethestatusofrelevantbugsinbugtrackingtool.Finallystorethe packageintheagreedlocationtogetherwiththereleasenotesandbestcreatechecksumfile fortransferandcheckpurposes.

16 SOFTWARE CONFIGURATION MANAGEMENT

4 Branching approach

4.1 General assumptions

Whenthereisaneedofdevelopmentofanewmajorrelease,andcurrentmajorreleaseneeds tobecontinuedwithbugfixingetc.,thebranchingofthedevelopment,i.e.branchingofthe sourcecodesandconfigurationshallbeintroduced. Therearetwowaytofollowongeneral.Firstoneiswidelyacceptedandused–the branchingwithinthesamerepositorybyusingbranchingfunctionalityoftheversioning system.Asabenefitcanbepossibilitytousebuiltinfeaturesforchangewithindifferent branchesmerging.Thesecondwayistoestablishaseparaterepositorycopyforthenew majorrelease.Thebenefitispreventedcomplexityofinteractionswithversioningsystem, especiallyfromthedeveloper’spointofview.Disadvantageisnoawayofautomaticbranches merging. Noneofthesolutionsseemtobetheperfectonefromthefirstlook.NativelyIwouldchoose theregularandusedinnerbranching.Onotherhandthedevelopersarenotalwayscapableto handletheoperationswithaversioningsystem.Morecomplexityaddedontoplookstomeas contraproductive. Togetmoreinformationandinputtheinternalsurveydidhappenwithinthecircleofmost experiencedprojectteammembers.Finallythedecisiontookplace,basedonallthegathered data.

4.2 Proposed solution

Establishnewseparaterepositorybycheckinginstablereleaseversion(bestfinal,e.g.v1.0) ofthecurrentsoftwaredevelopmentline(obtainedfromexistingrepository).

4.2.1 When to create a separate repository

Intheidealcasethebesttimelineiswhencompleteandtested–stable–currentreleaseis ready. Inthecommonrealcaseiffinalmajorversionofcurrentreleaseisnotavailableandthereis aneedtostartwithdevelopmentofnewrelease(e.g.duetolimitedtime),thetimelineis presenceoflaststableminorreleaseinhighestdevelopmentphase(withmostoffunctionality included).

17 SOFTWARE CONFIGURATION MANAGEMENT 4.2.2 How to create a separate repository

Thesteps 1. checkoutlateststablereleasefromexistingrepositoryasalocalworkingcopy 2. establishnewseparaterepositoryfornewdevelopmentline 3. checkinobtainedlocalworkingcopyintonewrepository

Figure 4.1 New repository establishing procedure

file.c

1.1

1.2

1.3 timeline which triggers creation of another 1.4 file.c development line check out form the old repository v1.0.0 1.5 2.0 v2.0.0 and check in into the new one

1.6 2.1

1.7 2,2 fixing

2.17

2.n v2.1.0

development

Extrapossibilityisjusttodirectlyclonetherepositoryiftheversioningsystemsallows (basicallytopreventanycommitsfrombeingdoneduringtheoperating).Thismayrequire resettingoftherevisionidentifierstonewsequence,e.g.from1.22to2.1.

18 SOFTWARE CONFIGURATION MANAGEMENT 4.2.3 How to work with separate repositories – the approach basis

Existingaccountofadeveloperisconsideredasdevelopmentline1oriented.Newaccount forthedevelopershallbecreatedandconfiguredtoconnectto(workwith)newrepository andconsideredasdevelopmentline2oriented. Separatedatabaseuserandschemashallbecreatedifneededforeachdeveloperwithnumeric suffixforthenewaccount(instanceofsoftwarebeingdeveloped)

19 SOFTWARE CONFIGURATION MANAGEMENT

5 The tools

5.1 General assumptions

Theversioningandreleasemanagementapproachasdesignedabove,earlierinthedocument, needthesupportingtoolstobeintheplace. Asrequiredeitheradeveloperneedstobeshieldedfromdirectusageofanyversioning systemcommandswithallnecessaryparameterstoputtheproperlabel.Probabilityofeven assimpleissueasamistypingisquitehigh.Experienceshowsaswellthatpeoplearen’t payingmuchattentiontorepeatingtasks.Andapplyingoftestreadylabeloccursingeneral repeatedlyandfrequently. TheapproachofthereleasebuildusingversioningsystemrequiresaconsistencycheckofVS againstBT.Thisissupposedtobehandledbyaseparatetool. Theoutcomeis,thattheminimumsetoftoolsis • tooltoapplytestreadylabelonthefilespecified • tooltochecktheconsistencybetweenversioningsystemandbugtrackingtool Theextradecisiontomakeiswhichversioningsystemtouseandbuildthetoolsfor.The thingstoconsiderarethescopeofusageofthesystemnowadays,reliability,standardization, commerciality,opennessofthecodeandtherepositorydatabaseformat,crossplatformness, presenceofthemanualsanddocumentationandotherminorvalueslikeanyfrondend presenceetc.

5.2 Target versioning system

AstheversioningsystemhasbeenchosenTheConcurrentVersionsSystem,thewellknown CVS. CVSisveryspread,veryused(commercialandfree/opensourceprojectsaswellincluding manymajorprojectofthisdays);“CVSisaproductionqualitysysteminwideusearoundthe world”[1],“CVSisthemostpopularversioncontrolsystemavailabletoday”[2].It’s reliable,robust,welldocumented;repositoryisplaintextbasedandcapabletobeparsedby externaltools.CVSdoessupportclientserverarchitectureaswellasusermanagement,exists inportsformanyplatformsevenasbinarypackage,moreoverisopensourced. WhereCVSlosesacreditisinabilitytoversionthefoldersitselfandUN*Xfilesystem symboliclinks.Thatispossibletobehandledwithsomeworkarounds,anyway. 20 SOFTWARE CONFIGURATION MANAGEMENT Theother,CVSbasedversioningsystem,theSubversionaliasSVN,solvesthesemissing thingsandhasgotallthegreatCVSfunctionality.Onotherhand–unfortunately–inthetime whenthedevelopmentofthisprojecthasstartedtheSVNwasnotdevelopedtothe productionlevel,soitwasexcludedfromthelistofpossiblesystems.However,futureSVN portofthetoolsshouldnotbeatoobigdeal. Microsoft’sversioningproduct–theMicrosoft®VisualSourceSafe™isnotabletohandle labelproperlyinmannerasallthecommonversioningsystemsdo;therepositoryisfully operableonlyviagraphicalfrontend(atleastthecommandlinetoolisnotproperly documented);repositoryisofproprietarybinaryformat;reallifeexperienceshowsit’s terriblyslowwhileaccessedconcurrently,frequentlyevenduringsingleuseraccess.Thebig drawbackisthat,it’snotreliable:whenanetworkproblemoccurs,itcorruptsrepositoryfile (notjustlastrevision,butcompletehistoryforthefile)!Ontopofall,thereisan announcementonMicrosoftwebsitethatthistoolissupposedtobeusedjustforsmall teams/projects(anyinvestigationiftheydidanyprogresswiththissystemmeanwhilehasnot beendone).Allthisbroughtthissystemoutofthegameofconsideration. Hints: ifonemissesapossibilitytouseCVSasaversioningsystemwhiledevelopingunder Microsoft®VisualStudio™forinstanceonaWindowssystemheshouldbetoldabout existenceofseveralfreeprojectofCVSandMSworldIDE’sintegration: • JalindiIgloo( http://www.jalindi.com/igloo/ )–MS®VisualStudio™ pluginforCVS(complexandabitbuggy); • ToitoiseCVS(GPL;http://www.tortoisecvs.org )shellextensiontowork withCVSbymouse“rightclick”fromWindowsExplorer;verycomfortabletool; thiswayofworkwithaversioningsystemismoreadvisablethandirectsavingfrom editorviaplugin; experienceshowsthatadeveloperpaysmoreattentiontointeractionswitha versioningsystemwhilethisismanagerextraanIDEwherehe(she)developsin, whichisworthforthething,indeed. • WinCVS( http://www.wincvs.org )–AsetofGUIfrontendsforCVSwritten inC++anddistributedunderGPL,withnativelookandfeelonWindows,Macand Unix/thankstotheuseofpopularGUIframeworkslikeMFC,CJLibrary, MetrowerksPowerPlantandgtk+[5]; • CVSSCCproxy(http://www.pushok.com/soft _cvs.php )theSCCAPI pluginwhichprovidesaccessfrompracticallyallMicrosoftSCCenabledsoftwareto generalCVSrepositories.TheMicrosoftSCCAPIissupportedby:MSVC5.07.0, MSVB5.07.0,MS.NET,MSFrontPage,MSDEVandotherMicrosoft developmenttools.Withthesupportof3rdpartytoolsthisplugincanbeusedby BorlandIDE's[6].

21 SOFTWARE CONFIGURATION MANAGEMENT 5.3 Pre-implementation considerations

5.3.1 The repository access approach

ThewaysofaccessingtheversioningsystemrepositorywhiletheCVSischosenareeither directlyparsetheplaintextbasedrepositoryfilesorparsetheoutputofCVStoolswhichwill accesstherepository. Thefirstwayispossible,theformatiswelldocumented.Thesecondpossibilityisdoableas well,CVStoolsoutputformatisclaimedaskeptpreservedandcapabletobeparsedby standardUN*Xtools 17 . Implementationwillaimthefirstway–toparsetherepositorydirectly,takingtheadvantage oftheonlyprerequisitetotheconsistencycheckjusttherepositorycopyandthetool presence.

5.3.2 CVS repository database format - files

CVSistechnicallyamanagementlayerontopofRCSfiles–aCVSrepositoryobjectisa RCSfile.

(Follows[4]quotation) AnRCSfile'scontentsaredescribedbythegrammarbelow. Thetextisfreeformat:space,backspace,tab,newline,verticaltab,formfeed,andcarriage return(collectively,whitespace)havenosignificanceexceptinstrings.However,white spacecannotappearwithinanid,num,orsym,andanRCSfilemustendwithanewline. Stringsareenclosedby@.Ifastringcontainsa@,itmustbedoubled;otherwise,stringscan containarbitrarybinarydata. Themetasyntaxusesthefollowingconventions:`|'(bar)separatesalternatives;`{'and`}' encloseoptionalphrases;`{'and`}*'enclosephrasesthatcanberepeatedzeroormoretimes; `{'and'}+'enclosephrasesthatmustappearatleastonceandcanberepeated;Terminal symbolsarein boldface ;nonterminalsymbolsarein italics . rcstext ::= admin {delta}* desc {deltatext}* admin ::= head {num}; { branch {num}; } access {id}*; symbols {sym : num}*; locks {id : num}*; { strict ;} { comment {string}; } { expand {string}; } { newphrase }*

17 [f,e]grep,[s]ed,awkforinstance 22 SOFTWARE CONFIGURATION MANAGEMENT delta ::= num date num; author id; state {id}; branches {num}*; next {num}; { newphrase }* desc ::= desc string deltatext ::= num log string { newphrase }* text string num ::= {digit | .}+ digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 id ::= {num} idchar {idchar | num}* sym ::= {digit}* idchar {idchar | digit}* idchar ::= any visible graphic character except special special ::= $ | , | . | : | ; | @ string ::= @{any character, with @ doubled}*@ newphrase ::= id word* ; word ::= id | num | string | : Identifiersarecasesensitive.Keywordsareinlowercaseonly.Thesetsofkeywordsand identifierscanoverlap.InmostenvironmentsRCSusestheISO8859/1encoding:visible graphiccharactersarecodes041176and240377,andwhitespacecharactersarecodes010 015and040. Dates,whichappearafterthedatekeyword,areoftheformY.mm.dd.hh.mm.ss,whereYis theyear,mmthemonth(0112),ddtheday(0131),hhthehour(0023),mmtheminute(00 59),andssthesecond(0060).Ycontainsjustthelasttwodigitsoftheyearforyearsfrom 1900through1999,andallthedigitsofyearsthereafter.DatesusetheGregoriancalendar; timesuseUTC. Thenewphraseproductionsinthegrammararereservedforfutureextensionstotheformatof RCSfiles.Nonewphrasewillbeginwithanykeywordalreadyinuse.

(endof[4]quotation)

23 SOFTWARE CONFIGURATION MANAGEMENT Eachversionedobjecthasthehistoryfilewithinrepository,havingthesamefilenameas correspondingobjectwith‘ ,v 'appendedtotheend.

5.3.3 CVS repository database format - folders

CVSrepositorycontainsbasicallyfoldersoffollowingkind: • administrativefileslocation (/CVSROOT ) • modulefolders (/ ) • “trash”folder 18 (//Attic ) CVSROOT aswellasany Attic folderwouldn’tbeasubjecttoconsistencycheck 19 ;i.e. shouldbeskippedautomatically.

5.3.4 CVS repository database - location

TheCVSrepositoryisastructureoffoldersandfilesonafilesystemaccessibleforitsnative tools.Repositorycanresideonalocalfilesystemorremotelyondifferenthostrunningin servermode(remotecontroloverSSHpossibleeither)onotherhand. CVSROOTisanameoralias(usuallysetupenvironmentalvariableofthesamename) specifyingtherepositorylocation 20 .

5.3.5 CVS local checked out copy admin structures

Duringthecheckoutofalocalworkingcopyofamodule,localCVSadministrative structuresarebeingcreatedineachfolder;thesubfoldernameisalways“CVS”,alladmin filesarecreatedintothat. TheinterestingdatastoredthereisthepathtoCVSrepository 21 .Thisisoneofthepossible sourceswherethetoolcanobtaintherepositorypath,aliasCVSROOT.

18 usedtostoretheobjectsremovedfromactiveprojectandkeptforhistorydatarepositorylookup(retrievalan oldprojectreleaseforinstance) 19 thereisnorelevancebetweeninternalCVSdataandsubjectoftheconsistencycheck;inotherwordsthereisno referencebetweenCVSinternaldataandBTdata 20 e.g. /usr/local/cvsrepos 21 wherethelocalcopyhasbeencheckedoutfrom 24 SOFTWARE CONFIGURATION MANAGEMENT 5.3.6 The programming language

Thelanguagetodevelopthethinginshallbedeterminedbythemajorfunctionalityandtasks requiredtobedonebythetool.Forafirstiswouldgetthedatabyparsingtherepository database,secondlywithlowerseverityacomparisonsaretobedone.Nospecialrealtime functionalityneeded. Bestfortextdataparsingarescriptinglanguages.WellknownPHPsuitsbestforawebbased development,isprettyfineforthepurpose,butthecodemightnotbeasnicelyreadable asexpected,butmoreimportantisthatPerlisnotinstalledonaregularUN*Xsystemper default,henceitincreasesthetoolprerequisites. Tokeepitsimpleandstraightforwardtoimplementandtominimizetheprerequisitestothe system,theUN*Xshellscriptingisthesolution,withemploying(justonly)thestandard UN*Xtools,theAWKinmajor.Suchasolutionisfullycapabletoparsetheinputdataas wellastodotherestofrequiredfunctionality.ForefficiencytheGNUtoolsaretobeused, butwiththefunctionalityinlinewithPOSSIXnorm. Résumé:CVSistheversioningplatform;OSUN*X;applicationcode:BASHbasedscript includingAWKcode,employingstandardUN*Xtools,thePOSSIXbasedfunctionality.

5.4 The implementation

ThetoolsaretobeimplementedonUN*Xsystemplatform.Thusnamingconventionfor themshallfollowtheUN*Xstandard,theparameternamesshallmimicstheconventionof CVS. Thetoolsresidesintwoworkingareas • TheDeveloperspace • TheReleaseManagerspace Thefirstone makes atestready label topointtothelastcheckedinrevisionofafile;ithas name“mklabel”. Theparameteristobeonlythefilenamewhichthelabelshouldbeput(make)on;the CVSROOTdataistakenautomaticallyfromlocalcontrolfolderoreventuallyfromshell environment(aimistopreventtheuserfromaneedtospecifytheobviousinformation;ifthe controlfolderisn’tpresentthecheckinisnotpossibleanyway). Thesecondone–thecheckerofCVSconsistencyagainstdatafromBT–hasgotname “cvs_rcheck”.The“r”inthenamefollowsconventionofCVS:foranactionuponrepository filesdirectly 22 ithas“r”intheparametername 23 ;thecvs_rcheckissupposedtoperformonly repositorydirectaction.

22 socalled“remote”action 23 forinstancerlog,rtag 25 SOFTWARE CONFIGURATION MANAGEMENT Theinputsaretobespecifiedfromcommandlineaspositionalparameters.Thenaming conventionfollowstheoneofCVS. Ittriestoretrievetheneededdatalocallyifpossible,complainswhenmissing.Thecommand lineparameteroverridesthedatafoundlocally.Fortheparameterslististhebesttoreferto (usage)helpmessageofthescript.

Figure 5.1 Help message of the script

USAGE INFO:

cvs _rcheck

Supported parameters list: -d CVS repository path (e.g. /usr/local/cvsrepos) default: TEST _READY

Input source priority (higher no. ~ lower prio.): 1. explicitly specified value of the "-d" parameter 2. ./CVS/Root file content 3. exported CVSROOT environmental variable

-r * CVS 'Release' label/tag (e.g. R1 _10 _2) default: n/a -t CVS 'Test-ready' label/tag default: TEST _READY -l * list of files to be promoted default: n/a -x list of modules to exclude from the checking default: n/a -o output log directory default: /tmp

* - mandatory

To print out this usage message -[?|u|U|h|H] --[help|usage]

5.4.1 Common functionality

Boththetoolsneedduetothenatureoftheirmajorfunctionalityornecessarychecks–to implementfunctionalitytocomparerevisions.

26 SOFTWARE CONFIGURATION MANAGEMENT Therevisionsarerepresentedintextualformasdigitsseparatedbythedot(“.”)character. Whilebranchingisn’tused,alltherevisionsaretobeoftheformX.Y,wherebothXandY fitpattern[09]+(digitofatleastoneoccurrence;e.g.1.24).Branchedrevisions(formof X.Y.Z.W,i.e.containingmore“dots")arenotsupportedinthisversion.Onlyonebranch revisiontakenintotheconsiderationistheonecreatedduringveryfirstimportintothe repositoryafteritssetup.Theimportcreatesbranch;whiletherepositoryisemptysofarit makesrevisiontoappearonanimportbranchaswellasonthemainregularbranch.First regularcheckedinrevisionis1.1andfirstbranchrevisionis1.1.1.1.Theyaretechnicallythe same,butthecheckifacasehitsthisscenarioisimplemented. Basicallythereisonefunction,AWKbased,performingrevisionscomparisonandcalled compare _revisions .Parameterstobepassedaretwostringsrepresentingrevisionsto compare.Resultisreturnedistheexitcode(followsUN*Xscriptingconventions).Exit codes: # exit code(s): (i.e. which one is bigger;) # 0: $1 = $2 (no one) # 1: $1 > $2 (the first one) # 2: $1 < $2 (the second one) Exampleoffunctioncall: compare _revisions $REV _TST $REV _REL; whichforinstancecouldbeexpandedto compare _revisions 1.12 1.9; andtheresultcodeinsuchacaseis 1 orspecialcase compare _revisions 1.1 1.1.1.1; iffitsto“firstimport“schemaitreturns 0

5.4.2 The developer space tool – mklabel

Thistoolissupposedtobeassimpleaspossibletomakedeveloper’slifeeasier.Only parameterwhichneedstobepassedtothetoolisthenameoffilewherethelabelisaboutto beappliedto. TherestofthenecessarydataisgatheredbynativeCVScommandtoolusedwithinthescript (technicallyfromtheUN*XshellenvironmentoradministrativeCVSsubfolder).

27 SOFTWARE CONFIGURATION MANAGEMENT TechnicallythemklabeltoolisawrapperaroundnativeCVScommand“cvs”;mklabeldoes allthechecksbeforethetagisappliedtoavoidsituationthatthetestreadylabelpointsto incorrectrevision. Thecircumstancesunderwhichtheuserisabletosuccessfullyexecutethetoolarequite strict.Forafirstthecurrentdirectoryisrequiredtobetheonewherethetobelabelledfile locatedis,forasecondonlysinglefilecanbespecifiedatonce,moreoveristhereisdetected anystickinessonthelocalcopyofthefiletheuserisannouncedandneedstoconfirm explicitlycontinuationoftheoperation–thatallshallpreventthedeveloperfromusageof thetoolinrecursivemanner,whichcanpotentiallyleadtolabellingofmorefilesthanthe onessupposedtobetestready;oraccidentallylabelwrongrevision,respectively.Aimisto forcethedevelopertodosimpleandclearstepsduringthelabelapplyingprocedure.

Figure 5.2 Usage syntax of mklabel

mklabel ./

e.g.: mklabel ./http_lib.c

5.4.3 The release-manager space tool – cvs_rcheck

Thetoolimplementsbasicfeaturesaswellasasetofextendedonestobeabletocheckstatus ofeachsinglefileintherepositoryandcomparegatheredinformationagainstdatafrombug trackingtooltodiscoveranyinconsistencies. Basicfeatures: • getCVSROOTtobeawareofCVSrepositorylocation;firstlyistriestouseUN*X shellenvironmentalvariable $CVSROOT ,ifnotfoundthelookupisdoneinthelocal CVSadministrativefoldertothefilewhichstoresthedata,i.e.tothe ./CVS/Root ; allthis–asmentionedalreadyinthischapter–canbeoverriddenbyacommandline parameter,the“ –d” • getCVSstatusfromrepositoryforafile(toretrievelistoflabelsandcorresponding revisionnumbers) • getCVSlogofthefile(togatherthedatatodistinguishbetweentherevisioninthe explicitway;basicallyneededtoverifythescenarioofidenticalrevision1.1and 1.1.1.1) • fromretrieveddataextractrevisionnumberrelatedtothespecificlabel(tothetest readyandtoreleaselabeleither;releaselabelisoneofthemandatoryparametersto bespecifiedfromthecommandline)

28 SOFTWARE CONFIGURATION MANAGEMENT • getlistoffilestobepromotedtobeincludedtothenewrelease(plaintextbased, eachfilenameonaseparateline;UNIXnewlines/0x0A/areamust) • tooutputandlogtheresultsforeachfiledetectedwithintherepository;prefixof outputandlogfilescanbemodifiedbytheinputparameter,the“ –o” Extendedfeatures: • tobeabletoskipasetofrepositorymodulesduringthecheck;thesetisrepresented asaplaintextfilewithmodulenameonasingleline(UNIXnewlinecharactersare required),commentsaresupportedanddefinedasaline(s)beginningwiththesharp (“#”)character; thefilenameistobepassedtothetoolasanextrainputparameter,the“ –x”(derived from“listtoe xclude”) • mapthereportedandloggedfilenamestothepathformatrelativetopotentialcheck outpointinordertousethescriptoutputdatadirectly(i.e.simplycopy&paste); mappingdataisgathereddirectlyfromrepositorycontrolandconfigurationdata(the $CVSROOT/CVSROOT/modules file) Thefirstextendedfeaturehasnottobenecessarilyused,butonotherhandbecomesvery helpfulwhentherepositorystoresseveraldifferentsubprojects(asmodules)andtherelease managerisgoingtochecktheconsistency(preparenewreleaseinotherwords)onlyfora specificsubset,specificlistofmodules.Insuchacaseitsuitsbesttoexcludenotneeded modulesfromchecktoavoidtheircontentasinconsistencyincheckresult. Thesecondextendedfeature,socalledmodulemapping,automaticallytakesthedatafrom

Figure 5.3 List of modules to exclude (file content)

cvs _rcheck-module _exclude _list.txt: # -- main application #server _module server _module _lib # -- migration team migrator migrator _ddl configurationfilementionedaboveandparsesittogetthesettingstobeablemapthepath properly.Ifthereisnomodulemappingconfiguredintherepository,thefeatureissilently skipped.Havingoutputinaconvenientformatincreasesefficiencyofreleasemanagerwhen thereisaneedofmanualinterventiontotherepository(evensimplecheck).

29 SOFTWARE CONFIGURATION MANAGEMENT

Figure 5.4 Module mapping schema instance

CVSROOT : /usr/local/cvs _repo/ Module: server _lib CVS module configuration: server _lib ~ server/lib (which says that module ‘server _lib’ should be checked out to ‘server/lib’ folder relative to checkout point) Example of full path in repository module: /usr/local/cvs _repo/server _lib/http _lib.c Example of full path in checked out local copy: /home/marek/devel/server/lib/http _lib.c (while checkout point is ~/devel/) Mapped path of http _lib.c: server/lib/http _lib.c

Bothmodulecheckexclusionandmodulemappingaredesignedandimplementedtobe performedinthewayofasinglesedscript(scriptofregularexpressionsinformat interpretablebyUN*Xtool“sed”).Thescriptiscompiledduringinitialisationphaseofthe toolandhandlesallthemodulesatonce. Therearetwomajoroutputsofthetool–standardoutputandfilelogging. Tothestandardoutputisprintedfirstsummaryinformationbeforethecheckrunbeginsand duringexecutionthereisinformationofprocessedfileanditsstatusfromthecheckaswellas thefoundrevisionnumbers;filenameformatisrelativetocheckoutpoint(modulemapping takesaction). Thefileloggingsplitsitselfintothethreechannels:logfile,csv 24 fileandxls 25 file • the log file entryconsistsformfilestatus,revisionnumbers,mappedfilepathand absolutepathrepositorywithinrepository;endsupwiththeprocessingtimestatistics (starttime,endtime) • the csv file entryisthesameaslogentryexceptabsolutepath,fieldsseparatedby semicolons(“;”);purposeistobeprocessedifneededbyexternaltool • the xls file mimicscsvfileandextendsfeaturesbyaddingcolourhighlightingtorows accordingthestatusofthefile ok,filestatusisnewandconsistent–greenbackground ok,filestatusisunmodifiedandconsistent–defaultbackgroundkept notok,filestatusinconsistent–redbackground theformatofthexlsisnotbinaryone;Microsofthasintroducedanextraformatof xlsfilessinceofficeversion9:basicallyakindofxml+html+basedformat(one

24 plaintextfilewithcommaseparatedvaluesonaline 25 MS©ExcelSheet. 30 SOFTWARE CONFIGURATION MANAGEMENT cancallitxhtmlformat);thisallowstogenerateanxlsfileinstancedirectlyfroma UN*Xshellscriptwithtakinganadvantageofplaintextoutputtoafile. Firsthtmlcontainerforinstance: Thecheckerdoesevaluationoffilestatusinrepositoryandcompilesastatusstringof5 charactersfromterminalssetof{+,,#}.Thelastterminalcanoccuronlyatthe5 th position. Ingeneral“+”meanscondition’saccomplished,““representsfailedconditionandfinally “#”fulfilsandconditionoccurrence. The first check detectspresenceoftestreadylabel;the second one detectsthereleaselabel presence;the third check (informative):istherenewerrevisionthenthetestreadyone?; the fourth check :istestreadyrevisionhigherthan,orequaltotheheadrevision?;finally the fifth check :ifafilenameappearsonthelistoffilestobepromoted? Thefifthcheckisaspecialonewiththreestatusesdependingontheforthcheckresult: • 4th checkpositive:thefileissupposedtobeinthelistoffiletobepromotedandifis, checkgoestook>“+” • 4th checknegative:thefileisnotsupposedtobepromotedtothenewrelease,thusif it’snotlistedonthelistoftobepromotedfilesit’sok>“+”;butifdespitethat occursonthelist,somethingextrawentwrong 26 >“#”

26 typicallythedevelopermentionedthefileastestreadyinBT,butdidnotcheckthefileinintotheVS 31 SOFTWARE CONFIGURATION MANAGEMENT

Figure 5.5 Usage syntax of cvs_rcheck

Full: cvs _rcheck -d \ -r \ -t \ -l \ -x \ -o e.g.: cvs _rcheck -d /usr/local/cvs _repo/ \ -r R _1_10 _3 \ -t TEST _READY \ -l R_1_10 _3-BT _list.txt \ -x cvs _rcheck _module _exclude _list.txt \ -o /home/marek/releases/R _1_10 _3/ Minimally: cvs _rcheck -r R_1_10 _3 \ -l R_1_10 _3-BT _list.txt

32 SOFTWARE CONFIGURATION MANAGEMENT

6 The conclusion

Thethesisprovidedareaderwiththeterminologyoverviewaswellasintroductiontothe area,includingexampleofinappropriateversioningsystemusage–togetanimageofthe problems. Theprojectbroughtthespecificsolution–structuredwaydescribedtheapproachof employingversioningsystemforthepurposesofthereleasemanagement,whichsucceedsin themandatoryprerequisitescreationforsuccessfulreleasebuild,deploymentandproject internal/externaldelivery. Thedetailslevelwenttoextendthatjustcommandsofaparticularversioningsystemcould deepentheinformationprovided. Thetoolsimplementedprovidetheclaimedfunctionality.Moreover,thetoolsdevelopedby mewithinthismaster’sthesisproject(aswellasthesetupapproach)arebeingusednow withinoneoftheteamsoftheprojectwhichIjointintheyear2005tosupportsmoothand transparentdeploymentprocess(frequentlyintoatestingenvironment).InthetimewhenI rolledofftheotherteamswereabouttoestablishthisapproachastheteam’sapproachdueto issuesrelatedtothedeploymentofarelease(issueswerecausedbymissingorinappropriate releasemanagement,softwareconfigurationmanagementrespectively).Noissues encounteredsofar.Thiscouldbeconsideredasproofofconceptaswellasofcorrectnessof designandimplementation. Possibleimprovementsareforinstancetotunetheparametersandusageoffrequently utilizedUN*Xcommandduringtherun,i.e. sed or grep .Extrafocuscanbeputon removaloftemporaryfilesusageinappearedscope.I’vestartedtheimplementationonthe SUNSolaris5.8system,whichmounts /tmp intothememory,thusnoharddiskaccess slowdown.Linuxusesregularharddiskarea,sothediskaccessspeedtakesplace. Fortunatelythetimeofexecutionwasnotcriticalsofar,maximumtimeexperienceshasbeen around25minutesforrepositorysizedat600MB,containingbinaryfilesaswell.Thedisk wasSCSIone,themachineSunSunFire440.

33 SOFTWARE CONFIGURATION MANAGEMENT

7 Literature and resources

[1] DPRICE,CVS, http://www.nongnu.org/cvs/ (May,2006) [2] AboutCVS, http://ximbiot.com/cvs/ (May,2006) [3] Price,DerekR.,CVSv1.11.21OnLineManual, http://ximbiot.com/cvs/manual/cvs1.11.21/cvs.html ,(May,2006) [4] Tichy,WalterF.,PurdueUniversity,WestLafayette,IN,47907.ManualPage Revision:5.6;ReleaseDate:1995/06/05.Copyright©1982,1988,1989WalterF. Tichy.Copyright©1990,1991,1992,1993,1994,1995PaulEggert. TheRCSManualPageonline, http://www.die.net/doc/linux/man/man5/rcsfile.5.html ,(May,2006) [5] CvsGuifeatures,WinCVShomewebsite, http://www.wincvs.org/ (May,2006) [6] CVS&SCC,CVSSCCproxyplugin, http://www.pushok.com/soft_cvs_proxy.php (May,2006) [7] Sobell,MarkG.,Linux–Praktickýprůvodce ComputerPress1999,ISBN8072261908 [8] Mehmet,EmreCan,FactoryAssemblyTestExecution, 2005

34 SOFTWARE CONFIGURATION MANAGEMENT

A Appendix

a. The cvs_rcheck script output

Figure A.1 The csv file content

STATUS;HEAD_REV;TO_TEST_REV;TO_RELEASE_REV;FILE_NAME +++-+;1.1;1.1.1.1;1.1.1.1;server/setup/README +++-#;1.1;1.1.1.1;1.1.1.1;server/setup/LICENCE +++++;1.2;1.2;1.1;server/setup/setup.conf ++++-;1.3;1.3;1.2;server/setup/setup.sh ----+;1.2;n/a;n/a;DP/test-input_params.sh ----+;1.2;n/a;n/a;DP/test-module_mapping.sh ----+;1.3;n/a;n/a;DP/mklabel ----+;1.6;n/a;n/a;DP/cvs_rcheck ----+;1.1;n/a;n/a;DP/R1_10_3-BT_list.txt ----+;1.1;n/a;n/a;DP/cvs_rcheck-module_exclude_list.txt ----+;1.1;n/a;n/a;DP/test-module_excluding.sh

Figure A.2 The xls file content STATUS HEAD TEST RELEASE FILE NAME +++-+ 1.1 1.1.1.1 1.1.1.1 server/setup/README +++-# 1.1 1.1.1.1 1.1.1.1 server/setup/LICENCE +++++ 1.2 1.2 1.1 server/setup/setup.conf ++++- 1.3 1.3 1.2 server/setup/setup.sh ----+ 1.2 n/a n/a DP/test-input_params.sh ----+ 1.2 n/a n/a DP/test-module_mapping.sh ----+ 1.6 n/a n/a DP/mklabel ----+ 1.6 n/a n/a DP/cvs_rcheck ----+ 1.1 n/a n/a DP/MLO_BE_V1_10_6_0-list.txt ----+ 1.2 n/a n/a DP/cvs_rcheck-module_exclude_list.txt ----+ 1.2 n/a n/a DP/test-module_excluding.sh ThesituationshownistheREADMEfilehasn’tbeenchangednorlistedonthelistoffilesto bepromoted(list)[ok];LICENCEfilehasn’tbeenupdatedbutmentionedonthelist[nok]; filesetup.confhasbeenmodifiedinVSandpresentonthelistlisted[ok];setup.shmodified butnotlisted[nok];allotherfileswhereneverreleasedasanyreleaseevenneverlabelas testready

35 SOFTWARE CONFIGURATION MANAGEMENT b. An example of history graph of a file in VS repository

Figure A.3 Graphical CVS log

Figureshowsanexampleofcvsgraphicallogrepresentingalllebelsappliedinpast,i.e. whichrevisionhasbeenreleasedaswhichrelease. Examplescreenshotistakenfrom[5].

36 SOFTWARE CONFIGURATION MANAGEMENT c. The mklabel in action

Figure A.4 Saved output from the command shell while working with mklabel tool

[marek@agaue DP]$ ll drwxrwxr-x 2 marek marek 4096 May 15 21:09 CVS -rwxrwxr-x 1 marek marek 23847 May 15 20:43 cvs_rcheck -rw-rw-r-- 1 marek marek 125 Apr 20 01:53 cvs_rcheck- module_exclude_list.txt -rwxrwxr-x 1 marek marek 8335 May 15 20:49 mklabel -rw-rw-r-- 1 marek marek 9 Nov 17 00:06 V1_10_6_0-BT_list.txt -rwxr--r-- 1 marek marek 2244 Apr 13 00:24 test-input_params.sh -rwxr--r-- 1 marek marek 1260 Apr 20 00:50 test-module_excluding.sh -rwxr--r-- 1 marek marek 1777 Apr 12 23:39 test-module_mapping.sh -rwxrwxr-x 1 marek marek 953 May 15 21:04 test.sh [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp; First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======[marek@agaue DP]$ ./mklabel test.sh mklabel (developer space) Head revision: 1.1 Repository revision: 1.1 Sticky revision: (none)

37 SOFTWARE CONFIGURATION MANAGEMENT Tagging... T test.sh File [test.sh] successfully labeled with tag TEST_READY [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.1 branch: locks: strict access list: symbolic names: TEST_READY: 1.1 keyword substitution: kv total revisions: 1; selected revisions: 1 description: ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp; First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======[marek@agaue DP]$ echo "" >> test.sh [marek@agaue DP]$ cvs commit -m "dummy extra revision" test.sh Checking in test.sh; /usr/local/cvs_repo/DP/test.sh,v <-- test.sh new revision: 1.2; previous revision: 1.1 done [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.2 branch: locks: strict access list: symbolic names: TEST_READY: 1.1 keyword substitution: kv total revisions: 2; selected revisions: 2

38 SOFTWARE CONFIGURATION MANAGEMENT description: ------revision 1.2 date: 2006/05/15 19:10:12; author: marek; state: Exp; lines: +1 -0 dummy extra revision ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp; First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======[marek@agaue DP]$ ./mklabel test.sh mklabel (developer space) Head revision: 1.2 Repository revision: 1.2 Sticky revision: (none) Tagging... T test.sh File [test.sh] successfully labeled with tag TEST_READY [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.2 branch: locks: strict access list: symbolic names: TEST_READY: 1.2 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ------revision 1.2 date: 2006/05/15 19:10:12; author: marek; state: Exp; lines: +1 -0 dummy extra revision ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp;

39 SOFTWARE CONFIGURATION MANAGEMENT First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======[marek@agaue DP]$ cvs update -r 1.1 test.sh U test.sh [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.2 branch: locks: strict access list: symbolic names: TEST_READY: 1.2 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ------revision 1.2 date: 2006/05/15 19:10:12; author: marek; state: Exp; lines: +1 -0 dummy extra revision ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp; First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======[marek@agaue DP]$ ./mklabel test.sh mklabel (developer space) Head revision: 1.2 Repository revision: 1.1 Sticky revision: 1.1 You are going to tag not the latest revision of file [test.sh]. Latest: 1.2/Current: 1.1 Are you sure? [y/n] y Tagging... T test.sh File [test.sh] successfully labeled with tag TEST_READY

40 SOFTWARE CONFIGURATION MANAGEMENT [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.2 branch: locks: strict access list: symbolic names: TEST_READY: 1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ------revision 1.2 date: 2006/05/15 19:10:12; author: marek; state: Exp; lines: +1 -0 dummy extra revision ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp; First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======[marek@agaue DP]$ cvs tag -d TEST_READY test.sh D test.sh [marek@agaue DP]$ cvs admin -o 1.2 test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v deleting revision 1.2 done [marek@agaue DP]$ cvs log test.sh RCS file: /usr/local/cvs_repo/DP/test.sh,v Working file: test.sh head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1

41 SOFTWARE CONFIGURATION MANAGEMENT description: ------revision 1.1 date: 2005/11/22 23:49:24; author: marek; state: Exp; First checkin - a tool to test the approach(es), currently gawk vs UNIX awk test and getting the module mapping test ======

42