357 Commits

Author SHA1 Message Date
David Ostrovsky
5863fcf7c0 Merge "Bazel: Generate source dir for plugins in eclipse classpath" 2016-11-25 10:10:52 +00:00
David Ostrovsky
64e1aff339 Bazel: Generate source dir for plugins in eclipse classpath
Change-Id: I9f71808b2ce6b29523143bcc98de4a5f50a5dc94
2016-11-25 09:58:39 +00:00
David Ostrovsky
933df2ad04 Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Bazel: Increase test timeout
    
    Change-Id: I577ee5967c95dd5be10252fe284662a7151119b2
2016-11-24 13:30:56 +00:00
Eryk Szymanski
198976610d Update git submodules
* Update plugins/replication from branch 'master'
  - Add ReplicationScheduledEvent to indicate ref replication is scheduled.
    
    Assure that event is posted only once each time a ref is scheduled.
    Covers the corner case when the ref is added to already scheduled push.
    
    Change-Id: I175940f8d4c6b9164c41bbec8c52d221ec30001b
    Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
2016-11-24 01:34:42 +00:00
David Ostrovsky
ff719bb551 Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Bazel: Run plugin tests non-hermetically
    
    The plugin tests required the plugin to be built and installed to the
    test site (controlled by the test), so that this implementation is by
    design non hermeticized so we can't run in the sandbox.
    
    Change-Id: I39b981aaa4c6063f34e97db59a34b6a0f238e28b
2016-11-16 22:49:02 +00:00
David Ostrovsky
074e7868a7 Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Implement bazel build
    
    Tests are still failing as acceptance test framework wasn't migrated
    to Bazel yet.
    
    Change-Id: I4f48925df31a9a79da631b0a9ccd2b724a674270
2016-11-15 23:44:46 +00:00
David Pursehouse
ba017123d0 Update git submodules
* Update plugins/download-commands from branch 'master'
  - Merge branch 'stable-2.13'
    
    * stable-2.13:
      CloneWithCommitMsgHook: Fix HTTP clone command inconsistency
    
    Change-Id: I97fafb4e6972d5f11e3dddfd69ad0711d0c0bf7f
    
  - Merge branch 'stable-2.12' into stable-2.13
    
    * stable-2.12:
      CloneWithCommitMsgHook: Fix HTTP clone command inconsistency
    
    Change-Id: I8a86b8cc56834933391afd56fc93d4ece67a4401
    
  - CloneWithCommitMsgHook: Fix HTTP clone command inconsistency
    
    When cloning a project using HTTP schema, the "/a" in the URL was added
    only when choosing to clone without the commit hook. Now the URL is the
    same in both cases.
    
    Change-Id: I8fc0667f17cea592bd702a0441cba7ca3f762968
    (cherry picked from commit d632d6471b42a47877664a5266ba509026538a32)
2016-11-14 22:26:04 +00:00
David Ostrovsky
02069e6907 Bazel: Stamp core plugins
TEST PLAN:

  $ bazel build release

Install bazel-bin/release.war and verify that the versions of the
core plugins are reported correctly:

commit-message-length-validator: v2.13.1-2-g76b911
download-commands: v2.13.2-5-gd632d64
hooks: v2.13.2-7-gf27c7e7
replication: v2.13.2-17-g531ed1
reviewnotes: v2.13.1-7-g45f6975

Change-Id: Iaceeeb1daafd7455c8d8a3673682d1ab9e65d8ef
2016-11-12 15:45:39 -08:00
Hector Oswaldo Caballero
3a75214a45 Update git submodules
* Update plugins/download-commands from branch 'master'
  - CloneWithCommitMsgHook: Fix HTTP clone command inconsistency
    
    When cloning a project using HTTP schema, the "/a" in the URL was added
    only when choosing to clone without the commit hook. Now the URL is the
    same in both cases.
    
    Change-Id: I8fc0667f17cea592bd702a0441cba7ca3f762968
2016-11-11 18:32:50 +00:00
Luca Milanesio
a67575aa90 Update git submodules
* Update plugins/replication from branch 'master'
  - Fix Bazel build with testonly attribute set
    
    Replication plugin tests depend on //gerrit-acceptance-framework:lib
    which is flagged with testonly attribute.
    
    For Bazel, all the dependencies in the tree need to have the testonly
    set consistently.
    
    Change-Id: I0eb3f6c3f2123b66b98b8c8060badc9bbaa88dd6
2016-11-09 19:47:24 +00:00
Hugo Arès
625adda318 Update git submodules
* Update plugins/replication from branch 'master'
  - Create Destination using Guice Factory
    
    Destination classes were instantiated in ReplicationFileBasedConfig
    which required to have all Destination dependencies injected in
    ReplicationFileBasedConfig.
    
    Create Destination using a new DestinationFactory to stop having to
    pass dependencies from one class to another.
    
    Also-By: David Pursehouse <dpursehouse@collab.net>
    Change-Id: If4d9bc5266837b8fec261decfbd1e651c4cb0f51
    
  - ReplicationFileBasedConfig: Replace FluentIterable with streams/lambda
    
    Change-Id: I85356369f245a45aaef6db20655ac18750cb3400
2016-11-04 02:16:30 +00:00
Han-Wen Nienhuys
29cced5e29 bazel: remove 'out' attribute from genrule2, and use throughout.
This centralizes the OSX mktemp solution.

Change-Id: Iaab18450146b649245b36865bedc5d7b50d1aa07
2016-11-02 13:54:10 +01:00
David Pursehouse
12b0267ecb Update git submodules
* Update plugins/hooks from branch 'master'
  - Merge branch 'stable-2.13'
    
    * stable-2.13:
      Add project name to commit received hook
      Always return the output from ref-update hook
    
    Change-Id: Id86c2c7acf94e2a7b2e1a3e3af7c3637b054f65f
    
  - Add project name to commit received hook
    
    This also implicates that GIT_DIR and the working directory is correctly
    set for the ref-update hook.
    
    Bug: Issue 4841
    Change-Id: I48141d316cacdd649f6e56ea48d689d06940fbf5
    
  - Always return the output from ref-update hook
    
    Change I5905c44c7 moved the invocation of the ref-update hook out of
    the ReceiveCommits implementation and into CommitValidators. Since
    then, the output of the ref-update hook is not sent back to the git
    client except in the case of an error or rejection.
    
    Update the handling of the ref-update hook in the plugin so that its
    output is returned back to the caller as a commit validation message
    which is then sent to the client.
    
    Change-Id: I88af8a3c690cc226214208c3c93f552f054ccae0
    Reported-By: Robert Niemi <robert.den.klurige@googlemail.com>
2016-11-02 07:52:01 +00:00
David Pursehouse
617fa26c2d Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Get rid of dependency on Guava
    
    Since I789f9aa589 removed usage of Guava's Optional, we only have
    the dependency on Guava for the following simple utility methods:
    
      Strings.isNullOrEmpty
      MoreObjects.firstNonNull
    
    Remove the dependency and instead provide own implementations
    of those methods.
    
    Change-Id: Iddcc20005004d37dae703fc0522c546a5212575c
2016-10-28 13:47:34 +00:00
David Pursehouse
26e23723f9 Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Bump GWT to 2.8.0 final release
    
    Change-Id: Ica57a0c2ebd31ccd39b25870a674cd25e31b49b2
    
  - Add missing dependency on gerrit-acceptance-framework
    
    Change-Id: I8d2ebdad5687230f63c2fcca7c2383f9653e24d6
2016-10-28 04:44:55 +00:00
David Pursehouse
cf03df12bb Update replication plugin back to latest revision
Change Id45967aa8 accidentally reverted it to an earlier revision.

Change-Id: If545ce34ae3f586954b8746b4a5e433cb46d369c
2016-10-27 08:28:43 +09:00
Han-Wen Nienhuys
da5999b039 bazel: build a polygerrit war too.
Change-Id: Id45967aa844faedee3ab501491cd30cdb903a789
2016-10-25 13:12:26 +00:00
David Pursehouse
7b8b81f192 Merge "Upgrade Guava to 20.0-rc1"
* submodules:
* Update plugins/replication from branch 'master'
  - Remove usage of deprecated Throwables methods
    
    The propagate and propagateIfPossible methods are deprecated in
    Guava 20. Replace them with the recommended alternatives.
    
    Change-Id: I8aacba415a15655850c9d2e7ba8bd207db930460
2016-10-24 23:16:13 +00:00
David Pursehouse
d97d02de9f Update git submodules
* Update plugins/replication from branch 'master'
  - Merge branch 'stable-2.13'
    
    * stable-2.13:
      Make SearchingChangeCacheImpl nullable when replicating from slave
    
    Change-Id: I0d23a61100350239432d8eeb701483afe0625fb6
    
  - Make SearchingChangeCacheImpl nullable when replicating from slave
    
    SearchingChangeCacheImpl should be nullable in slave mode.
    
    Change-Id: If22407565f44e7ed201e57d7d3b7b9a51f20b5bc
2016-10-19 08:36:26 +00:00
Dave Borowitz
46b3de5baf PluginContentScanner: Use java.util.Optional
Change-Id: I5df1e0b21b727f19ee034e3df54d14d4b54516e1
2016-10-13 16:52:12 -04:00
Dave Borowitz
10b05e7285 Update git submodules
* Update plugins/reviewnotes from branch 'master'
  - Fix errant tab
    
    Change-Id: I58e1d3f7ccb67e468c8b477da3859763a4541c64
    
  - Reduce boilerplate with Maps.immutableEntry
    
    Change-Id: I5b3ea3d33c2e86dd3b7fa0ab0a32490a4a61a0ca
2016-10-13 15:00:58 +00:00
Han-Wen Nienhuys
a2280d455a Update git submodules
* Update plugins/commit-message-length-validator from branch 'master'
  - Ignore IntelliJ *.iml files
    
    Change-Id: I4183c9a9e2841e40dd977af8212bb6c61bdd3c8a
    * Update plugins/cookbook-plugin from branch 'master'
  - Ignore IntelliJ *.iml files
    
    Change-Id: I330430909075a5dc751fe18aaa7b5b72940469b1
    * Update plugins/replication from branch 'master'
  - Ignore IntelliJ *.iml files
    
    Change-Id: I7397e53a9d82137b0669ff47dd36f45b8a056fb7
    * Update plugins/singleusergroup from branch 'master'
  - Ignore IntelliJ *.iml files
    
    Change-Id: Ib0386f5453ae472cd703d5257fcd163d821f2d2c
    * Update plugins/download-commands from branch 'master'
  - Ignore IntelliJ *.iml files
    
    Change-Id: I6c722396f5d995e631af78deb7c02017f10eccfd
    * Update plugins/reviewnotes from branch 'master'
  - Ignore IntelliJ *.iml files
    
    Change-Id: I2997884b7ab1a39177f97310db465bfa64c79c09
2016-10-04 11:25:01 +00:00
David Ostrovsky
af71968891 Bazel: Fix build for core plugins
I382757618 added the Bazel build for core pluins, but missed to add
plugins/BUILD file.

TEST PLAN:

  bazel build release
  unzip -t bazel-bin/release.war | grep --regex "plugins/.*.jar" | wc -l
  6

Change-Id: I3338541ec61905db6658761fa5c6fc374dba0348
2016-09-29 21:12:53 +02:00
David Pursehouse
85c88c9708 Update git submodules
* Update plugins/hooks from branch 'master'
  - Merge branch 'stable-2.13'
    
    * stable-2.13:
      Add --change-url with correct value
    
    Change-Id: I6bf2b4c547d206190ff32702c2eeb1b942f1b377
    
  - Add --change-url with correct value
    
    Create the URL with the change-id rather than the change number.
    
    Change-Id: I7fb753fec0bc776c593062e3e44f48dd9004b085
2016-09-27 11:54:15 +00:00
Claudio Pacchiega
76b1375aa8 Update git submodules
* Update plugins/replication from branch 'master'
  - Removed the recommendation for ssh
    
    As discussed many times during the Gerrit conferences and hackathons,
    Git/SSH replication on Gerrit isn't stable enough due to the JSch
    client stack. Removing the recommendation from the documentation
    may help in choosing alternative methods.
    
    Change-Id: I3c8646135999d6cbb99b58d83d42655d25ea23e9
2016-09-24 07:20:52 +00:00
David Pursehouse
f725b07c2c Merge "Bazel: Build core plugins"
* submodules:
* Update plugins/commit-message-length-validator from branch 'master'
  - Implement Bazel build
    
    Change-Id: I246cdd00923d36c11a678b250ef6a91a5e433943
    * Update plugins/replication from branch 'master'
  - Implement Bazel build
    
    Change-Id: Ia6dc6ba50faeddd300d94aabdbef97b07cdb741d
    * Update plugins/singleusergroup from branch 'master'
  - Implement Bazel build
    
    Change-Id: Ia0d8fa1b91ea4db94e0da951604aac02ffde8662
    * Update plugins/hooks from branch 'master'
  - Implement Bazel build
    
    Change-Id: I7b6f05032b7329b992d8aefe0bbff63f357b0df5
    * Update plugins/download-commands from branch 'master'
  - Implement Bazel build
    
    Change-Id: I74da3f186e166aae5070b7458ade3f12714d8548
    * Update plugins/reviewnotes from branch 'master'
  - Implement Bazel build
    
    Change-Id: I8cc93cc87284340f48735925313d602a11dba716
2016-09-23 12:37:13 +00:00
David Ostrovsky
1579890639 Update git submodules
* Update plugins/replication from branch 'master'
  - Remove dependencies exported in the plugin API
    
    Change-Id: I3f0b3d33a8819e6489629b34706c72b4ab3d3f1c
2016-09-23 12:28:08 +00:00
David Pursehouse
ff7679320a Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Remove unused imports
    
    Change-Id: I448a2f2567fff0b0bdc81d04e20759fd1c5aafa5
2016-09-23 10:06:09 +00:00
David Ostrovsky
bb6f0b13bf Update git submodules
* Update plugins/replication from branch 'master'
  - Make JUint test not inherit from TestCase
    
    Change-Id: Ic627b67c1e9c0830708dba475c911e0c478887aa
2016-09-23 09:55:24 +00:00
Gustaf Lundh
53c26a3b31 AssigneeValidationListener extension point
Listener to provide extensions with validation of assignees.

Change-Id: I61f6558d79b8e4c0d322c293dacdf4f33d882b26


* submodules:
* Update plugins/cookbook-plugin from branch 'master'
  - AssigneeValidator example
    
    Will not allow a user to be assigned to more than 5 changes.
    
    Change-Id: I1887f7007e66bd5ccac207c7789be2712ffbd00a
2016-09-23 09:34:43 +00:00
David Pursehouse
91926d9cad Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Merge branch stable-2.13
    
    * stable-2.13:
      Build with API version 2.13
    
    Change-Id: I681fd49d49e9fb8d83723d63839b7c77fcd25f3f
    
  - Build with API version 2.13
    
    Change-Id: I45579c60ead1817674a93919be50efad5a1506af
2016-09-23 08:53:10 +00:00
Dave Borowitz
d3848b15a3 Convert some Functions/Predicates to streams & lambdas (2)
Change-Id: I6558525ed5df1da588fcf69d177952e4f692cc2d
2016-09-21 04:25:11 -04:00
David Ostrovsky
77faff1834 Update git submodules
* Update plugins/cookbook-plugin from branch 'master'
  - Bump GWT version to 2.8-rc2
    
    Change-Id: I886c722df7515a0bab524da295b24d4e6141ec10
    
  - Bump plugin API to 2.14-SNAPSHOT
    
    Change-Id: Ie83d3215d72598b7458f520922f47b836d5c2015
2016-09-20 14:30:40 +00:00
David Ostrovsky
0b774c478e Update Buck to latest version
This version fixed a major issue: [1] that was a reason of frustration
of many plugin developers: Not cache sources files under symbolic link.
Now for all such source files, the warning is issued:

"
Disabling caching for target //plugins/wip:wip__plugin, because one or
more input files are under a symbolic link
({plugins/wip=/home/davido/projects/wip}). This will severely impact
performance! To resolve this, use separate rules and declare
dependencies instead of using symbolic links.
"

To suppress this warning we add project.allow_symlink option. This
doesn't have any impact for gerrit core but silences the warning above
when plugins are built in gerrit tree mode.

As pointed out in this issue: [2], we are using some artifacts as source
to the java_library() rule as well as binary_jar for prebuilt_ja rule.
To avoid the warning, we rename sources to have "-sources.jar" suffix
and we rename *.zip to end with .jar in other places.

"
Assuming edit.src.zip is a JAR and renaming to edit.src.jar in
//gerrit-patch-jgit:edit_src. Change the extension of the binary_jar to
'.jar' to remove this warning.
"

source_under_test attribute was removed from java_test() rule.
Replication and cookbook-plugin are updated as well.

local.properties support was removed, but we use it only for download
process customization in our own python script, so that we can keep it
usage and not need to move it to .buckconfig.local.

[1] https://github.com/facebook/buck/issues/341
[2] https://github.com/facebook/buck/issues/855

Change-Id: Idf76cc71c21df43e808179b645f9175767b322a8
2016-09-20 13:19:15 +02:00
David Ostrovsky
3931c16bdb Build with Java 8
Change-Id: I06f811fc46a606b719582c0724e8d0c89e823b37
2016-09-20 10:19:52 +02:00
Dave Borowitz
64beae58a2 Revert "Update Guava to 20.0 snapshot version 20160818.201422-323"
Snapshot disappeared on us. Include revert of submodule change.

This reverts commit ea67c7ff00a436402f22c61df58afb017d13b3a4.

Change-Id: Iee0c80c57a456b57a98b79ae9a3085ab08990428


* submodules:
* Update plugins/replication from branch 'master'
  - Merge "Revert "Remove usage of to-be-deprecated Throwables methods""
  - Merge "Change docs links to actual file extension (.md)"
  - Change docs links to actual file extension (.md)
    
    See https://gerrit-review.googlesource.com/83950 for detailed context.
    
    Change-Id: I1d86feee4aaffcf7b9bd7db5e094c6a421bb6b42
2016-08-25 00:21:42 +00:00
Yuxuan 'fishy' Wang
05c0a16ffb Update git submodules
* Update plugins/download-commands from branch 'master'
  - Don't put \n inside a markdown link
    
    Change-Id: Ie8ac4e9f1106340037074645a2811c5044d31894
2016-08-23 18:40:52 +00:00
David Pursehouse
d0383c131c Update git submodules
* Update plugins/replication from branch 'master'
  - Merge "Change docs links to actual file extension (.md)"
  - Change docs links to actual file extension (.md)
    
    See https://gerrit-review.googlesource.com/83950 for detailed context.
    
    Change-Id: I1d86feee4aaffcf7b9bd7db5e094c6a421bb6b42
2016-08-23 07:16:08 +00:00
Yuxuan 'fishy' Wang
bff7c7d19d Update git submodules
* Update plugins/reviewnotes from branch 'master'
  - Change docs links to actual file extension (.md)
    
    See https://gerrit-review.googlesource.com/83950 for detailed context.
    
    Change-Id: I4dc35b6396b57f70f659d4a458011b08817d8719
2016-08-23 07:15:52 +00:00
Yuxuan 'fishy' Wang
06ac63e285 Update git submodules
* Update plugins/hooks from branch 'master'
  - Change docs links to actual file extension (.md)
    
    See https://gerrit-review.googlesource.com/83950 for detailed context.
    
    Change-Id: If9d4f0726a0d8d3ca66f01819eeada2b53ac41be
2016-08-23 07:10:08 +00:00
Yuxuan 'fishy' Wang
22b00659fa Update git submodules
* Update plugins/download-commands from branch 'master'
  - Change docs links to actual file extension (.md)
    
    See https://gerrit-review.googlesource.com/83950 for detailed context.
    
    Change-Id: I425285fc81404d49629bf2f468f45c3fc67dd8f9
2016-08-23 07:09:25 +00:00
David Ostrovsky
01e7f528cf Merge changes from topic 'guava-20.0'
* changes:
  Remove usage of to-be-deprecated Throwables
  Update Guava to 20.0 snapshot version 20160818.201422-323


*submodules:
* Update plugins/replication from branch 'master'
  - Remove usage of to-be-deprecated Throwables methods
    
    The propagate and propagateIfPossible methods will be deprecated
    in Guava 20. Replace them with the recommended alternatives.
    
    Change-Id: I11d8adcae3000189c16f60179e02a79440ef99d6
2016-08-23 04:15:17 +00:00
David Pursehouse
6f0fb43127 ReviewerAddedListener: Notify multiple reviewers added in same event
When multiple reviewers were added to a change, notify them all with
a single event and let listeners act on each individual reviewer as
necessary.

This change is needed to allow splitting the mail notifications to a
listener.

Change-Id: I8b1f3918877b9635a6592beae6ad5aeea0a5adce
2016-08-19 14:23:36 +02:00
Hugo Arès
bbafaa36f5 Merge "Enable plugin-based validation of user's ref related operations"
*submodules:
* Update plugins/cookbook-plugin from branch 'master'
  - Add user ref operation validation example.
    
    The following example blocks any update to any ref that starts with
    'refs/heads/protected-' prefix if it is performed by user that has
    no 'Administrate Server' capability.
    
    Change-Id: If5373d238a4d30fc450a4114e6af51d6536ae91a
    Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
    
  - Add example implementation of ExternalIncludedIn extension point
    
    Change-Id: Ied5517cf9da58c748ad60bdf96444828a6051df3
    Signed-off-by: Edwin Kempin <ekempin@google.com>
2016-08-19 11:58:33 +00:00
David Pursehouse
49802a55fa Update git submodules
* Update plugins/replication from branch 'master'
  - Add .mailmap
    
    Change-Id: Ic499c6b1f9f18759ef0567088b0dd693d65a0b26
2016-08-18 12:51:17 +00:00
David Pursehouse
6a4a40c3a1 Update git submodules
* Update plugins/replication from branch 'master'
  - Merge branch 'stable-2.12'
    
    * stable-2.12:
      Destination: Consider ref visibility when scheduling replication
    
    On master the isVisibilty method was renamed to shouldReplicate and has
    additional logic to check for replication of hidden projects.
    
    Rename the newly added isVisibility method to shouldReplicate to be
    consistent. Move the hidden projects logic to a utility method and use
    it in both shouldReplicate methods.
    
    Change-Id: I7b713636164fd78425561a98a1f50182c9501f4a
    
  - Destination: Consider ref visibility when scheduling replication
    
    Bug: Issue 4398
    Change-Id: I11856eabf61e734691e1b00f1c3083c017f96a01
2016-08-18 12:48:58 +00:00
Viktar Donich
316bf7a806 Parse and serve reviewer updates via REST API
Parses updates to a change's reviewers, and serves them with the change
details. Will be picked up by PolyGerrit UI and displayed in change's
messages section in follow-up change.

Feature availability depends on NoteDb migration.

Feature: Issue 4148
Change-Id: I50e75ba9e5a885de4733a3a8d7d156d3729d1d91
2016-08-05 10:17:09 -07:00
Edwin Kempin
a686421978 Merge "Allow ExternalIncludedIn extensions to add multiple Included In rows"
*submodules:
* Update plugins/cookbook-plugin from branch 'master'
  - Add example implementation of ExternalIncludedIn extension point
    
    Change-Id: Ied5517cf9da58c748ad60bdf96444828a6051df3
    Signed-off-by: Edwin Kempin <ekempin@google.com>
2016-08-05 15:14:28 +00:00
Edwin Kempin
93e0791824 Update singleusergroup plugin
* Use account index to suggest user groups

Change-Id: I48fa6358708b14bed97ca54a5aefcb4c407c5577
Signed-off-by: Edwin Kempin <ekempin@google.com>
2016-07-13 16:34:02 +02:00
David Pursehouse
ed3cba635e ChangeEvent: Add 'who' and 'when' fields and methods
The 'when' field tells when the event occurred, and 'who' tells which
account performed the action that triggered the event.

Deprecate the existing events' get..() methods in favor of getWho().

Change-Id: I3fdae6c5b76eda8494bf3b5c95ea6bb077690d04
2016-07-12 15:41:17 +09:00