guiding diffy to the enterprise land

18
1 Copyright ©2014 CollabNet, Inc. All Rights Reserved. ENTERPRISE CLOUD DEVELOPMENT ENTERPRISE CLOUD DEVELOPMENT Guiding Diffy to the Enterprise land Dariusz Luksza Eryk Szymanski CollabNet Engineering, Potsdam, Germany

Upload: dariusz-luksza

Post on 25-May-2015

282 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Guiding Diffy to the Enterprise land

1 Copyright ©2014 CollabNet, Inc. All Rights Reserved.ENTERPRISE CLOUD DEVELOPMENTENTERPRISE CLOUD DEVELOPMENT

Guiding Diffy to the Enterprise land

Dariusz Luksza

Eryk SzymanskiCollabNet Engineering, Potsdam, Germany

Page 2: Guiding Diffy to the Enterprise land

2 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● First TeamForge Gerrit integration was hacked into 2.1 – this means close to zero possibility of update

● About 1,5 year ago we started our journey …

● So we started from scratch with 2.6 and its plugin architecture

● We had only three requirements:– Keep same behaviour and API as we had in 2.1

– Keep same performance characteristics

– Make it easy to update to newest upstream version

Page 3: Guiding Diffy to the Enterprise land

3 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● Few stats about our biggest plugin:– cat `find src/main/java -name "*.java"` | wc -l

11962

– du -sh src/main/java 828K src/main/java

● This is actually plugin responsible for synchronization with TeamForge

Page 4: Guiding Diffy to the Enterprise land

4 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

ExpectationsReality

The Road From 2.1 to 2.6

Page 5: Guiding Diffy to the Enterprise land

5 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

The Road From 2.1 to 2.6

Reality

Page 6: Guiding Diffy to the Enterprise land

6 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

The Road From 2.1 to 2.6

Page 7: Guiding Diffy to the Enterprise land

7 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

Obstacle 1

missing extension points

Page 8: Guiding Diffy to the Enterprise land

8 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● We are contributing back all our modifications to Gerrit:– Initial support for Web UI plugins (#38330, #38331, #38332),

– Fix binding of @Listen annotated extensions points in HTTP and SSH module (#39293),

– Bump GWT to 2.5.0 version and fix connected issues (#39540, #39610 #38962),

– Prevent from deleting refs/changes/ (#40385),

– Fix GitWeb Caching (#41360),

– Add additional context for group name suggester API (#40123),

– Initial work on making JavaSript plugins architecture more pleasant for JS developers (#39270),

– Allow include external group into internal one and set external group as a owner of internal one (#46840, #47020),

– Add --list-plugins and --install-pliugin parameters to init step (#47818, #47819),

– Fix ChangeMergedEvent parameter for merged patch sets (#48221)

– Improvements to logging subsystem (#51890, #52164)

– Make plugin servlet's context path authorization aware (#51192)

– Get rid of JdbcSQLException while numbers are read from cache (#51193)

Page 9: Guiding Diffy to the Enterprise land

9 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● But still some of our core contributions are in the review:– Authentication extension point

– Secure store extension point

– Commit verification fast path

● So what?– Instead of investing our time in new features (like Angular-

Gerrit) we are burning our cycles rebasing, resolving conflicts and testing above functionalities with current stable branch

Page 10: Guiding Diffy to the Enterprise land

10 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

Obstacle 2

redeploy & friends

Page 11: Guiding Diffy to the Enterprise land

11 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● Each plugin runs in separate ClassLoader

● If one of your libraries is not behaving well (eg. is not cleaning thread locals like Apache Axis does) you will get out of PermGen space after 5th or 10th deploy

● Solution? Simple, always restart gerrit before next deploy

● This work for us for quite long time... since our 4th plugin appears... we loaded Axis (and other dependencies) fourth time and we need to change container.javaOptions to increase PermGen size because Gerrit was unable to load all plugins

Page 12: Guiding Diffy to the Enterprise land

12 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● What is more, separate ClassLoaders for each plugin means NO class instance sharing between plugins!

● Solution? We didn't find one. Currently we share only one single piece of information (the repository ID) between our plugins, using refs/meta/teamforge ref

Page 13: Guiding Diffy to the Enterprise land

13 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

Obstacle 3

extending Web UI

Page 14: Guiding Diffy to the Enterprise land

14 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

HistoryProtection UI:

Notification UI:

Page 15: Guiding Diffy to the Enterprise land

15 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● Even after our contribution to 2.6 extending Web UI was hard (things dramatically changed in Gerrit 2.8)

● Further modifications in Gerrit were required:– GWT module for REST api

– JSNI extensions for REST calls

● Can't start GWT debug session with plugin(fallback to Window.alert() “debugging”)

● GWT based development is SLOOOOW!!

Page 16: Guiding Diffy to the Enterprise land

16 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

Chasing the community

the never ending story

Page 17: Guiding Diffy to the Enterprise land

17 Copyright ©2014 CollabNet, Inc. All Rights Reserved.

● Gerrit is a moving target

● Now we are on 2.7

● Still with 70 additional patches

● Most of them were contributed back... but were not merged yet

● So we are rebasing them on top of upstream

● Next stop? Gerrit 2.8...

● What is the hard part? Finding balance between contributions and our internal modifications

Page 18: Guiding Diffy to the Enterprise land

18 Copyright ©2014 CollabNet, Inc. All Rights Reserved.ENTERPRISE CLOUD DEVELOPMENTENTERPRISE CLOUD DEVELOPMENT

Thank you!

Dariusz Luksza

Eryk SzymanskiCollabNet Engineering, Potsdam, Germany