Commit Graph

126 Commits

Author SHA1 Message Date
Ian Wienand 234ed85a92 Retire repo
Change-Id: I7d68f82c75cbc4dc7e843198593846e19cf88f14
2022-04-05 13:20:00 +10:00
Magnus Vigerlöf f86b214184 Replace the shell code that tries to emulate git config with an error.
Replace the code with an error message that git has to be
in the PATH instead of trying to parse gerrit.conf with
shell code. The shell code do not remove whitespaces as
it should and this will give stranger errors when looking
for java later in the script (all platforms/shells).
This code doesn't seem to have been used anyway.

Change-Id: Ideba5b950a97c0e77839cbddd4616ef737470da2
2011-06-07 22:17:34 +02:00
Shawn O. Pearce 4e67700dab Change version to 2.2-SNAPSHOT
Change-Id: I1d3e6c42bc678536162a81d2b13372659a1c3dec
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-31 10:30:57 -07:00
Shawn O. Pearce 106e5b7b00 Merge branch 'stable'
* stable:
  Update 2.1.7 release notes
  ExportReviewNotes: Default to 2 threads

Change-Id: Icc576083ec6ffa5cbbe5163ab34b8c843dc3ab66
2011-05-31 10:13:41 -07:00
Shawn O. Pearce bf9d9ed987 ExportReviewNotes: Default to 2 threads
Not all systems have enough database connections in the connection
pool to support 2 threads per CPU. Exporting lots of changes doesn't
take that long, so 2 threads is acceptable.

Change-Id: I69bbade7f67023689ca54665833bc764d2d5503d
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-31 09:52:46 -07:00
Shawn O. Pearce 7f84ef2379 ExportReviewNotes: Fix duplicate Guice bindings
The GitRepositoryManager and @GerritPersonIdent PersonIdent are now
bound in the SchemaModule as part of the git-store topic.

Change-Id: I3935b7d699c899e419d8db0836ad5dd9e2894aff
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-23 08:44:32 -07:00
Shawn O. Pearce b352fc6c5e Merge branch 'stable'
* stable:
  Fix SLF4J StaticLoggerBinder warning
  ExportReviewNotes: Dump submitted changes to refs/notes/review

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/git/CreateCodeReviewNotes.java

Change-Id: I147ba04af6d8af4177dcdd94d55e8b1c7d9b10e9
2011-05-20 17:02:49 -07:00
Shawn O. Pearce 1b8810f411 ExportReviewNotes: Dump submitted changes to refs/notes/review
This program allows site administrators to dump their existing notes
out to the refs/notes/review branch, making the prior data available
to Git clients.

Change-Id: Iebaf1e4b2fb4620443e80d2a8f840cb30ae1e389
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-20 14:44:28 -07:00
Shawn O. Pearce cb115b6d24 Fix unused import/code warnings
Change-Id: Icb4968bfc340333ee613cfe3dfe01d3de49358d4
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-19 17:33:37 -07:00
Shawn O. Pearce a56d834d2b Move "projects" table into Git
Project settings are now saved in the project.config file of the
refs/meta/config branch within each Git repository.  This offers
us free version control over the lifespan of the project, and will
help reduce schema version issues as the configuration file is
more free-form.

Project owners can edit the configuration of their project by
hand and push the results back up, possibly even going through
code review, if the proper access rules are assigned in the
project's access panel.  Project users can inspect the history of
the configuration by reading the history of the refs/meta/config
branch with their favorite history browser.

Change-Id: Id63414d86dbfb9033021f76e1d5e782373525a77
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-19 16:53:02 -07:00
Shawn O. Pearce 89cefced8d Remove the GitProjectImporter
Since projects are listed by recursively walking the filesystem,
we don't need to import them into the database.

Change-Id: I86613ac34a9c0ac68ba82b70b2c0312f877a8e69
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-19 16:53:01 -07:00
Shawn O. Pearce b30fdbba90 init: Fix prompting for Account BaseDN
This was accidentally dropped as dead code.

Change-Id: Ie5d5f6425829c8f1361ea05eb71266aab75986eb
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-19 11:54:55 -07:00
Shawn O. Pearce 27a8ebf0ce Fix SQLNestedException deprecated import warning
Change-Id: I3cf0b581458939ee434ddc20c4cd25956e9c280a
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-05-19 09:58:35 -07:00
Nasser Grainawi 3755e9fd85 Remove unnecessary warning suppression
Change-Id: Iac493ad8be46d29e82ffb3007aadf25a49debfa8
2011-05-19 08:06:40 -07:00
Nasser Grainawi 8bc0d7d481 Remove dead code and unused variables
Change-Id: If87f7ad452ce597c82872b36a76f32afcc6ab7fd
2011-05-19 08:06:39 -07:00
Magnus Vigerlöf 6deefab936 Updated the start/stop script so it is sh compliant.
Some OSes are more restrictive than other what the sh interpreter
will accept. Solaris is particularly picky about what is allowed.

Change-Id: Iebad888e52ea01bd21e0d36f517d639e35b3e04d
2011-05-11 21:21:34 +02:00
Shawn O. Pearce 6252383a8f gerrit.sh: Fix issue on SuSE Linux
Change-Id: I02dc105e47f5b31ff902763bd4b0bf7a925ac8a8
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-04-21 18:36:44 -07:00
Shawn Pearce dd187ce27f Merge "Bump dependencies to latest stable versions" 2011-04-07 19:50:03 -07:00
Shawn O. Pearce 64b1446e26 gerrit.sh: Support spaces in JAVA_HOME
Mac OS X may have spaces in its JAVA_HOME path, so support those by
avoiding contexts where it isn't properly quoted or protected from the
shell splitting rules.

Change-Id: I228c3e6456009ffb4adec7d1a385ea0d333258d0
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-04-05 14:34:01 -04:00
Sasa Zivkov b6f13cd1cb Using JGit revision 0.10.1.62-gbe38185
It is necessary to use at least this revision in order to get the
new functionality of merging Git notes available to Gerrit. Gerrit
will make use of this functionlity to finish the implementation of
the change 20045.

Change-Id: I406d3b708187fb7b15660f89dbcdf108d5d0fba7
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2011-01-11 15:12:39 +01:00
Anatol Pomozov 76de00db80 Bump dependencies to latest stable versions
Change-Id: I5e8903e55843a671408d0fee213b694f1d27669e
2011-01-05 15:39:32 -08:00
Shawn O. Pearce d2593a24e6 Use Project.NameKey in GitRepositoryManager
This simplifies all of the calling sites, where they have a
Project.NameKey on hand and would prefer not to invoke .get() to
convert it into a String.

Change-Id: If661fc07cff542a57af3c28f27ab401ce7b3a656
Signed-off-by: Shawn O. Pearce <sop@google.com>
2011-01-04 12:05:05 -08:00
Shawn O. Pearce e143def387 Fix push over HTTP
Authentication was broken for push over HTTP when using the internal
Jetty daemon, as the ProjectQoSFilter was installed in front of the
ProjectDigestFilter and asked for the user identity in order to know
which type of queue to schedule the request onto.  This caused the
ProjectQoSFilter to always authenticate the request as ANONYMOUS,
which later caused it to reject the push because Gerrit never
permits an anonymous user to push to a project.

Moving the ProjectQoSFilter after all other filters (but just before
the servlet itself) fixes this issue.  Fortunately Guice allows
us to register the filter after the servlet, which means we just
needed to flip the order the modules are installed into the injector.

Change-Id: Ie59db01e731e4269a968f10bb5d17e94afe6518e
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-12-13 10:22:53 -08:00
Ian Kumlien a32900fbc8 gerrit.sh: tell oom killer to respect us.
Since gerrit is usually a essential process that can consume a lot of
memory and you might run other memory hogs (git gc, git repack) on the
same machine, lets tell the oom killer that we prefer not to be killed.

Currently this only works if we're root... And i don't know if the
values is what we'd want to use in real life.
2010-11-27 03:02:19 +01:00
Ian Kumlien 56ed4f6e33 gerrit.sh: actually verify running processes
When doing a gerrit.sh check, currently we only look for the pid file.
If the service has crashed or something else has shut it down, we won't
see it and since Gerrit usually is pretty critical we should make sure
that we verify that we have a process running.
2010-11-27 02:39:46 +01:00
Sasa Zivkov eabc89728c SSO via client SSL certificates
Support for authentication using client side SSL certificate.  This
authentication type is actually kind of SSO. Gerrit will configure Jetty's SSL
channel to request client's SSL certificate. For this authentication to work a
Gerrit administrator has to import the root certificate of the trust chain used
to issue the client's certificate into the <review-site>/etc/keystore.

For the Gerrit's server side SSL certificate one can use a certificate signed
by a CA or a self-signed certificate.

After the authentication is done Gerrit will obtain basic user
registration (name and email) from LDAP, and some group memberships.

Change-Id: Ic076178f844f05b73be5d7c8fe9c8bb29b458f26
2010-10-13 15:54:31 +02:00
Shawn O. Pearce 9b01cefd53 init: Don't write files unless changed
If the configuration file hasn't been modified by the init program,
don't attempt to write it out to disk.  Do the same for gerrit.sh
and also the mail templates.

Change-Id: I7eca3f654a7504b990da8a386e6a6d568caa9ac8
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-08-28 17:56:57 -07:00
Shawn O. Pearce f4363c43cb init: Remove unused import
Change-Id: I9dfd73d029a533937107e4c77a30dbb56fef7708
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-08-28 17:44:31 -07:00
Shawn O. Pearce 122ea72ba2 Release any ObjectReaders created by JGit
RevWalk implicitly creates an ObjectReader if you call its Repository
based constructor.  Ensure we always release those ObjectReaders,
or use our own that we can release when we are done.

Change-Id: I6421507d248e331e7c35bdeb7831ea2f7bcff6b5
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-08-23 11:58:42 -07:00
Shawn O. Pearce 6001b80cc7 Merge branch 'stable'
* stable: (30 commits)
  Clarify the upgrade instructions
  Draft release notes for 2.1.5
  documentation: Document why hook --change-url might be missing
  documentation: Fix rendering errors in gerrit.config
  Allow ; and & to seperate parameters in gitweb
  Include a quick summary of the size of a change in email
  Display the size of a patch (lines added/removed)
  Fix clearing of topic during replace
  Fix inherited Read Access +2 not inheriting
  Add some basic RefControl tests for delegated ownership
  Fix branch owner adding exclusive ACL
  Optimize RegexFilePredicate for common matches
  Correct copyright headers to AOSP
  Don't expose /COMMIT_MSG as a modified file in ChangeData
  Don't enable dk.brics.automaton's optional syntax
  Fix NPE while matching file:^ pattern on deleted files
  Fixed unused imports in OutgoingEmail
  Don't show /COMMIT_MSG in change emails
  Fix NPE during merge failure on new branch
  Honor user's syntax coloring preference in unified view
  ...

Conflicts:
	gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java
	gerrit-server/src/main/java/com/google/gerrit/common/ChangeHookRunner.java
	gerrit-server/src/main/java/com/google/gerrit/server/mail/ChangeEmail.java
	gerrit-server/src/main/java/com/google/gerrit/server/mail/CommentSender.java
	gerrit-server/src/main/java/com/google/gerrit/server/mail/OutgoingEmail.java
	gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListCacheImpl.java
	gerrit-server/src/main/java/com/google/gerrit/server/patch/Text.java

Change-Id: I80bfdb55872fa4bdf4f751c337b609e7ec809605
2010-08-23 11:39:41 -07:00
Mark Keisler 7c0ab611d2 gerrit.sh: Correct /etc/default path in error message
Corrected /etc/default/gerrit to /etc/default/gerritcodereview in
NO_START exit message.

Change-Id: Ida5aa142c95320e16142888e8009b1e9e082f756
2010-08-19 15:09:08 -07:00
Shawn O. Pearce f855f399f8 Fix all of our pom.xml versions to be 2.1-SNAPSHOT
I meant to keep reusing the 2.1 version number for the entire
2.1 series during development, but botched it during the 2.1.4
development cycle and set it to 2.1.4-SNAPSHOT by mistake.  Put
it back to 2.1-SNAPSHOT since 2.1.4 is released.

Change-Id: I37e206c0609bf3fd94a5aab8ea301c98b7fb013e
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-08-12 16:24:43 -07:00
Martin Fick 679fc379c8 Convert 3 email classes to file based templates.
Convert the NewChange, RegisterNewEmail and ReplacePatchSet
classes to use file based velocity templates which an admin
may edit.  Factor out getChangeDetail and getReviewersNames
from formatChangeDetail and formatSalutation respectively
to enable this.

Change-Id: I36aa7051f06c7641114e2e681639267769846c22
2010-08-12 13:46:53 -06:00
Martin Fick 40ed99f805 Convert the Abandoned and MergeFail email classes to templates
Convert the AbandonedSender and MergeFailSender classes to use
file based velocity templates which an admin may edit.

Change-Id: I5eae65a46aea074ef25bfc259c013f9be91fdc2f
2010-08-12 13:44:27 -06:00
Martin Fick 382e0a8972 Use a template to set the contents of the CommentEmails.
Add an admin editable Comment.vm template used to format the
contents of the comment emails.

Change-Id: Ic8e9cf6c3b60ae0c4a0e8a05537cf308a40ee694
2010-08-12 13:41:54 -06:00
Martin Fick 82bd12c409 Use a template to set the footer on ChangeEmails.
Add an admin editable ChangeFooter.vm template used to
format the footer in ChangeEmails.

Change-Id: I8f6f80b7a3e1fdb39ee1ea20aa84738286bce826
2010-08-12 13:38:45 -06:00
Martin Fick 7305be4faf Use a template to set the contents of the MergedEmails.
Add an admin editable Merged.vm template used to format the
contents of the merged change emails.

Change-Id: I79823c2135383a7dbf7f245abea3d693db025150
2010-08-12 13:34:33 -06:00
Martin Fick b7f3b2d5be Use a template to set the subject line.
Add an admin editable ChangeSubject.vm template used to
format the subject header in change emails.

Change-Id: Iea58807b9a947bf0a4eba31c04977582430137ed
2010-08-12 13:27:09 -06:00
Shawn O. Pearce 5f11b2954c Update to JGit 0.8.4.240-g8e9cc82
Change-Id: Id43a1846b31bb1aad40ca0ae295a268fcacd162f
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-08-05 18:14:38 -07:00
Shawn O. Pearce 8943adf8dc Fix 503 error when Jetty cancels a request
When we added the non-interactive execution queue we broke the
ability to cancel a pending project request that had been deferred
with a Jetty continuation.  When the timeout is reached we are
invoked through a different code path that bypasses the GuiceFilter,
which means we don't have access to the current user state.
That prevents us from finding the proper WorkQueue.Executor to
cancel the task from.

Remember the WorkQueue.Executor we pushed the task into, so we
can remove it from the same queue.

Bug: issue 614
Change-Id: I76344befc1c248cbd03f34d629d3ea15d9ef8bbf
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-07-13 10:32:41 -07:00
Anatol Pomazau 9e6445b9b3 Migrate easymock to version 3.0. This is the latest stable release.
Change-Id: Idfdfbfa9252a61b6ac86d6942034753365d41675
2010-07-12 12:51:55 -07:00
Shawn O. Pearce faee655254 Start 2.1.4 development
Change-Id: I71719c85b0d50707333517b8ef956853b04efa14
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-06-21 17:41:54 -07:00
Shawn O. Pearce f51d48c111 gerrit 2.1.3
Change-Id: I93386d5b71e8361219c03d95ab7476dc46e7d6b0
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-06-21 14:40:34 -07:00
Shawn O. Pearce d5c3530d89 gerrit.sh: Request at least 1024 file descriptors
We may run out of transient file descriptors if packedGitOpenFiles is
too low, such as the default setting of 128.  Assume we can get at
least 1024 file descriptors and request that many by default.

Bug: issue 460
Change-Id: I45e62a8af9f3763eacf977431c299193f014bd1e
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-06-16 20:06:06 -07:00
Shawn O. Pearce e800b1e0f3 ScanTrackingIds: Utility to update tracking ids in the database
This simple command looks at every change's most recent patch set
and reindexes the associated tracking information, based on the
current trackingid blocks in gerrit.config.  Administrators can
run this command to reindex existing records after making changes.

Bug: issue 124
Change-Id: I152ce430f84b70b6f84510f1abefc8da6037e746
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-06-16 17:44:30 -07:00
Fredrik Luthander b8f7d6d287 container.slave defaults to --slave behavior
When running Gerrit in large environments it's sometimes necessary
to configure Gerrit slave installations.  This change adds the
configuration option container.slave, if set to true gerrit.sh
is called with the slave switch. If no value is set (or any other
value), Gerrit defaults to master mode.

Change-Id: Ic4103e0d3d952e0d56b6aa5101d20c960588772a
2010-06-16 16:19:36 -07:00
Nico Sallembien a78a37cf45 Simplify reference level access control.
The initial implementation of reference level access control only
supports a corner case, that of "locking down" access for a specific
branch.

Upon further discussion, we've decided that this is not the more
general need. Most Gerrit configurations prefer to have a more "open"
access model, where access rights on a reference specified with a
wildcard, such as "refs/heads/*" aren't overridden by a more specific
access right. So this change makes the default behavior to evaluate
all rights, including the wild card ones.

However, in order to accomodate the corner case we were supporting
before, this change also introduces a new way to specify exclusive
reference level access rights. All access rights that start with the
'-' prefix are considered exclusive, and will prevent all wild card
rights from being considered.

Change-Id: I629f5439967b2141e46098614fadb25ff28e5f45
2010-06-08 09:39:02 -07:00
Nico Sallembien fc53f7fd7a Add a separate queue for non-interactive users
A new internal user group, "Non-Interactive Users" is added. members
of this group are not expected to perform interactive operations on
the gerrit web frontend.

However, sometimes such a user may need a separate thread pool in
order to prevent it from grabbing threads from the interactive users.

This change introduces a second thread pool, which separates
operations from the non-interactive users from the interactive ones.
This ensures that the interactive users can keep working when
resources are tight.

Change-Id: I16334dd84ec50e1a6ca894e635c8beea9bd42115
2010-05-21 09:35:59 -07:00
Shawn O. Pearce ecbd9eda8f Update H2 to 1.2.134
Change-Id: I9093abb8ea3e592d58413f10f665340f0e231924
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-04-27 18:27:16 -07:00
Shawn O. Pearce f28c6952a2 Ensure uncaught exceptions are logged into server error log
Normally these go to stdout, but in daemon mode that is usually
the useless /dev/null device.

Bug: issue 483
Change-Id: Ida8d0c91744410b316ba32834a2307b10bc312f8
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-03-04 19:01:36 -08:00