* 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
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
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
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
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
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
This reverts commit 39777363a63c603cfa68ca52d2f3c99eb04f2f46.
Reason for revert: the frontend part of this change doesn't work.
Change-Id: I53138e939a1b98578787457e48743fdc8abf658c
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>
This adds a user preference such that we only send plaintext emails to
this user. It also adds docs and tests.
For the user, this comes at the cost of not being in the same email
thread as the users who receive HTML emails. We decided to send out
plaintext emails on a one-by-one basis instead of making one thread (as
we do with HTML) as this would just create more confusion.
When admins enable inbound email for Gerrit, the aforementioned caveat
isn't a problem anymore as users would email Gerrit anyway instead of
using a notification email as messaging thread.
Change-Id: I3d0fc920c9d81e1a7b707ae5f3f4600a62b8a93b
When changes are queried, we want to return the number of unresolved
comments with each change. This number should be pre-counted rather than
loading all the comments and counting each time.
We also add new search operators, which allow user to query by
"has:unresolved" and "unresolved:<RELATION><NUMBER>".
The 'unresolvedCommentCount' field of 'ChangeData' will be null if
'lazyLoad' is false.
Change-Id: I97c6aeb47db48f56f94c5d184dfa36c8d7868cc8
This was presumably fixed in Ia5e6b9791 and in I8b735db4f. It turns
out, that labels map is not null in GWT UI, as it is the case in PG,
but also non empty, even in non-voting case: Code-Review: 0.
Fix the optimization check to account for zero votes.
Bug: Issue 4638
Change-Id: I6d9a2cc42ec51e6b1df13b96cf4bcdd082c87f60
When change details are loaded, the stars of the calling users are
included into the ChangeInfo. The stars are stored in
refs/starred-changes/<sharded-changeid>/<user-id> refs in the All-Users
repository and must be loaded from there. At the moment we load and
parse all starred changes ref of the change (all refs that start with
'refs/starred-changes/<sharded-changeid>/') when change details are
requested. Since we need only the stars of the calling user it is better
to only load and parse the single starred changes ref of the calling
user.
Change-Id: Ic218eaf2ce0e2b4d94c5c37136a86c20ee658dbd
Signed-off-by: Edwin Kempin <ekempin@google.com>
Previously, trim() would not catch non-breaking spaces and they would
get added to the comments. Later on, non-breaking spaces get converted
to regular spaces yielding empty comments and comments that are not
trimmed correctly.
Change-Id: Ie1cd4e37a3f946e16a51e9db5d36ef1e0ee3bf5c
Upgrade to version 1.3 which is the version in which the Eclipse
plugin was included [1].
The only change in formatting caused by this version is removal of
spaces after <li> tags in javadoc comments [2].
[1] https://github.com/google/google-java-format/pull/118
[2] bbb742ea49
Change-Id: I91ad790b586c9ea7e9af1b61016ea4276b90576d
Most of the time, user pushes to refs/for/... for creating a change, do
not bother to get into the update superproject process.
Change-Id: I57390e0d5698e5e14d2566d8802167940d14cf1c
The Delete Email REST endpoint assumed that all emails would be stored
as external ID in the "mailto:" scheme, but also external IDs in other
schemes can contain emails. Change the Delete Email REST endpoint so
that it deletes all external IDs of the user that are connected with the
given email address.
Bug: Issue 5423
Change-Id: I4b7661c19a5402013ed63ce0446de9146490304c
Signed-off-by: Edwin Kempin <ekempin@google.com>
This is necessary to check draft visibility. It should have been added
at the same time as I177109ed9c.
Change-Id: I04574080793255df18eff1323203195ca9d1d17e
If a user didn't set a value for a preference then the hard-coded
default value is used, unless another default value is configured in the
refs/users/default branch in All-Users.
If a default value was configured in refs/users/default then overwriting
this configured default with the original hard-coded default didn't
work. Only overwriting it with any other value worked.
This didn't work and the effective user setting was 80:
* hard-coded default: 100
* refs/users/default: 80
* user setting: 100
This worked:
* hard-coded default: 100
* refs/users/default: 80
* user setting: 101 (and any value other than 100)
This is the reason why setting lineLength ("Columns") in the diff
preferences on gerrit-review to 100 is not working, as in the
refs/users/default branch we have configured a default lineLength of 80
and 100 is the hard-coded default value. Please note that setting
lineLength to 100 works transiently until the page is reloaded because
the client stores the updated diff preferences locally.
Change-Id: I5f63f9d62f639c755b39d753d8b0b30832c8c9f6
Signed-off-by: Edwin Kempin <ekempin@google.com>
googlesource.com uses an older version of Gson that is unable to parse
millseconds out of timestamps using the default type adapter[1]. Since
the point of this adapter is to work with existing googlesource.com
code, change it to support that.
[1] Specifically, it doesn't contain
bcd52a1fdc
Change-Id: I5c129a29fa097d48f4aff002f9c85704e039e68f
The currentFilePaths used to be computed very early in the reindexing
code. However, we still needed to go through the diff_summary cache
for changed lines. The diff_summary cache contains also the
currentFilePaths so we can simply get these paths from the cache.
This avoids expensive diff computations in JGit.
Change-Id: I30781f6b918ed2ca0cf0137bbfb21d92e0ba13af
The goal is to use this cache for everything that is needed to
reindex a change, to avoid computing the full PatchList for each
change. Having a completely standalone cache for insertions/deletions
is overkill, but since we already have this cache, it's not too much
work to store a few more bytes in it.
This change is an alternative to I5a0bab3e.
Change-Id: I52ef20916ddf03f3e8692f1f443d09b89a98b2f1
* submodules:
* Update plugins/reviewnotes from branch 'master'
- Assign unused Future return value to a variable
Error Prone plans to make this pattern into a compile error; this avoids
future breakage.
Change-Id: I6a023f22f472941854a6729f6450b9b70a020069
Also add a test for email deletion and add asserts for the addEmail()
test.
Bug: Issue 5385
Change-Id: I3e192638fdaac58d0cdaa535430bb968d7d32abb
Signed-off-by: Edwin Kempin <ekempin@google.com>