continuous integration for real: the perforce java platform

16
Continuous Integration For Real: The Perforce Java Platform Hamish Reid Perforce Software Inc.

Upload: others

Post on 12-Sep-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuous Integration For Real: The Perforce Java Platform

Continuous Integration For Real: The Perforce Java Platform Hamish Reid Perforce Software Inc.

Page 2: Continuous Integration For Real: The Perforce Java Platform

OVERVIEW

•  What do we mean by… •  Agile? •  Continuous Integration?

•  Product line highlights: •  P4Eclipse + Mylin + MergeQuest •  P4Java •  P4Ant •  P4Maven •  (Hudson Perforce Plugin) •  (P4Java, P4D)

•  The Perforce Java Team CI Workflow

Page 3: Continuous Integration For Real: The Perforce Java Platform

WHAT DO WE MEAN BY “AGILE”?

•  Adaptive processes and workflows: •  Feedback- and reality-driven •  Flexible goals

•  Continuous processes and workflows: •  No surprises! •  Small increments in planning •  Small increments in delivery •  Small increments in effort •  There’s always some version of the final product

•  Examples: •  Scrum, XP, Kanban

Page 4: Continuous Integration For Real: The Perforce Java Platform

WHAT DOES “CONTINUOUS INTEGRATION” MEAN?

•  The heart of agile processes… (…but not just agile processes).

•  Martin Fowler’s essentials: •  Integration is a non-event. •  Any individual developer's work is only a few hours

away from a shared project state. •  Individual work can be integrated back into that state in

minutes. •  Any integration errors are found rapidly and can be fixed

rapidly. •  Trades up-front workflow and infrastructure effort for

integration simplicity. •  Not for every product or workflow.

Page 5: Continuous Integration For Real: The Perforce Java Platform

CONTINUOUS INTEGRATION ELEMENTS (1)

•  Martin Fowler: •  Configuration management •  Build and test automation •  Self-testing •  Frequent commits •  Build and test on commit •  Fast build / test cycles •  Test in production environment clone •  Easy to get latest build artifacts •  Easy to get latest status •  Automated deployment

Page 6: Continuous Integration For Real: The Perforce Java Platform

CONTINUOUS INTEGRATION ELEMENTS (2)

•  Additionally, from our own experience: •  Integration into issues tracker system •  Easy / safe / cheap branching…

…and integrate / merge / resolve cycle •  Low burden for developers:

•  Integration into IDE’s and other common tools •  Visualization •  “Culturally appropriate”

Page 7: Continuous Integration For Real: The Perforce Java Platform

OUR JAVA TEAM WORKFLOW

•  We “eat our own dog food”… …but we also “eat our customers’ dog food”

•  Heavy emphasis on continuous integration •  (Very) test-driven development process •  Jobs-driven process •  Branch-centric process:

•  Dev / shared (team) / main / release •  Two modes:

•  Eclipse-centric development and dev testing •  Hudson-centric automation for shared branches

•  Open Source / off-the-shelf solutions: •  Eclipse, Mylin, Junit, Maven, Ant, Hudson, Cruise

control

Page 8: Continuous Integration For Real: The Perforce Java Platform

KEY ELEMENTS IN OUR CI WORKFLOW

•  Eclipse + P4Eclipse •  P4Eclipse + MergeQuest + Mylin + more… •  Hudson + Perforce plugin •  Maven + P4Maven •  Ant + P4Ant •  P4Java •  (P4D)

Page 9: Continuous Integration For Real: The Perforce Java Platform

ECLIPSE – THE DEVELOPER'S COMMAND CENTER

Page 10: Continuous Integration For Real: The Perforce Java Platform

ECLIPSE + P4ECLIPSE

•  All code work done in Eclipse •  P4Eclipse supplies the Perforce functionality:

•  Import as project •  Add / edit / delete files •  Submit / changelist management •  Refactoring •  P4Grep, diffs, resolves, branches, merges

•  All dev testing done using Junit: •  Suite-based •  Right-click from Eclipse

•  Mylin – the task master •  MergeQuest, branch graph, timelapse… •  Mavenized development where needed

Page 11: Continuous Integration For Real: The Perforce Java Platform

HUDSON + PERFORCE

•  Hudson + P4 extensions central to Perforce Java team workflow: •  Used to setup builds and tests •  Used to store results and raw report data back to SCM •  Triggered on successful merges and codeline changes

•  Uses existing third-party Open Source plugin •  Perforce will help develop and maintain •  Currently p4 command line based

•  Typically configured through Hudson control panel •  Works with Jenkins, too, of course…

Page 12: Continuous Integration For Real: The Perforce Java Platform

MAVEN + P4MAVEN

•  Maven used extensively: •  Distribute shared team builds •  Cache external dependencies •  Off-the-shelf build lifecycle support •  Tie-ins to Eclipse •  Often run from Hudson

•  P4Maven: •  Perforce-developed and supported •  P4Java-based •  Released 11.1 •  Full Maven “scm” functionality •  MOJO-based extensions for jobs, etc. •  Non-core plugin

Page 13: Continuous Integration For Real: The Perforce Java Platform

ANT + P4ANT

•  P4Java-based •  P4Ant targets:

•  The usual suspects, plus… •  …things like shelve / unshelve, fix, job-related tasks,

etc. •  Perforce usage:

•  Test setups •  Builds •  Distributions

•  Example: <taskdef resource="com/perforce/ant/tasks/P4Tasks.properties" /> …

<target name="p4tasktest" description="Perforce task test"> <p4jsubmit port="eng-p4java-vm:20101" user="p4jtestuser" passwd="p4jtestuser" client="p4TestUserWS" changelist="3391" /> </target>

Page 14: Continuous Integration For Real: The Perforce Java Platform

P4JAVA

•  Makes all-Java implementations possible •  Native protocol implementation •  Clear object model •  Underpins:

•  Nearly all our Java-related CI platform •  Perforce Web Services Platform (P4WSP)

Page 15: Continuous Integration For Real: The Perforce Java Platform

LOOKING BACK…

•  Tools integration (“it’s the tools, stupid!”): •  P4Eclipse + Mylin •  P4Maven, P4Ant, Hudson Plugin

•  Visualization: •  MergeQuest, P4Eclipse, Timelapse, Branch Graph •  Hudson + P4Hudson

•  Immediacy: •  P4Eclipse, Hudson

•  Flexibility: •  …all that and more.

Page 16: Continuous Integration For Real: The Perforce Java Platform

SUMMARY

•  The Perforce Java product line now forms a platform •  Key components:

•  P4Eclipse •  P4Maven •  P4Ant •  P4Hudson •  (P4D, P4Java)

•  It makes agile continuous integration so easy… …that even the Perforce Java team can do it.