Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Gerrit JavaScript Plugins

1,457 views

Published on

Quick overview of building plugins using pure JavaScript or Google Web Toolkit (GWT), and a group discussion to identify important UI extension points for Gerrit contributors to make available.

Published in: Technology, Business
  • Be the first to comment

Gerrit JavaScript Plugins

  1. 1. JavaScript Plugins Introduction ● ● Current status: ➔ Native JS plugins ➢ Generate plugin stub from Maven artifact ➢ Important parts of JS plugin ➢ Build and deployment ➔ GWT plugins ➢ Generate plugin stub from Maven artifact ➢ Important parts of GWT plugin ➢ Build and deployment ● To be defined: ➔ Client side extension points ➔ Registering server side services Dariusz Łuksza (@dluksza) CollabNet Engineering Office Potsdam, GermanyENTERPRISE CLOUD DEVELOPMENT
  2. 2. What is Gerrit?2 Copyright ©2012 CollabNet, Inc. All Rights Reserved.
  3. 3. What is Gerrit?
  4. 4. What is Gerrit?
  5. 5. 2.5 Plugin infrastructure5 Copyright ©2012 CollabNet, Inc. All Rights Reserved.
  6. 6. What can be done in 2.5?Extension points: ● Stable API ● Listen for events ● Register new SSH command ● Register new HTTP servletsPlugins:● API is strongly coupled with Gerrit internals... because they are Gerrit internals● Can do all the rest...
  7. 7. What can be done in 2.5?Extension points: ● Stable API ● Listen for events ● Register new SSH command ● Register new HTTP servletsPlugins:● API is strongly coupled with Gerrit internals... because they are Gerrit internals● Can do all the rest... except of thins that it cannot do.
  8. 8. What can be done in 2.5?Extension points: ● Stable API ● Listen for events ● Register new SSH command ● Register new HTTP servletsPlugins:● API is strongly coupled with Gerrit internals... because they are Gerrit internals● Can do all the rest... except of thins that it cannot do: ● Cannot define own authentication method, ● Cannot change Web UI
  9. 9. JavaScript Plugins9 Copyright ©2012 CollabNet, Inc. All Rights Reserved.
  10. 10. Generate JS plugin stub *$ mvn archetype:generate -DarchetypeGroupId=com.google.gerrit -DarchetypeArtifactId=gerrit-plugin-js-archetype -DarchetypeVersion=2.6-SNAPSHOT -DgroupId=com.collabnet -DartifactId=gerrit-js-plugin-stub
  11. 11. GWT Plugins13 Copyright ©2012 CollabNet, Inc. All Rights Reserved.
  12. 12. Generate GWT plugin stub *$ mvn archetype:generate -DarchetypeGroupId=com.google.gerrit -DarchetypeArtifactId=gerrit-plugin-gwt-archetype -DarchetypeVersion=2.6-SNAPSHOT -DgroupId=com.collabnet -DartifactId=gerrit-gwt-plugin-stub
  13. 13. Extension API19 Copyright ©2012 CollabNet, Inc. All Rights Reserved.
  14. 14. Requirements for extension APIRequirements: Client side: ● Easy to consume ● Easily accessible from GWT and JavaScript ● Allow cross-plugin interactions/dependencies (?) Server side: ● Automatically bind services ● Support server side dependency injection ● Use common protocol for GWT and JavaScript (?) ➢ Use JSON ➢ Or provide JavaScript API for GWT base protocol (RequestFactory?)
  15. 15. First idea of client extension APIFirst draft idea of GWT client side extension point API: import com.google.gwt.user.client.ui.Widget; public interface GerritUi { // we should also consider here async calls // and somehow provide data from UI public interface ExtensionListener { boolean performAction(); } public interface Actions { void addOnChangeSubmittListener(ExtensionListener l); void removeOnChangeSubmittListener(ExtensionListener l); } public interface Containers { void appendToMainMenu(Widget widget); void removeFromMainMenu(Widget widget); } Actions getActions();
  16. 16. JavaScript Plugins Dariusz Łuksza (@dluksza) CollabNet Engineering Office Potsdam, GermanyENTERPRISE CLOUD DEVELOPMENT

×