I plan on using this SSH server to implement uploads via direct git push over SSH, rather than using a "bundle over HTTP" technique like we did in Gerrit 1. At runtime MINA SSHD requires log4j and bouncycastle, but for some reason that I don't yet understand these are not listed in its pom as runtime dependencies; only as test dependencies. Signed-off-by: Shawn O. Pearce <sop@google.com>
134 lines
3.6 KiB
Plaintext
134 lines
3.6 KiB
Plaintext
Gerrit 2 - Developer Notes
|
|
--------------------------
|
|
|
|
You will need to have the GWT (Google Web Toolkit) SDK installed on
|
|
your system. A Java 5 or later SDK is also required to run GWT's
|
|
compiler and runtime.
|
|
|
|
GWT requires the Sun JDK (or OpenJDK). The GWT "hosted mode"
|
|
environment (Eclipse debugger or "make web-shell") does not work
|
|
under libgcj.
|
|
|
|
To create a new client workspace:
|
|
|
|
mkdir gerrit2
|
|
cd gerrit2
|
|
repo init \
|
|
-u git://android.git.kernel.org/tools/manifest.git \
|
|
-b gerrit2
|
|
|
|
|
|
Apache MINA SSHD
|
|
----------------
|
|
|
|
You'll need to download and build SSHD yourself:
|
|
|
|
svn checkout http://svn.apache.org/repos/asf/mina/sshd/trunk mina_sshd
|
|
cd mina_sshd
|
|
mvn install
|
|
|
|
|
|
Setting up the Database
|
|
-----------------------
|
|
|
|
You'll need to configure your development workspace to use a database
|
|
gwtorm supports (or add the necessary dialect support to gwtorm,
|
|
and then configure your workspace anyway).
|
|
|
|
cd devdb
|
|
cp GerritServer.properties_example GerritServer.properties
|
|
|
|
Now edit GerritServer.properties to uncomment the database you are
|
|
going to use, and possibly update properties such as "user" and
|
|
"password" to reflect the actual connection information used.
|
|
|
|
|
|
Setting up Eclipse
|
|
------------------
|
|
|
|
see gerrit/README_ECLIPSE
|
|
|
|
|
|
Debugging the Application
|
|
-------------------------
|
|
|
|
From Eclipse:
|
|
|
|
Use "gerrit_debug" launch profile (all platforms).
|
|
|
|
Use "gerrit_macos" launch profile (Mac OS X systems).
|
|
|
|
|
|
Building
|
|
--------
|
|
|
|
From the command line:
|
|
|
|
(cd appdist && mvn package)
|
|
|
|
Output packages will be in:
|
|
|
|
appdst/target/gerrit-*-bin.*
|
|
|
|
|
|
Client-Server RPC
|
|
-----------------
|
|
|
|
The client-server RPC implementation is gwtjsonrpc, not the stock RPC
|
|
system that comes with GWT. This buys us automatic XSRF protection.
|
|
It also makes all of the messages readable and writable by any JSON
|
|
implementation, facilitating "mashups" and 3rd party clients.
|
|
|
|
The programming API is virtually identical (you just need to extend
|
|
RemoteJsonService instead of RemoteService).
|
|
|
|
|
|
Why GWT?
|
|
--------
|
|
|
|
We like it. Plus we can write Java code once and run it both in
|
|
the browser and on the server side. This will be very useful as
|
|
we implement offline support in Gerrit.
|
|
|
|
|
|
Feature Roadmap
|
|
---------------
|
|
|
|
* Everything Gerrit does today.
|
|
|
|
This list is long so I'm not listing it all here.
|
|
|
|
* Offline Support
|
|
|
|
Initially we will use Google Gears, but HTML 5 will include
|
|
standardized offline application support that we should make
|
|
use of. With GWT we can target both. The plan is to initially
|
|
target Google Gears, and add HTML 5 support once Gerrit 2 is
|
|
mostly functional and/if at least one major browser supports it.
|
|
|
|
* Federated Instances
|
|
|
|
Gerrit 2 instances should be able to forward changes between
|
|
each other. This couples with the next item ("No Google") to
|
|
allow corporate contributors to open source projects to use a
|
|
Gerrit 2 server internally to review (and scrub protected IP)
|
|
prior to submitting changes upstream to a public Gerrit server
|
|
and an established open source project.
|
|
|
|
* No Google Requirement
|
|
|
|
Gerrit 2 must not require any Google services to run. This makes
|
|
it suitable for installation inside of corporate firewalls where
|
|
information security demands certain data stays internal.
|
|
|
|
* Arbitrary SQL Database
|
|
|
|
Gerrit 2 should support any standard SQL database, including
|
|
popular open source (PostgreSQL, MySQL, SQLite) and pure Java
|
|
implementations (H2). Some commerical servers may wind up being
|
|
supported, but only by virtue of Gerrit 2 sticking to a very small,
|
|
commonly implemented subset of SQL.
|
|
|
|
This requirement (and the prior one) means Gerrit 2 won't run on
|
|
Google App Engine, as GAE does not support arbitrary SQL syntax.
|