16442 Commits

Author SHA1 Message Date
David Pursehouse
2bc62f23fa Merge branch 'stable-2.11' into stable-2.12
* stable-2.11:
  Set version to 2.11.11
  Replace links to code.google.com/p/gerrit
  Update issue tracker URL in documentation
  Update issue tracker URL in POM files
  Bump jsch to 0.54
  Update jsch to 0.1.53
  Bump Jsch to 1.52

Change-Id: Ie23ff4282f5b49a54f7043a4e932a4d18f2b5ef8
v2.12.8
2018-02-25 23:22:08 +09:00
David Pursehouse
3ca7f7af93 Set version to 2.11.11
Change-Id: I4ec96f7ab9dc3a73715bdc7683565054e1835bb8
v2.11.11
2018-02-25 23:20:13 +09:00
David Pursehouse
edf35c2c25 Replace links to code.google.com/p/gerrit
Google Code was shut down nearly 2 years ago [1] and the links
don't work any more. Replace them with the new locations.

[1] https://opensource.googleblog.com/2015/03/farewell-to-google-code.html

Change-Id: I53e791d04eb243483d69254a296c30e59a7de479
2018-02-25 23:20:13 +09:00
David Pursehouse
15a7a7052a Update issue tracker URL in documentation
Change-Id: Ica83202a23678ea3fb93dfcff1f40fbc83c42d66
2018-02-25 23:08:45 +09:00
David Pursehouse
ba15a58d0b Update issue tracker URL in POM files
Change-Id: Ib2130947709532ae3ded532e35f61d8a16c4e332
2018-02-25 23:08:45 +09:00
David Ostrovsky
276a209ff4 Bump jsch to 0.54
Change-Id: Iacbd96f22d13765440afecbd8133a87033c34cfc
2018-02-24 16:30:00 +01:00
David Pursehouse
84a08a3c30 Update jsch to 0.1.53
0.1.53 contains several bug fixes and new features
since 0.1.52.

http://www.jcraft.com/jsch/ChangeLog

Change-Id: I7a3ff5217ad38c925200a1ac9df096f616157350
2018-02-24 16:23:46 +01:00
David Ostrovsky
27cb75a9be Bump Jsch to 1.52
According to the change log the new version fixed some bugs and added
some new features: [1].

[1] http://www.jcraft.com/jsch/ChangeLog

Change-Id: Iff40eec5da1906c85c4325bb2cd14f996d849d6d
2018-02-24 16:23:34 +01:00
Dave Borowitz
bc24c17195 MergeUtil: Use InMemoryInserter for dry runs
As in Ifd9d768d, making flush a no-op is not sufficient to ensure
nothing gets written to the repo.

Bug: Issue 6965

Change-Id: If08e8184b484a0e7ba41fd3e11130d6fb26ed6c6
2017-08-08 15:29:31 +02:00
David Pursehouse
54429e9066 Set version to 2.12.8
Change-Id: I7fc4b13c70012d6e3aee8afa94772a079b4bd115
2017-04-05 09:44:22 +09:00
Hugo Arès
37b9293dca Fix intopic predicate with regex
There were many changes in the topic predicate since the last time it
worked with regex but the first change that introduced this regression
is Ifdb12319. It changed the topic field from exact match to prefix which
broke the regex search.

Bug: Issue 5759
Change-Id: Ifa35083c5802c3cb980a58c035ff4f8efd9fac7b
2017-04-04 09:10:49 -04:00
Zhen Chen
15e9a266b3 Fix the wrong order of RevWalk.isMergedInto in RebaseSorter
RevWalk.isMergedInto takes the base as first argument and the tip as
the second argument to check if the base is merged into the tip. The
test didn't detect it because in the test the base is the same as the
tip.

Also add a regression test for this bug.

Change-Id: I43742aa4bd75ea64e729c1d3ecf40369002c7e55
2017-03-30 11:11:39 -07:00
Hugo Arès
62e6711dcd Revert "Resolve username lazily in git over http tasks"
This reverts commit 3fd92a4ac50e5ef49043858ab2576050634a3c2e.

The change was supposed to print the username in the queue for git over
http operations but the username printed is the one of the person doing
show-queue, not the one doing the git operation.

Change-Id: I2f45d526b684af9f3aa336879b310a165048382e
2017-02-07 18:22:28 +00:00
Paladox none
be722d53f6 commit-msg hook: Add Change-Id after Depends-On: footer
Zuul uses Depends-On to test with dependencies.
So lets add it to the commit-msg.

Change-Id: Iae2bd55d2c4bd6463763b9bfe05837f47e9db598
2017-01-17 21:06:58 +00:00
Hongkai Liu
3fd92a4ac5 Resolve username lazily in git over http tasks
ProjectQoSFilter uses username as a part of task info. However,
AuthFilter which comes later than ProjectQoSFilter renders the
value of username. As a result, username never gets resolved when
using git with http.

The current patch set resolves the username only when it is used,
i.e., in the toString method, and saves the value for reusage.

Bug: Issue 5206
Change-Id: I280c95b242d599919eee3c7007c60a0047170166
2017-01-04 16:39:49 -05:00
Hugo Arès
b21e318bc6 Do not check visibility of parent when creating project
A project can be visible to a user but not necessarily its parent. To
be consistent, a user with create-project permission should be able to
create a project with a parent that exists even if the parent is not
visible to the user.

Here is an example when this case is happening. On a Gerrit server where
All-projects is only visible to administrators and create-project
permission is granted to non-administrators, when a non-administrator
tries to create a project with All-Projects (which is the default when
parent is not specified) as its parent, it was failing before this
change with "Not found: All-Projects".

Change-Id: Id93370ab108f377f643b55efdf781dfd2c66f220
2016-12-23 05:17:33 +00:00
Hugo Arès
a2a82fa110 Add test for create project with create-project capability
There was a test for the negative case, when user cannot create project
so add the positive case, when user is granted the global capability.

Change-Id: I8c23ae3c2a27cbe91f43f5ec8b92964cfcbc8873
2016-12-23 05:17:04 +00:00
Hector Oswaldo Caballero
96bbab3bb2 Fix DB connection pool verification
So far, given no validation query was specified, a broken connection
could be returned from the connection pool and this caused a 500 error
when trying, for example, to read a change from the database.

Specify a default validation query that works for several of the DBMS
supported by Gerrit (H2, PostgreSQL, MySQL), and specific validation
queries for other supported databases (Apache Derby, DB2, Oracle).
Validation queries were verified for open source databases (H2, MySQL,
PostgreSQL and Derby).

Change-Id: Ia215288d70b11893b7d1403611e109a5a951f090
2016-11-25 07:38:31 -05:00
Andrew Bonventre
5602a31d81 Fix comparison using reference equality instead of value equality
Change-Id: I635573a20bdaabf07f4aac2f9eda4f943764ee02
2016-11-23 02:07:44 +00:00
David Pursehouse
6978a7bb93 Set version to 2.12.7
Change-Id: I7a483a1f62237e494be5bb09668678abded8a7cb
v2.12.7
2016-11-22 13:49:05 +09:00
Sven Selberg
29445062ad Allow submit of merge of non change branch
Commit a61b6eed5337049a7feb58ac935543624f107129 introduced a bug that
prevents mergeing of a branch that is not a change.
It marks the branch to be merged into as uninteresting whereas the
branch that gets merged is not, which causes Gerrit to think that it
is not allowed to merge it resulting in MISSING_DEPENDENCIES error.

In the case where the walk hits a commit that does not have canMergeFlag
and is not in the commits to be submitted, check if commit is already
merged.

Bug: Issue 4930
Change-Id: Ib4f95ebe336e381d6fcbf36867e84d927ac13eb1
2016-11-16 11:21:24 -08:00
Saša Živkov
df0145d52f Avoid unnecessary group visibility checks
The list-groups REST API call checked group visibility even for those
groups which are filtered out. In a system with 10-20K of groups
this can cause 30-60 seconds delay when checking if current user can
see a group.

Avoid unnecessary group visibility checks by moving it towards the end
of the loop. Therefore, group visibility is only checked for those
groups which are not filtered out.

Change-Id: Id5984049d0103fbbf656b704f672f01283844b64
2016-11-16 18:16:25 +00:00
David Pursehouse
1d55a32535 Fix broken submit tests
The test for submitting whole topic on multiple branches was broken in
several ways:

- It was resetting the "dev" branch using the initial head of the default
  test project, rather than that of the specifically created project.

- The base revision of the created "dev" branch was not specified, so it
  was not clear where it was being created from.

- The call to the API to create the "dev" branch was done without using
  the properly namespaced project name.

Fix all of these problems.

Also, when running the whole suite of tests under Java 7 some of them
failed, while the same tests passed when running individually. The root
cause of this is not yet known, but it would seem that the tests are
somehow interfering with each other.

Annotate the AbstractSubmit class with @Sandboxed so that each test is
run on a separate server instance. This makes the tests somewhat slower,
but makes sure they don't interfere with each other any more.

Change-Id: I2728106fce71d239b09572928b0f7489b96cdc64
2016-11-14 10:25:02 -08:00
Patrick Hiesel
225da2dc6d Add @Sandboxed annotation for classes and methods
There are some tests where it is especially hard to make sure that they
are not influenced by other tests in the same class. This includes all
indexer tests since some of them check the cardinality of a query result,
which might change as more entities are added by other tests.

This is a backport of the original change, adapted to work on stable-2.12.

Change-Id: I74b40b2e7f95894dd666dcd87d97fd29b2d67c51
2016-11-14 10:00:12 -08:00
David Pursehouse
0d3dab2236 Add tests for submit whole topic on multiple projects/branches
Change-Id: I9ac7b5c7743e7c931859900ce4333ffe6914cd4b
2016-11-13 15:27:25 -08:00
David Pursehouse
1f0db2a18b Update download-commands plugin
- CloneWithCommitMsgHook: Fix HTTP clone command inconsistency

Change-Id: I429c2d31d16491acf63d663a3c0420aebe792b63
2016-11-13 11:20:10 -08:00
David Pursehouse
3f1de3315d Set version to 2.12.6
Change-Id: If323e0dbf8a6e643611b6c6a7cd517a3884d8380
v2.12.6
2016-11-08 12:50:41 +09:00
David Pursehouse
330d71d1fc Fix formatting of Apache Derby database documentation
Change-Id: I1a54053bc124ed67631fe74553e70b62862000da
2016-11-08 11:44:01 +09:00
Sven Selberg
85d7ee4fb0 CherryPick: Update mergeTip for every cherry-pick
When updating mergeTip in updateChanges mergeTip is not updated
between cherry-picks so all commits in Batch will be done on tip of
target branch, not stacked on each other.

Bug: Issue 4887
Change-Id: I59ce9f60eba08e44dd1e9a8ac1a9c953ed066570
2016-11-08 11:12:02 +09:00
David Pursehouse
1ef6e50b0a AbstractSubmit: Add more assertions in submitWholeTopic
Add an additional check that the remote log has the expected commits
after the submit.

Bug: Issue 4887
Change-Id: Ia39fd771d9e019f97670d6131022fcd3d8d2965d
2016-11-08 11:11:41 +09:00
Sven Selberg
a61b6eed53 Notice merged commits even if they appear on a different branch
Backport for stable-2.12 of:
Notice merged changes even if they appear on a different branch
Idcaec3f0db9e67b8a8390ddd73c0aca95a654b0b

Check for merge changes contains an optimization which is overeager: It
assumes that all changes that are reachable from any branch are not part
of the set of new changes being applied. This speeds up the walk to
determine the set of changes to be examined, but produces an incorrect
[too small] set.

This results in "internal error: change is new" errors when trying to
submit a change to one branch that is already part of another branch.

For RebaseIfNecessary:
Do not mark child of merge candidates as uninteresting

If a merge candidate is parent of one of the already accepted refs,
the merge candidate will disappear during the sorting in
RebaseSorter#sort if it's child is marked as uninteresting. Only mark
tip of target branch as uninteresting.

Bug: Issue 4158
Inspired-by: Stefan Beller <sbeller@google.com>
Change-Id: I483de5bdb2740bb1a7d3dcb71a15865574231647
2016-11-08 01:37:34 +00:00
Dave Borowitz
12898f57a6 MergeTip: Expose initial tip
Change-Id: I4ad0ad580dd0c55a32054b106549ab743e9b89be
2016-10-31 14:22:24 +01:00
Paladox
9a2572a3f0 Fix copying text in Internet Explorer
The '-ms-user-select' css property doesn't support 'initial', so use
'text' instead.

Also add the 'user-select' css property for browsers that don't prefix
their css properties.

Bug: Issue 4647
Change-Id: Ife1ebcc8f4aadddb80de18515065c13339d54f64
2016-10-05 00:52:08 +00:00
Jean-Jacques Lafay
0a503edfdd Fix double Repository.close() in MergeOp
The call to closeRepository() from the finally block on line 461
doubles up with the "normal" call on line 446, so we have to make sure
not to close() the repo twice.

This resulted in the counter for the repo to regularly reach exactly 0,
when all cached data are flushed, and we suffer a serious performance
hit. Once enough changes have been merged however (especially more than
the number of indexing threads that kick in immediately after a
successful merge to check for mergeability), the counter stays
consistently negative and performances return to normal.

Note that this has been fixed in 2.13 as a side-effect of 4b1e2a460.

Change-Id: I49181f0bff7b57d83bfad4ba225d1266ee545b35
2016-10-02 09:38:18 +00:00
David Pursehouse
b224bf9d4a Set version to 2.12.5
Change-Id: Ia96ed9586b08828eebe8559a4c0aa589c24345d2
v2.12.5
2016-09-23 09:12:19 +02:00
David Pursehouse
f5eab1d211 Release notes for Gerrit 2.12.5
Change-Id: I1a4b7901b39efb733d66fa43351f90cc23d03c9c
2016-09-22 12:18:45 +00:00
Hugo Arès
f00dee4c8e Print proper name for QuerySource tasks in show-queue command
Before this commit, the tasks name were printed like this:

com.google.gerrit.lucene.LuceneChangeIndex$QuerySource$1@77352d29

Now, the Lucene query is printed, example:

((status:new OR status:draft) owner:1000001)

Change-Id: I9a08a8eef08af5dba9b0948b9ae445a807fe8b87
2016-09-14 13:57:38 -04:00
Paladox
ee24b3c547 Adds a new pref config called lineWrapping to Edit and Diff
What this config does is it either enables or disables lineWrapping,
disabling line wrapping can cause changes that have long lines to simply
be cut off.

With it enabled it will line wrap the text making it easer to read instead
of it being cutoff.

Gerrit 2.8.1 did lineWrapping so bringing this back. But it is set to the
default false so it is not enabled by default in Edit or Diff sections.

We should probaly set it as true in gerrit 2.13.

This also will partially fix bug

https://phabricator.wikimedia.org/T144565

which is filled downstream. Reason why this is partially fixed is because
the pref is not set to true by default and logged out users will still
see no line wrapping.

Bug: Issue 4292
Bug: Issue 2410
Change-Id: I8600778f1068c217e335755a3138e8cb64bc8b3e
2016-09-13 12:10:38 +00:00
Edwin Kempin
78808c5d34 Merge "Fix the DiffPreference and EditPreference dialogs on diffs and edits" into stable-2.12 2016-09-12 10:29:48 +00:00
Paladox none
89c36ab07f Fix the DiffPreference and EditPreference dialogs on diffs and edits
If you don't have a big enough screen the options at the bottom get cut
off so it makes it very hard to change the options

Change-Id: I99ca18842b99a486589409f8c57d4ee901d0796a
2016-09-12 09:50:49 +00:00
David Pursehouse
3e3ea2628f OutgoingEmailValidator: Revert back to using static initialization
Using AtomicBoolean is racy. It's actually safer to use static
initialization.

The problem being addressed in change I92a6c98d8 was fixed by making
the usage of OutgoingEmailValidator consistent in CreateEmail and
CreateAccount.

This partially reverts commit 3aaf8318936d08fbb2f4c5bdf4aaa475037d651a.

Change-Id: Ia10c74705a3e467c9f31896ac72ec231acb37635
2016-09-10 13:13:08 +09:00
David Pursehouse
3aaf831893 Fix usage of OutgoingEmailValidator to make sure TLD override works
The call to DomainValidator.updateTLDOverride may only be done before
the call to EmailValidator.getInstance otherwise it throws an exception.

Putting the DomainValidator.updateTLDOverride call inside a static
block doesn't seem to be safe enough. Protect it with an atomic boolean
insteed.

Also fix CreateEmail and CreateAccount to use OutgoingEmailValidator
instead of EmailValidator.getInstance directly. By directly using it we
don't necessarily set up the TLD override correctly before first use.

Bug: Issue 4521
Change-Id: I92a6c98d8ae188c08da7c0a077d67000dfdab4fd
2016-09-09 09:38:40 +09:00
Shawn Pearce
fdfc3738fc Write each Lucene index using a dedicated background thread
Backport of I54296d62fd9206b2ed2bbcbd5bbcc941890206a3 to stable-2.12

Like searches, it is not safe to interrupt the IndexWriter.  It also
reads from the NIOFSDirectory which closes file handles if the thread
is interrupted (such as by SSH command being Ctrl-C'd).

Although IndexWriter is thread safe it is essentially single threaded.
Each of these methods acquires a lock on entry, manipulates the index,
and releases the lock. There isn't a lot of value in allowing these to
be running on parallel threads borrowed from Gerrit.

Background (and serialize) all writes onto a single thread to prevent
an interrupt on the application thread from passing into Lucene code.

Change-Id: I2678e1a4c106c027b02fce47d0a570f59f6dde57
2016-09-07 16:38:58 -04:00
Shawn Pearce
0d8786d344 Do not allow index futures to be cancelled
Once a change is written to the backing store (ReviewDb or NoteDb), it
should also be written into the secondary index, even if the user
tries to abort the current operation (e.g.  presses Ctrl-C on a
running `git push`).  Don't allow cancellation of a higher level
future to go down into the index update future.

This also better protects Lucene from seeing an interrupt while using
the secondary index and closing the NIOFSDirectory.

Change-Id: I8027a6226a5a1f7196506a0388a66d0568f67a5c
2016-09-07 12:50:31 +09:00
David Pursehouse
4fd1e53b06 AccountManager: Don't try to change username that is already set
Since change I2c0f26bb4 it is not possible to change the username
after it has been set. Attempting to do so results in an exception.

This situation can occur for example if `ldap.accountSshUserName` is
set in the `gerrit.config` using `${userPrincipalName.localPart}` to
initialize the username from the user's email address. If the user's
email address changes after their first login, the username resolved
by `accountSshUserName` will change. Then on subsequent logins, when
AccountManager tries to change it to the new value, an exception is
thrown and the user is not able to log in.

Instead of attempting to change the username, log a warning.

Change-Id: Ie9d3501b2c386990c8439b3c7a9aae06cf51013b
2016-09-01 16:29:30 +09:00
David Pursehouse
ccd5b75626 Merge "Prevent limit of search outbounding max int value" into stable-2.12 2016-09-01 00:51:38 +00:00
David Pursehouse
c03b3aed00 Merge "Double-check change data in cleaning up task" into stable-2.12 2016-09-01 00:37:40 +00:00
Hongkai Liu
3d2e738991 Prevent limit of search outbounding max int value
The problem occurs when IndexConfig is created with the
default value, i.e., Integer.MAX_VALUE, and the start
value in the QueryOptions instance is greater than 0.

Bug: Issue 4006
Change-Id: Ib746a7941505a10e0c5a2b1d0a3ca79fca11de5f
2016-08-31 15:16:40 -04:00
Edwin Kempin
8fea1bbd3a Fix NullPointerException on computing task name
Some tests hit this NPE occasionally, e.g. see [1].

[1] https://gerrit-ci.gerritforge.com/job/Gerrit-verifier-notedb/6773/consoleText

Change-Id: Ib31374cc957ba7ff3a43dc95739205aa34f836d3
Signed-off-by: Edwin Kempin <ekempin@google.com>
(cherry picked from commit f44565d4ac73bc9d565525dc67dbe7bd4a23b635)
2016-08-31 17:52:35 +00:00
Hongkai Liu
5137e0c06b Double-check change data in cleaning up task
Originally, the change clean up task abandons one change after
another in a list. As a result of potentially long list of changes
to abandon, a change could be updated by the user again after the
list is collected and before we reach it.

Double-check if the change still satisfies the abandon criterion
right before abandoning it.

Change-Id: I09f012d3f4ee1f96535e15523010d02b9a881123
2016-08-31 09:13:36 -04:00