Five Real-World Strategies for Perforce Streams

21
# Erik van Nooijen Technical Lead at TomTom Five Real-World Strategies for Perforce Streams

description

Before you deploy Perforce Streams in your organization, you should have a plan in place. Get advice and hear the five strategies for using Streams and how to handle integration exceptions gracefully.

Transcript of Five Real-World Strategies for Perforce Streams

Page 1: Five Real-World Strategies for Perforce Streams

#

Erik van NooijenTechnical Lead at TomTom

Five Real-World Strategies for Perforce Streams

Page 2: Five Real-World Strategies for Perforce Streams

#

Erik van NooijenTechnical LeadTomTom International B.V.10 years as contractor

• (senior) developer

5 years in TomTom - Netherlands

• 3 years senior developer

• 2 years technical lead

Page 3: Five Real-World Strategies for Perforce Streams

#

TomTom background information

Page 4: Five Real-World Strategies for Perforce Streams

#

TomTom total Perforce installation

size 780 Gb database3.2 TB versioned files

#proxies 10

#replicas 4

#users ~700

#workspaces ~19000

#changes ~1.000.000

Main server 32 core284 Gb ram4* Fusion IO (ssd) 8.6 Tb

TomTom Perforce installation numbers

Streamed depot

size 52 Gb

#streams 360

#mainlines 1

#release streams 20

#users ~150

#changes ~80000

Page 5: Five Real-World Strategies for Perforce Streams

#

Educate your user base on streams

Page 6: Five Real-World Strategies for Perforce Streams

#

Educate user base• Parent / child stream relationship

– predefined integration flows

• Merge-down / copy-up– resolve-on-child paradigm

• Stream specification vs branch mapping• Moving workspace• Naming conventions

– Renaming a stream does not rename the underlying branch

• Deleting streams

Page 7: Five Real-World Strategies for Perforce Streams

#

Cherry-picking integrations

Page 8: Five Real-World Strategies for Perforce Streams

#

• Integrate 1 (or few) specific changelists up, without doing a full copy-up

• Examples:– Quick propagation of a bug fix

– Selective moving finished work to prep stream

Cherry-picking integrations

Page 9: Five Real-World Strategies for Perforce Streams

#

Cross stream integrations

Page 10: Five Real-World Strategies for Perforce Streams

#

• Integrations that are not following pre-defined flow

• Using ‘p4 integrate //source/…@11,11 //dest/…’

• Example: integrate specific changelist into existing release. Most often happens for bug fixes.

Xstream integration: dev-to-release

Page 11: Five Real-World Strategies for Perforce Streams

#

• Integrations that are not following pre-defined flow

• Using ‘p4 integrate //source/…@11,11 //dest/…’

• Example: integrate specific changelist across development streams, without going via main. Usually for inter-dependencies between developments.

• Alternative; use stream specification with ‘import’– Defined imports with ‘import @’ available with p4d

2014.1

– Writable imports become available with p4d 2014.2

Xstream integration: dev-to-dev

Page 12: Five Real-World Strategies for Perforce Streams

#

Stream specifications can be overruled with branch mapping

Page 13: Five Real-World Strategies for Perforce Streams

#

Stream: //depot/main

Type: mainline

Paths: share //…

Stream: //depot/dev-X

Type: development

Parent: //depot/main

Paths: share //…

import versions.txt //depot/main/versions.txt

Stream spec vs branch mappingClient: depot_dev_wsView: //depot/dev-X/… // depot_dev_ws/…

!! No ‘Stream:’ but using branch mappings

$ p4 edit versions.txt

$ p4 submit –d “my own development identifiers in versions.txt”

$ p4 copy //depot/dev-X/… //depot/main/…

$ p4 submit -d “copy up from dev stream”

!! No –S <stream> for copy argument, but branch mappings

Result: versions.txt changed on main!

Final solution:

1. RW permission group on main for this file

2. educating users on p4 copy

Page 14: Five Real-World Strategies for Perforce Streams

#

Task- and Virtual streams

Page 15: Five Real-World Strategies for Perforce Streams

#

• Most benefit on server side, less so for end-users

• Can be confusing when used with branch mapping

• When to use regular development stream vs task stream ?– Task streams can be converted to type development, but conversion back is not possible

• We decided not to use them, instead we use development streams only

Task streams

Page 16: Five Real-World Strategies for Perforce Streams

#

• Reduce the amount of data that gets pulled into a workspace

• Compose product combinations with only imports– One mainline with all imports for ‘mainlines’

– Many virtual streams based on the mainline that overrule the imports with various ‘release’ imports

– Easy and cheap to make many combinations

Virtual streams

Page 17: Five Real-World Strategies for Perforce Streams

#

canary-main (type: mainline)import os/… //depot-os/main/…

import engine/… //depot-engine/main/…

import ui/… //depot-ui/main/…

import engine/ui-tweaks/… //depot-ui/main/tweaks/…

canary-ui-rel1 (type: virtual)share …

import ui/… //depot-ui/rel-1/…

import engine/ui-tweaks/… //depot-ui/rel-1/tweaks/…

canary-ui-rel2 (type: virtual)share …

import ui/… //depot-engine/rel-2/…

import engine/ui-tweaks/… //depot-ui/rel-2/tweaks/…

Virtual streams

Page 18: Five Real-World Strategies for Perforce Streams

#

Addendum

Page 19: Five Real-World Strategies for Perforce Streams

#

• ‘p4 integrate –f’ is evil !– alternative is ‘p4 copy’

• Use ‘integ.engine = 3’– engine 3 is default, but maybe you have engine 2 specifically configured

• Import with stream specification not (yet) supported– ‘import //… -S //depot/stream’

Addendum

Page 20: Five Real-World Strategies for Perforce Streams

#

• Educate your user base

• Cherry picking integrations

• Cross integrations

• Stream specification versus branch mapping

• Task and virtual streams

Summary

Page 21: Five Real-World Strategies for Perforce Streams

##

Thank you!Erik van [email protected]#idonttweet