summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prevent creating repos on extra serversHEADv2.7.0-basedDoug Kelly2015-07-021-10/+18
| | | | | | | | | | | | | | | If using a group to replicate only certain repositories, it is possible to be in a state where the authGroup is used on some servers but not others. If this happened, Gerrit would create the repository on all servers, even if the authGroup would prevent replicating code to it. By ensuring the authGroup can see the project first, we don't create the repository if it's not needed. Bug: Issue 543 Change-Id: I2f189bdb6007228d0b25a6ce9c0357b3f97e4ced (cherry picked from commit 7c25cd575572410ef90a53d1af853fde7d011bf8) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix: Create missing repos when using git protocolJanice Agustin2015-02-101-1/+1
| | | | | | | | | | | | When using git protocol to replicate to a remote but there are missing repositories, the error thrown is a RemoteRepositoryException with the message "no such repository". Create the repository if this is detected. Change-Id: I920963f917e257ad5e889948419a8f78718e2b11 (cherry picked from commit 38c2a6b62ecc6fea9b41b1388c56f15ae760f3bb) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
* Fix: failure to create to missing remote repository via git://David Pursehouse2015-02-101-30/+37
| | | | | | | | | | | | | | | | When replicating to a remote via git:// and the remote repository does not exist, it fails with RemoteRepositoryError rather than the expected NoRemoteRepositoryException. This means that the remote repository never gets created. Catch RemoteRepositoryErrors that are likely caused by the remote repository not existing, and attempt to create it. Bug: Issue 2420 Change-Id: Icf516481d5c2eccb520ba5f6673e3bac00f4db6f (cherry picked from commit 62ac72c79de7648a5ae7fefd14d9e7c58b122ebe) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Differentiate error logs for local and remote repository errorsDavid Pursehouse2015-02-101-2/+6
| | | | | | | | | | | | | | | | | RepositoryNotFoundException is raised when the local repository cannot be opened. RemoteRepositoryException is raised when there is an error from the remote. Both of these errors result in the same error message "Cannot replicate project-name ..." being output to the log, which makes it difficult to determine which of the errors has occurred. Expand the log messages to make it possible to distinguish between local and remote repository errors. Change-Id: I63e24939200835e6c3a0bcacd4dd4c25ef766bf5 (cherry picked from commit be63459fb3367f988b3f8c8955181a3c55e34f55) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
* Add port to replication status and display path for local replicationHugo Ares2015-02-101-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Replication status was only displaying the hostname. It is impossible to differentiate replication status when 2 urls use the same hostname with different ports. Replication status now displays host[:port] and if the replication url does not have host(file:///), displays the path instead. Here are some examples of replication url and the replication status that is displayed: -url = git://someHost.com/${name}.git Replicate project1 to someHost, Succeeded! -url = git://someHost:1234/${name}.git Replicate project1 to someHost:1234, Succeeded! -url = file:///somePath/git/${name}.git Replicate project1 to /somePath/git/project1.git, Succeeded! Change-Id: Ia86154cb9f26dfdcae37dc9993fe2cd0f7c37838 (cherry picked from commit 87d7a646419badac537f83ca8b8c1858e06d9b25) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
* Support replication of project deletionsEdwin Kempin2015-02-104-21/+120
| | | | | | | | | | | | | | The replication plugin can now be configured to listen to project deletion events and to replicate the project deletions. In the configuration it can be decided per remote destination whether project deletions should be replicated to it or not. By default project deletions are not replicated. Change-Id: I1207015ed361155dd0353bed86860c794cdb2517 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com> (cherry picked from commit ad923e4e1e4ae3923d15a8b4eee36379423846be) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Create missing repositories on the remote siteEdwin Kempin2015-02-104-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | If during the replication of a ref it is found that the repository is missing on the remote site automatically create it on the remote site. E.g. a repository can be missing on the remote site if the remote site was not available at the moment when a new project was created and hence the repository for the new project could not be created on the remote site. This feature can also help to simplify the setup of a new remote site. Whether missing repositories should be created or not can be configured per destination. By default missing repositories are created. This is a change of the current behaviour but for most configurations it makes sense that the missing repositories are created which is why this should be the default. Change-Id: I4e587cdfca09445c9b1c528b2f1edae0944aec68 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com> (cherry picked from commit a9fcff5c4d0d99d7bc209431377bdba01ee04c2c) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Serialize pushes to each destination URI.Stefan Zager2015-02-102-63/+91
| | | | | | | | | | | | | Scheduling a retry to avoid collision with an in-flight push is differentiated from a retry due to a transport error. In the case of collision avoidance, the job is rescheduled according to the replication delay, rather than the retry delay. Change-Id: I55b592feccfea24e5d05978d749ef6c4054b5bc5 (cherry picked from commit 3fffd16403c1d3a4d6f0b13e9f33f4f78df1f6b4) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Introduce remoteNameStyle = basenameOnlySteffen Gebert2015-02-103-4/+19
| | | | | | | | | | | | | | | | | | | In order to replicate repositories below a certain namespace (e.g. foo/bar/), the projects parameter allows to filter repositories (projects = foo/bar/*). With the current implementation, the path on the target server contains the full path to these repositories (foo/bar/myrepo), which can only be modified in terms of replacing slashes with dash or underscore using the remoteNameStyle option. This patch adds a new value "basenameOnly", which only takes the basename of the repository path (e.g. myrepo when applied to foo/bar/myrepo), which, for example enables Gerrit user to replicate whole namespaces to a special Github organization. Change-Id: Id12780948a4841c054eb76e359f02dae0816d576 (cherry picked from commit 8b2db583893c149c55dd47cf0fcb59b38150fb70) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Add retry counts to replication tasks so they can be viewed by show-queue.Ahaan Ugale2015-02-101-1/+6
| | | | | | | | | | | | | Sample show-queue output: Task State StartTime Command ------------------------------------------------------------------------------ 76e89649 08:59:41.943 push aaa.com:/git/abc.git 760ad627 09:01:18.332 09:00:18.333 (retry 1) push aaa.com:/git/All-Projects Change-Id: I57f541af1778e072bd6ecd1c613ce9b332b2a5d8 (cherry picked from commit 7c07d52bc5029f4b80851045cb51d1dcaaf62f44) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Show the replication status after running the replication commandYang Zhenhui2015-02-1011-60/+575
| | | | | | | | | | | | | | | | | | | The actual replication work is done asynchronously and it is split into many subtasks, this patch adds the functionality that traces every subtask execution, once the task is finished, we can get replication status of all subtasks. This makes it possible for users to start the replication ssh command, and wait to see information about replication progress and errors in their consoles before the command exits. For the gerrit triggered replication of receiving a new patchset, we can also add some features in the future, for example, send stream events for a finished replication to a node. Change-Id: I0fc64e93faa9157fc936379de29691282388ba26 (cherry picked from commit 05f71912f4289480533773ffd05cb5cfcbe191bf) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Make ${name} optional when replicating only a single repositoryChristian Aistleitner2015-02-103-16/+45
| | | | | | | | | Thereby we allow to replicate a project under a different name. Change-Id: I6b010807560f4b44e8aac6ccfb32b061ce366a66 (cherry picked from commit 50972e33baba9eaa034ef9637efaf27e928d7a46) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Implement pattern-based project matching in replication.configChad Horohoe2014-10-283-4/+76
| | | | | | | | | | | | This allows you to use remote.$name.projects to either - Do wildcard-style matching, such as foo/* - Do regular-expression matching, such as ^foo/(bar|baz)$ Task-number: QTQAINFRA-892 Change-Id: I453d99ca354afeaf6dfbe467c7a81d2eb5440a74 (cherry picked from commit 0b9811b3bcd13e9d858d341935e660117c735569) Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
* Set version to 2.7 to match the Gerrit releasev2.7upstream/stable-2.7Dave Borowitz2013-09-181-1/+1
| | | | Change-Id: I6c43fac75487895bf1615acaa058fb2951aeb60f
* Set version to 2.7-SNAPSHOTShawn Pearce2013-05-101-1/+1
| | | | Change-Id: I184d3b13902db870c9969f214c20bf744b45beed
* Add name in the pom.xml to prevent it showing as Unnamed in the buildDavid Pursehouse2013-05-091-0/+1
| | | | Change-Id: I9898f562c6075eb2e854c2cb7ca2710cde58a153
* Set version to 2.6-rc2 to match the Gerrit releaseDavid Pursehouse2013-05-091-1/+1
| | | | Change-Id: Ic3c91d31ce4f62ef849e2e3168c8bca3dc31fbba
* Begin 2.8Shawn Pearce2013-05-061-1/+1
| | | | Change-Id: I84d9f3bf7777dc313d86270be1661f34e337b104
* Build against the same version of GerritShawn Pearce2013-05-061-1/+1
| | | | Change-Id: I94fd3e3fc15392dc57c31248a0d130ad15f3c66e
* Set version to 2.7-SNAPSHOT to match gerrit masterShawn Pearce2013-05-061-1/+1
| | | | Change-Id: Ia9f4b098918302bfff36a5fbe0ff862792d6afa1
* Use PluginUser instead of InternalUser when no authGroup specficiedShawn Pearce2013-04-253-9/+9
| | | | | | | | This user is automatically supplied by the Gerrit server as part of the Guice environment. It embeds the plugin name and may in the future have more information than what an InternalUser carries. Change-Id: Ie943565ccdf4cbcf5c5ca1721ac6ca1c14f1216e
* Merge "Catch RemoteRepositoryException while replicating to remote server"Shawn Pearce2013-04-251-0/+4
|\
| * Catch RemoteRepositoryException while replicating to remote serverYang Zhenhui2013-02-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | When using git:// protocol to replicate, if the remote repository has some problems, such as access denied, repository not exported or not found, jgit will throw RemoteRepositoryException. If this exception is not explicitly caught, it will instead be caught as TransportException, and the replication will be rescheduled. However in this case, rescheduling is useless. Change-Id: I6ed65656664bac0b4c55c9112c42c4812b98a2ea
* | Compile for Gerrit 2.6-rc0v1.1-rc0Shawn Pearce2013-03-211-1/+1
| |
* | Update replication for JGit 3.0 APIsChad Horohoe2013-03-181-1/+1
| | | | | | | | Change-Id: If1861a36f2b8e2c3298c77dc77a3e515ea0b1bcb
* | Add description to start ssh commandDavid Ostrovsky2013-03-012-2/+3
|/ | | | Change-Id: I7dd1feacf10ba1804b04a8f6a52c6f924f86e5f3
* Update to build against gerrit masterChristian Aistleitner2013-02-154-6/+18
| | | | | | | | | | Bumped version. Bumped used gerrit API version. Implemented required getReviewDbProvider for RequestContext. Injected required ChangeCache. Dropped no longer allowed git access path setting. Change-Id: I90ff9cb4a40466ab345f5729fdb034bebe81e3b8
* Add remote.NAME.remoteNameStyleChad Horohoe2012-12-192-0/+25
| | | | | | | | | | | | Github and Gitorious have naming conventions that do not allow for slashes in the repository name. This new option allows you to configure the replication plugin to replace slashes in the ${name} placeholder with dashes (-) or underscores (_). This option makes it much easier to replicate repositories from Gerrit to Github or Gitorious Change-Id: Ic4cd5ba6917412675342f6d1126f4b564c72a91a
* Update versions for creation of Gerrit-2.5v1.0Edwin Kempin2012-10-311-2/+2
| | | | | Change-Id: I7a98720a703a79ba71bac63dc1db78e74a379f1a Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* Update versions for creation of Gerrit-2.5-rc2v1.0-rc2Edwin Kempin2012-10-231-2/+2
| | | | | Change-Id: I4cecb19cfab790fbf8cc900887bde0922cfe63e8 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* Merge "Update versions for creation of Gerrit-2.5-rc1"Edwin Kempin2012-10-171-2/+2
|\
| * Update versions for creation of Gerrit-2.5-rc1v1.0-rc1Edwin Kempin2012-10-171-2/+2
| | | | | | | | | | Change-Id: I4a121d7f957d8c53565b95e109722e2577437cc8 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* | Fix a few typos in the documentationDavid Pursehouse2012-09-272-5/+5
| | | | | | | | Change-Id: I6f058e4eae9c86f942492f339c01f307a2e90cf6
* | Add IntelliJ IDEA project files to .gitignoreDavid Pursehouse2012-09-271-1/+3
|/ | | | Change-Id: I9e1cdf91e1fe0f2f54bfb4f6f98ae4aa7033ed84
* Fix Maven Repository URLEdwin Kempin2012-09-021-1/+1
| | | | | | | | | | | | The used version of the gerrit-plugin-api jar is now a release version (2.5-rc0). It is not available in the snapshot Maven repository [1] but in the release Maven repository [2]. [1] https://gerrit-api.commondatastorage.googleapis.com/snapshot/ [2] https://gerrit-api.commondatastorage.googleapis.com/release/ Change-Id: I77a11567d601dc3ec308383810f97a9b232f5b70 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* Update version to 1.0-rc0v1.0-rc0Edwin Kempin2012-07-301-2/+2
| | | | | | | Update Gerrit-ApiVersion to Gerrit 2.5-rc0. Change-Id: I781069a01932a5a9ac1d5843d7b97ea206c5f770 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* Fix import of RequiresCapabilityShawn O. Pearce2012-06-121-1/+1
| | | | Change-Id: I9c66bdd997517e5202a8ae245f44cb207ae43fc1
* Use the GroupBackend instead of the GroupCache.Colby Ranger2012-05-182-9/+11
| | | | | | | | The GroupCache only supports internal AccountGroups, but the GroupBackend can support any registered group backend. Replaced the GroupCache usage in the plugin. Change-Id: Ibb04270726079876950b14cacc5741b3b6a9b1d5
* Updated PerThreadRequestScope to be a singleton object.Colby Ranger2012-05-183-29/+61
| | | | | | | | | Previously, the object was considered static. Updated the methods to use the injected PerThreadRequestScope. Updated gerrit to version 2.5-SNAPSHOT. Change-Id: Ibe6091dbebc0adcdcff18826336995cce54a2baf
* Initial replication plugin, split from Gerrit Code ReviewShawn O. Pearce2012-05-1821-0/+2712
This plugin provides server driven replication within the Gerrit process using the JGit and JSch client libraries to push reference updates to remote destinations using the Git protocol. Taken from gerrit 5de34d9713108fb46e74c12b96db2e3e6be3c672. Change-Id: Id09595d4371e999d175268314d2e320f89839ef6