23215 Commits

Author SHA1 Message Date
David Pursehouse
b89dba2a9d Update git hyper-blame configuration
Add two more commits related to reformatting with google-java-format.

Change-Id: I88f4b677cd78060a5211e4cb2bb0129393881430
2017-02-17 16:35:50 +09:00
David Pursehouse
42ace3c4f4 Format java files with google-java-format
google-java-format was not run after squashing string concatenations
in change I7348413ae.

Change-Id: I30afb262cca64e7638657d59ebb81938c22f0242
2017-02-17 13:21:04 +09:00
Dave Borowitz
34f51034c9 Merge changes from topic 'reviewdb-primary'
* changes:
  Support migrating PrimaryStorage from NoteDb -> ReviewDb
  Support read-only lease in NoteDb meta graph
  AbstractChangeUpdate: Clarify when notes can be null
  ChangeRebuilder: Add method to rebuild NoteDb -> ReviewDb
2017-02-17 02:08:33 +00:00
David Pursehouse
069c0a4f46 Merge "Squash redundant string concatenations introduced by google-java-format" 2017-02-17 01:58:47 +00:00
Dave Borowitz
6ff2aef6f8 Support migrating PrimaryStorage from NoteDb -> ReviewDb
Change-Id: I14fb7be482b0cfbbdbb6eefdde535f37941fd85b
2017-02-16 20:33:35 -05:00
Dave Borowitz
cfb8e840ae Support read-only lease in NoteDb meta graph
To support reverse migration from NoteDb -> ReviewDb, we need to do a
similar thing to what we did with NoteDbChangeState, except in this case
NoteDb is the source of truth, so we need to record the lease in NoteDb.

Let a determined caller clear a lease by setting the readOnlyUntil to
the special timestamp of 0. There is no assurance that the caller is the
same one that holds the lease, but this code is going to be used in
exactly one place.

This does pollute the meta graph with implementation details of the
migration, which we didn't really want to do. We can erase our tracks
later by rebuilding the change again once ReviewDb is primary again.

Change-Id: Ia019fb47e1c1edf719354d0da6bbfe22429f3eb1
2017-02-16 20:26:06 -05:00
Kasper Nilsson
56961e7039 Purge copy/paste cache when diff changes
Bug: Issue 5441
Change-Id: Ifa180dbb4acedce17bc7b75186386d539de5b80e
2017-02-17 00:31:07 +00:00
David Pursehouse
1111684821 Squash redundant string concatenations introduced by google-java-format
Reformatting the code with google-java-format tool in change Id5f3c6de9
resulted in wrapped lines being unwrapped to the new 100 columns limit.

In cases where the wrapped line was wrapped on a string concatenation,
the resulting long line now includes redundant concatenations. See the
upstream issue [1] for an example of this.

Squash the redundant concatenations with:

  git ls-files | grep java$ | xargs sed -i '' 's/" + "//g'

(note: this also resulted in a couple of unwanted changes; those are
manually undone.)

[1] https://github.com/google/google-java-format/issues/122

Change-Id: I7348413ae460c8c7a0b0c72dab0a1ae7275a2ec3
2017-02-17 08:57:46 +09:00
Wyatt Allen
389bd71cb3 Merge "Remove color from "params" syntax class" 2017-02-16 23:35:28 +00:00
Wyatt Allen
e9b9d8d101 Remove color from "params" syntax class
HLJS emits a syntax class for function parameters which the PolyGerrit
syntax stylesheet would color blue. However, HLJS did not always apply
this class accurately, for example, in the C++ case described in the
linked issue.

Because the class was not very informative anyway, and the HLJS default
stylesheet does not style it either, this change removes it from the
PolyGerrit syntax styles.

Bug: Issue 4975
Change-Id: I26ed0b8f745ac6add994a5d1cfc8eb1303dac8cf
2017-02-16 14:51:56 -08:00
Wyatt Allen
3872fccb4e Merge "Use less confusing label for 'u' shortcut on change page" 2017-02-16 22:48:39 +00:00
Dave Borowitz
24d3106b00 AbstractChangeUpdate: Clarify when notes can be null
Change-Id: I3330e91f66d9fd60e1e6f3f424c76db28735036c
2017-02-16 17:24:04 -05:00
Dave Borowitz
ef3fb11948 ChangeRebuilder: Add method to rebuild NoteDb -> ReviewDb
Change-Id: Iad57de65f54b5ac176576748972fe404c92f6e85
2017-02-16 17:24:03 -05:00
Wyatt Allen
cf90509090 Merge "Add admin menu skeleton" 2017-02-16 20:07:26 +00:00
Kasper Nilsson
b5a681c75b Make 'Ack' mark thread as resolved
Bug: Issue 5568
Change-Id: Id8dba066766b5cc8d943bcb5df877c6b66b73ec1
2017-02-16 11:05:30 -08:00
Becky Siegel
2ac8aaf87e Add admin menu skeleton
Previously, people using Polygerrit did not realize how to access admin
functionality in GWT. This build out a skeleton menu, and displays the
appropriate menu items based on role. The page itself will still show
the default admin view placeholder.

Bug: Issue 5470
Change-Id: I1266dd8fb70d0afac485f1e547fae85acee7e5aa
2017-02-16 08:58:29 -08:00
Dave Borowitz
3ae681fd6e Merge "CreateNewChangeForAllNotInTarget: Fix working with change series" 2017-02-16 15:18:07 +00:00
Han-Wen Nienhuys
795c384e4c Wrap IOExceptions in OrmException rather than IllegalStateException.
This avoids transient I/O problems from tripping up exception
monitoring.

Change-Id: I3563af3395bbe98a779be9a9ada6a4275d8216b7
2017-02-16 14:55:11 +01:00
ekempin
076d6e4704 Merge "Fix logger format across gerrit" 2017-02-16 07:31:51 +00:00
ekempin
fe639c72e0 Merge "Use Gerrit person identity for commits created during init" 2017-02-16 06:50:26 +00:00
David Pursehouse
d83af77d18 ValidatorTest: Remove unnecessary import
OutgoingEmailValidator is in the same package, so it does not need to
be explicitly imported.

Change-Id: Ie0fceef827cc3fd67e86f7f46ff6590acc1e1e19
2017-02-16 10:46:46 +09:00
David Pursehouse
71f21fdb0b Init{Auth|Sshd}: Remove unused Libraries members
Change-Id: I93430d156546eaad84098bce78893af353c37099
2017-02-16 10:46:46 +09:00
Becky Siegel
07b793599b Fix total alignment in file list
When the 'expand_inline_diffs' is set, the arrows to the right of the
files in the file list are hidden. The Total numbers were lined up based
on the assumption that the arrows were there. This change determines
padding based on user preference.

Bug: Issue 5516
Change-Id: I5c178402823a064bddb3c24dedaf4917fe05afed
2017-02-16 01:02:00 +00:00
Wyatt Allen
2f341a9d37 Merge "Better email wording when updating changes the user does not own" 2017-02-15 21:59:25 +00:00
Wyatt Allen
2f7c135416 Better email wording when updating changes the user does not own
When a user updates a change that they are not the owner of (for
example, when providing assistance with a new patch set or when updating
the commit message on the owner's behalf) the generated email can give
the impression that the user has created an entirely new change.

With this change, ReplacePatchSet emails check whether the user who
modifies a change differs from the owner of that change. In this case it
appends a note regarding the owner.

For example, the sentence in the replace patch set emails ...

  User One has uploaded patch set #123 to this change.

... becomes ...

  User One has uploaded patch set #123 to the change originally created
  by User Two.

Bug: Issue 4805
Change-Id: Ia9aefaaf6fd3e5f0485675f30e048ac54c94a1b9
2017-02-15 13:49:41 -08:00
Wyatt Allen
7c732d3563 Merge "Add unresolved comment count to file-list" 2017-02-15 20:48:54 +00:00
Wyatt Allen
81edbb9811 Merge "Add hasParent attribute to change view/change actions/rebase dialog" 2017-02-15 20:38:11 +00:00
Kasper Nilsson
0059e25622 Add unresolved comment count to file-list
Adds a function to compute the number of unresolved comment threads in
a file and add it to the file-list comments label.

Feature: Issue 4879
Change-Id: I52dff194098a681386f275695d5d4a6e463cba0c
2017-02-15 11:12:50 -08:00
Wyatt Allen
32bc1b5bf2 Merge "Force PolyGerrit render in background" 2017-02-15 18:51:30 +00:00
Zhen Chen
22b69a079e Fix logger format across gerrit
Did a scan for Logger instances through the whole project, fix all
malformed Loggers.

Change-Id: Ie126ed263a7d7bbf8688ba02d58bcd6f32107cfc
2017-02-15 10:35:38 -08:00
Wyatt Allen
3a69d82777 Force PolyGerrit render in background
Polymer (as well as webcomponents-lite) perform some initialization in
handlers for the `requestAnimationFrame` callback for performance
reasons. The principal drawback of this approach is that pages will not
render in background tabs (such as tabs created by Ctrl+Click-ing a
link) because the rAF system will not offer a frame until the tab has
been foregrounded.

With this change, PolyGerrit pages are rendered in the background by
calling a private function that tweaks the internal state of the Polymer
rendering mechanism to bypass the rAF callback (on the Polymer team's
advice).

Because GR-ROUTER depended on the `webcomponentsready` event, which had
been polyfilled by webcomponents-light inside another rAF callback, it
is refactored to initialize the router inside a Polymer instance method.

Bug: Issue 4334
Change-Id: I8fa43e37199848e053225626406e31613c20deda
2017-02-15 09:21:07 -08:00
ekempin
8bfd99be80 Merge "Insert two newline chars when generating change message" 2017-02-15 15:18:32 +00:00
Shawn Pearce
75315767c5 Merge "Ship BouncyCastle in the .war files." 2017-02-15 15:08:46 +00:00
David Pursehouse
d8a49c9ed3 Merge "Admin{Constants|Messages}: Move static instances from Util class" 2017-02-15 13:46:10 +00:00
Patrick Hiesel
1c226ac737 Insert two newline chars when generating change message
This adds a newline char when parsing change messages for inbound
emails and fixes a bug where notifications sent out for these messages
would not contain the change message.

Change-Id: Ifa720236c1ded0207e5f4cf499a0879fa4ccff21
2017-02-15 12:55:45 +00:00
Han-Wen Nienhuys
6471e8a94a Ship BouncyCastle in the .war files.
Per
https://www.bis.doc.gov/index.php/forms-documents/encryption/328-flowchart-2/file
open source crypto software can be self-classified as 5D002, and
requires only notification of the U.S. Bureau of Industry and
Security.

This registration has been performed by Google, as of Feb 15, 2017.

This gets rid of the special casing for BouncyCastle, simplifying our
build and deployment process.

Change-Id: I680b0a001e5e2e497ed6e62c90c8b8be30efff48
2017-02-15 13:48:57 +01:00
David Pursehouse
8e84feec18 Admin{Constants|Messages}: Move static instances from Util class
The Util class will eventually be removed after the project access
RPC is replaced with the REST API.

As a preparatory step, move the constants and messages instances out
of this class into the respective interfaces. This also makes these
implementations consistent with how messages and constants are defined
in other such interfaces.

Change-Id: Ie9fbfb901870d7ce7caad5cbb253194f81632c0f
2017-02-15 21:22:30 +09:00
Edwin Kempin
f94768b73f Use Gerrit person identity for commits created during init
During init we can't get GerritPersonIdent injected which is why we
created an init person identity. Instead we can just create the real
Gerrit person identity via GerritPersonIdentProvider.

Change-Id: Ic23905657fbf9ced80d37d51726f8aa75e0a2259
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-02-15 13:02:45 +01:00
David Pursehouse
341ad81d9c ValidatorTest: Move to correct package
The class under test, OutgoingEmailValidator, is in the package:

  com.google.gerrit.server.mail.send

Move the test class to the same package.

Change-Id: I2d071a692aaf5c2b2bc1f09dd68e64110a646554
2017-02-15 10:51:56 +00:00
David Pursehouse
7635930138 Update git submodules
* Update plugins/hooks from branch 'master'
  - Refactor to pass injected instances through HookArgs
    
    Instead of injecting the SitePath and GitRepositoryManager in all the
    places they're used, inject them only in HookFactory and pass them
    around through HookArgs.
    
    Make objects package visible in HookArgs so that they can be accessed
    directly rather than through getter methods.
    
    Change-Id: I0cee06e4928748e7dba0315653def894d27244de
2017-02-15 08:58:49 +00:00
Changcheng Xiao
442fa55f30 Remove old RPC backend for MyIdentitiesScreen
MyIdentitiesScreen has been migrated to REST API by [1]. The old RPC
backend will not be used anymore and thus can be removed.

[1] https://gerrit-review.googlesource.com/#/c/95952/

Change-Id: I7d2b255b1ea7df455656cb8a4410cb0f279416d2
2017-02-15 09:26:08 +01:00
David Pursehouse
e39c6e5872 Dummy: Format with google-java-format
Change-Id: I62515c3ee6e7af3e5e6a61fcd1282fe20d3a747a
2017-02-15 07:05:57 +00:00
David Pursehouse
cc959fd386 Merge branch 'stable-2.13'
* stable-2.13:
  PostReviewers: Add missing @Override tag

Change-Id: I7375bd0784a3d8a0b808abf36a26854b419577a8
2017-02-15 14:34:31 +09:00
David Pursehouse
6e4dae993d PostReviewers: Add missing @Override tag
Change-Id: Ib7e0c1ff66c66df0f81b1e5a4842fc9c1547403a
2017-02-15 10:01:03 +09:00
Wyatt Allen
0aeceaa5be Revert "Add a User Preference to Receive only Plaintext Emails"
This reverts commit 39777363a63c603cfa68ca52d2f3c99eb04f2f46.

Reason for revert: the frontend part of this change doesn't work.

Change-Id: I53138e939a1b98578787457e48743fdc8abf658c
2017-02-15 00:49:11 +00:00
David Pursehouse
ab879094c0 Merge "Add a User Preference to Receive only Plaintext Emails" 2017-02-14 23:18:27 +00:00
Becky Siegel
bb3acdb083 Add hasParent attribute to change view/change actions/rebase dialog
Get a hasParent attribute from the related changes endpoint, determining
if a change has a parent change that is not the tip of the branch.
This will be used by the rebase dialog to display tailored options
that make rebasing more intuitive. UI changes to follow.

This change also updates rebaseOnCurrent from being a property of
gr-change-view to getting added in the rest api interface as a property
of the rebase action.  This is why the property is removed from all
views until the reply dialog, where it is passed as a parameter.

Bug: Issue 5447
Change-Id: If31e4c42d8e82f00fba9fa98c28371046299eec4
2017-02-14 14:28:55 -08:00
Edwin Kempin
1cd8f603a5 CreateNewChangeForAllNotInTarget: Fix working with change series
If a change is pushed that depends on an open change and both changes
are targeted to the same destination branch, we don't want to recreate
the base change for the same branch if the
CreateNewChangeForAllNotInTarget project option is set to true. We also
don't want to do any validation of the base change as it is not touched
by the upload of a successor change.

At the moment trying to push a change that depends on an open change of
another user fails with "invalid committer" if the uploading user
doesn't have the Forge Committer access right. This is because
CreateNewChangeForAllNotInTarget wrongly attempts to create a new change
for the base change, and hence does validation for the commit of the
base change. The error message for the base change is:

invalid committer

ERROR:  In commit 683c42e4ba60ffa68c820de9064b6c36238600c4
ERROR:  committer email address other.user@example.com
ERROR:  does not match your user account.
ERROR:
ERROR:  The following addresses are currently registered:
ERROR:    user@example.com
ERROR:
ERROR:  To register an email address, please visit:
ERROR:  http://localhost:0/#/settings/contact

This is confusing to the user who only uploaded a successor change but
didn't touch the base change.

Bug: Issue 5478
Change-Id: I04e25b5eb09e0c9540652c93eb1408d2fab39f6b
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-02-14 17:12:46 +01:00
Dave Borowitz
491170364a Merge "Do not invoke SubmoduleOp when no direct push in ReceiveCommits" 2017-02-14 15:36:47 +00:00
Dave Borowitz
b5a4bbe888 Merge "Support to query groups by owner group name" 2017-02-14 15:30:58 +00:00