26138 Commits

Author SHA1 Message Date
Logan Hanks
724b24c6ee Fix name of has_review_started property in docs
Bug: Issue 6651
Change-Id: I4321ed6c0826806d1a6d8f2e8305eb5a904cb266
2017-07-14 10:01:05 -07:00
David Pursehouse
bb00c97a5c Merge branch 'stable-2.14'
* stable-2.14:
  PolyGerrit: Add support for erlang and puppet in highlight
  PolyGerrit: Add support for php and shell in highlight

Change-Id: Ic30a9c97d46e38a7c9bce2e2480d64d4f1fa4e5a
2017-07-14 16:20:45 +09:00
Edwin Kempin
18bb5d94c9 Merge changes I37bfe95b,I419bdee5 into stable-2.14
* changes:
  PolyGerrit: Add support for erlang and puppet in highlight
  PolyGerrit: Add support for php and shell in highlight
2017-07-14 07:10:45 +00:00
David Pursehouse
11f049367f Merge branch 'stable-2.14'
* stable-2.14:
  Update link to source.android.com

Change-Id: I366be33cc99e7215c6b49e78d7a3869e7dcc1540
2017-07-14 13:25:19 +09:00
Paladox none
e782eb5e86 PolyGerrit: Add support for erlang and puppet in highlight
Change-Id: I37bfe95ba0a392ebe1b7620d780e7affeedcb318
2017-07-14 02:55:21 +01:00
Paladox none
b8f8153045 PolyGerrit: Add support for php and shell in highlight
shell is a common languge + php is used alot downstream.

Change-Id: I419bdee569d5763b03414f7527ede3b7aefc4ae7
(cherry picked from commit f4e0308f0c3a8edafa1fb63fee9a9b9b65fa4692)
2017-07-14 02:55:01 +01:00
David Shevitz
e01a42b9a6 Update link to source.android.com
The current docs point to:

source.android.com/submit-patches/workflow.html

This URL no longer exists. It looks like the relevant content is now at:

source.android.com/source/life-of-a-patch

Updating the links in the Gerrit docs accordingly.

Change-Id: I3cc463d14ec9354281a4a37d72cf483f2636cb64
2017-07-14 10:48:06 +09:00
Paladox none
e28533f5c8 PolyGerrit: Add support for erlang and puppet in highlight
Change-Id: I37bfe95ba0a392ebe1b7620d780e7affeedcb318
2017-07-14 00:43:01 +00:00
Paladox none
f4e0308f0c PolyGerrit: Add support for php and shell in highlight
shell is a common languge + php is used alot downstream.

Change-Id: I419bdee569d5763b03414f7527ede3b7aefc4ae7
2017-07-13 22:42:34 +00:00
Becky Siegel
fdfd7ebce3 Merge "Fix linkification of CC= lines" 2017-07-13 20:12:02 +00:00
Kasper Nilsson
a76fe75bf2 Merge "Fix pagination when limit:N is given in query" 2017-07-13 19:42:50 +00:00
Logan Hanks
e3e2daaa73 Fix linkification of CC= lines
We fixed linkification of R= lines by inserting an invisible character
before the actual email address. This change treats CC= lines the same
way.

Bug: Issue 6725
Change-Id: Ic0e0cbbaeaa01eb7e21afa13232a90927077bd4b
2017-07-13 12:09:21 -07:00
Logan Hanks
29693ac125 Fix pagination when limit:N is given in query
Ordinarily the limit defaults to user preference, but it can be
overridden by the query string itself. This is common in dashboard
queries. Users who follow the linked section headers in the dashboard
get confused by the pagination because each page skips many results.

To fix this, we use a regex to look for limit:N in the query. If
present, the value given in the query overrides the user preference when
computing the navigation links.

Bug: Issue 6716
Change-Id: I1c20913634e3cf8fbe98b24d5c166b66287043be
2017-07-13 18:47:58 +00:00
Kasper Nilsson
daba503058 Merge "Only truncate file path in page title" 2017-07-13 18:00:02 +00:00
Edwin Kempin
35e0df1d94 Merge changes from topic 'local-disk-tests'
* changes:
  GerritServer: Support forcing local disk for all tests
  Rework NotesMigration hierarchy and get rid of test impl
  ConfigNotesMigration: Remove rambling comment about sequences
  NoteDbMode: Remove barely-used readWrite() method
  AbstractDaemonTest: Don't delete common server path too early
  Daemon: Rename test -> inMemoryTest for clarity
  SiteProgram: Remove unnecessary finals
  NoteDbMigrator: Actually close thread-local cached open ReviewDb
  ChangeIT: Properly unwrap ReviewDb
  GerritServer: Skip @UseLocalDisk tests with FUSED
  StandaloneNoteDbMigrationIT: Only run when GERRIT_NOTEDB=off
2017-07-13 14:34:51 +00:00
Dave Borowitz
96896652af GerritServer: Support forcing local disk for all tests
Most tests are in-memory for performance reasons, which uses JGit's
InMemoryRepository. This repo implementation is fairly well tested, not
least because it's been used by Gerrit for years, but it may differ in
various ways from the FileRepository implementation. Most importantly
for the immediate NoteDb future, we want to make sure all tests continue
to work with a brand-new BatchRefUpdate implementation[1]. Running tests
against on-disk repositories is an easy way to increase coverage of the
new code.

This option is still not on by default for performance reasons, and it's
unlikely we'll enable it in CI.

[1] https://git.eclipse.org/r/100771

Change-Id: I319bdaa81a4b21e36d6615c80a04679d1bf7db07
2017-07-13 10:03:20 -04:00
Dave Borowitz
dece981249 Rework NotesMigration hierarchy and get rid of test impl
It used to be that ConfigNotesMigration was the only kind of
NotesMigration in a real server, but it was always immutable, while
TestNotesMigration was the main kind of migration in acceptance tests,
which was mutable. However, now that we support modifying
ConfigNotesMigration at runtime as part of the online NoteDb migration
process, TestNotesMigration is no longer strictly necessary, and
continuing to support it is becoming more trouble than it's worth.

One major problem was that only TestNotesMigration was being populated
via NoteDbMode, and the NoteDbMode was not reflected in the
ConfigNotesMigration at all, so callers that were depending on
ConfigNotesMigration directly would not know about the NoteDb migration
state from the GERRIT_NOTEDB env var in tests.

We could have fixed this (and other) problems directly, but there is a
better solution: get rid of the test implementation entirely, and use
the same implementation of NotesMigration in tests as in a running
server.

The class hierarchy now contains only two classes: NotesMigration and
MutableNotesMigration. Most callers just care about inspecting the
state, so they can inject a NotesMigration. The few callers (migration,
tests) that care about mutating the state at runtime can inject/create
MutableNotesMigrations instead. As an implementation detail, the actual
NotesMigration instance continues to be mutable, containing a reference
to the Snapshot, but the base class does not contain any public methods
to mutate the state. We then ensure with Guice that there is only one
actual NotesMigration instance (the MutableNotesMigration), and callers
just may or may not have access to the mutation methods depending on
what they chose to inject.

Ensuring this gets set up correctly in tests requires a bit of tweaking.
  * Since the NotesMigration is populated in the @UseLocalDisk case from
    reading gerrit.config on disk, we need to prepopulate gerrit.config
    with the right config values at startup time.
  * Since MutableNotesMigration is not in the testutil package, it can't
    have its own setFromEnv() method that depends on NoteDbMode.
    Instead, construct MutableNotesMigrations from the test env by using
    a static factory method in NoteDbMode.

Change-Id: If06db3d025cf3e3c9fe464989d5f38a22ce70b56
2017-07-13 10:03:17 -04:00
Dave Borowitz
541bfcc70e ConfigNotesMigration: Remove rambling comment about sequences
The series of migration steps is more or less fixed, so we're not
revisiting this decision.

Change-Id: I665e23b890dffb36279a62bc962c1d4b4bc52a1a
2017-07-13 09:30:30 -04:00
Dave Borowitz
c124130e9a NoteDbMode: Remove barely-used readWrite() method
Change-Id: I3e94d6d6e18eb00c65f6dc7ff6ca78889336a240
2017-07-13 09:30:30 -04:00
Dave Borowitz
0890229897 AbstractDaemonTest: Don't delete common server path too early
Chaining the TemporaryFolder with the custom TestRule results in the
directory for the common server being deleted after the first test
method, even though it might still be needed. This means a @UseLocalDisk
class cannot have more than one method, or things break, including but
not limited to the NRT reopen threads throwing exceptions due to the
index files disappearing out from under them. We just got lucky that
none of our local disk tests were actually affected by this.

To make this work, we can't tie the lifetime of the TemporaryFolder to a
single AbstractDaemonTest method invocation. Instead, create the tempdir
within GerritServer#initAndStart, and allow callers to get it back out.
We have to be a bit more careful about managing the lifetime of the
tempdir since some GerritServers, particularly in StandaloneSiteTest,
have a shorter lifetime than their tempdirs. Fortunately, TempFileUtil
make this relatively easy.

As a nice side effect, we can get rid of the hack of passing the tempdir
in via a Gerrit config option.

Change-Id: I80ac66a27bc990f2cef966c9b372c86ce277c471
2017-07-13 09:30:30 -04:00
Dave Borowitz
e17972873e Daemon: Rename test -> inMemoryTest for clarity
Change-Id: Id1da5dc32c368f2196e80e78a4bd85e254974905
2017-07-13 09:30:30 -04:00
Dave Borowitz
a8f1e9ca2d SiteProgram: Remove unnecessary finals
Change-Id: Icae0020c7baff375b06556d6f8cb17c337c85358
2017-07-13 09:30:30 -04:00
Dave Borowitz
43b74a28aa NoteDbMigrator: Actually close thread-local cached open ReviewDb
In Ia2b77fdc we tried to be clever and override the close method of the
ReviewDb that is shared across a single thread, deferring the close
until ContextHelper#close. Unfortunately, we just called the no-op close
method, rather than the close method of the underlying db, resulting in
leaking a DB handle after running NoteDbMigrator.

This caused StandaloneNoteDbMigrationIT to fail with:

  Caused by: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-176]

Surprisingly, this doesn't affect the tests when run in the Bazel
sandbox, only in Eclipse. I don't have an explanation for this other
than that there might be some different filesystem semantics in the
sandbox that affect H2's locking protocol. Unfortunately, I was also not
able to reproduce the failure by adding "local" to the tags of the pgm
acceptance test target, so maybe the sandbox is not the problem after
all.

Nonetheless, this was clearly a bug, and this change causes tests to
pass in Eclipse.

Change-Id: I27ec98ce99fc3af082572bed0ea27b3eb3f2c3ee
2017-07-13 09:30:30 -04:00
Dave Borowitz
2457718658 ChangeIT: Properly unwrap ReviewDb
This was causing a test failure in GERRIT_NOTEDB=read-write.

Change-Id: I45d99925176eb44e7591b80aa9fb0518e4bcc8aa
2017-07-13 09:30:30 -04:00
Dave Borowitz
c5f01f829a GerritServer: Skip @UseLocalDisk tests with FUSED
This is not yet supported, so tests would fail if they attempt to run
fused BatchUpdates. A quirk in the way NotesMigration is currently
populated is the only reason these are not failing now, but this will
change shortly.

In not too much longer, these checks will go away, since fused updates
will soon be supported in JGit.

Change-Id: I0676599b62078afc9e1c2c9c7dd5b82096ad1679
2017-07-13 09:30:30 -04:00
Dave Borowitz
28c8a1d4a3 StandaloneNoteDbMigrationIT: Only run when GERRIT_NOTEDB=off
This test assumes we start from ReviewDb, so running in other modes may
cause problems.

Change-Id: I9c6b1df557bdba72e560ef54a104e70a3cd89905
2017-07-13 09:30:30 -04:00
David Pursehouse
ebfcb2faef Merge branch 'stable-2.14'
* stable-2.14:
  GroupsIT: Add tests for conflicting options

Change-Id: I80b78fb486bfa888c290d46a459928de64b07b14
2017-07-13 21:51:12 +09:00
David Pursehouse
d619f4b334 GroupsIT: Add tests for conflicting options
Change-Id: Icb3a6fe5c789ffcd63b8866ba2b398d341ee7ca7
2017-07-13 21:33:08 +09:00
Paladox
3928de5cb7 Merge branch 'stable-2.14'
* stable-2.14:
  Fix documentation of branch regex filter
  Clarify limitations in project list filters
  RefFilter: Disallow using substring and regex filters together
  Clarify that branch and tag regex filters are case sensitive
  Add missing documentation of tag substring and regex filters
  Clarify that branch substring filter is case insensitive
  Fix documentation of branch substring option
  Clarify that group substring filter is case insensitive
  GroupsIT: Add test for listing groups by substring

Change-Id: Id479a1f868a75a6e8b117808b5a8418cded3fd00
2017-07-13 11:32:41 +01:00
David Pursehouse
a6cd67f3e5 Fix documentation of branch regex filter
Also fix broken formatting introduced in I53bdcc827.

Change-Id: I77334d3eae6362bce0621f218b754479ddd0a9f4
2017-07-13 16:42:24 +09:00
David Pursehouse
0c2e4b87e9 Clarify limitations in project list filters
Update the documentation to clarify:

- Regex and prefix filters are case sensitive
- Substring filter is case insensitive
- Regex, prefix and substring may not be used together

Add tests for case [in]sensitivity.

Change-Id: I5de7f5f43b6ecc55dd15c4c009e2e11bd7e72567
2017-07-13 16:39:55 +09:00
David Pursehouse
16a1a4b3f0 RefFilter: Disallow using substring and regex filters together
For the project list we disallow using the regex and substring
filters together in the same query.

Add the same restriction for listing branches and tags.

Change-Id: I76628b7a577fd385fefa33d36a3a0390a649a79e
2017-07-13 16:39:55 +09:00
David Pursehouse
f648e04d8f Clarify that branch and tag regex filters are case sensitive
Change-Id: Iab70d106a22f212fe0be91dfda5f4b03af9e34cd
2017-07-13 16:39:55 +09:00
David Pursehouse
cf1ed06688 Add missing documentation of tag substring and regex filters
Change-Id: I5cd53c8a06710ca32b08de56ce445ad81dc6f8c9
2017-07-13 16:39:50 +09:00
Edwin Kempin
7339a28343 Make MetaDataUpdate.InternalFactory public
We need to bind this class internally at Google.

Change-Id: If15c13f5af38b5aede13fa34d945490bd9dc54f9
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-07-13 08:55:08 +02:00
David Pursehouse
5851bfe54b Clarify that branch substring filter is case insensitive
Change-Id: I53bdcc827d2059448df8c2cfd1acf2cb6d1e4eeb
2017-07-13 09:59:55 +09:00
David Pursehouse
1d4d67d7e6 Fix documentation of branch substring option
Refer to branches, not projects, in the description.

Change-Id: I50afe29c44dee9f7dc0a2df2d37e94baedb4aa9a
2017-07-13 09:59:00 +09:00
David Pursehouse
3cd948d325 Clarify that group substring filter is case insensitive
Change-Id: I2a3452d04db6deb96ed6cd292e609231902e169d
2017-07-13 09:52:03 +09:00
David Pursehouse
a3d7f2d962 GroupsIT: Add test for listing groups by substring
Change-Id: I7d5b6463f58221a7d94bef2b4a638e2506147f8d
(cherry picked from commit a81de784cd279c48966eb35da69893a75669e78f)
2017-07-13 00:04:40 +00:00
Kasper Nilsson
f2749236b2 Only truncate file path in page title
Uses util.truncatePath to compute an appropriately short page title.

Bug: Issue 6709
Change-Id: Id742a122a20011ac82ade865d3ea579179c38c1d
2017-07-12 20:41:42 +00:00
Kasper Nilsson
68406c48b0 Merge "Fix typo" 2017-07-12 20:31:58 +00:00
Kasper Nilsson
5ab29ffb92 Merge "Remove alert-based error reporting" 2017-07-12 20:31:53 +00:00
Kasper Nilsson
143a4279e1 Fix typo
Change-Id: I8f2f3fa9b4f346f951ba99a805641162573a690a
2017-07-12 12:47:14 -07:00
Kasper Nilsson
de211a56a2 Remove alert-based error reporting
Migrates all alert calls to toasts. Also corrects one test that checked
for an alert on the window.

Bug: Issue 6701
Change-Id: I4d41790f63edc15873014df4f98013ac2bb2af7c
2017-07-12 11:04:48 -07:00
David Pursehouse
a81de784cd GroupsIT: Add test for listing groups by substring
Change-Id: I7d5b6463f58221a7d94bef2b4a638e2506147f8d
2017-07-12 19:43:21 +09:00
David Pursehouse
5492212e81 Format Java files with google-java-format
Change I6127c139d introduced some formatting glitches. Although it
had the Code-Style+1 label, it looks like it was applied before CI
was updated to actually do the style check.

Change-Id: I4b2ab2271af327827a785cebb2c25642dd0465d1
2017-07-12 10:20:53 +09:00
David Pursehouse
7c50d14f92 Merge branch 'stable-2.14'
* stable-2.14:
  Use quoted-printable for SMTP transfer encoding
  Refactor email rendering of SMTP sender

Change-Id: Ibfc69da5f4b0473866d1a6434220e695422994d3
2017-07-12 09:57:21 +09:00
David Pursehouse
c00a950863 Merge changes I9adc5b4d,Ide2b9025 into stable-2.14
* changes:
  Use quoted-printable for SMTP transfer encoding
  Refactor email rendering of SMTP sender
2017-07-12 00:56:25 +00:00
Paladox
5e3113082f Merge branch 'stable-2.14'
* stable-2.14:
  Update groups rest api doc to explain the ?m= param

Change-Id: I132336dc6335e859b1a2b628c4b59f3771a5290d
2017-07-12 01:42:42 +01:00
Paladox none
23bd0cf93a Update groups rest api doc to explain the ?m= param
Adds doc for ?m= param.

Change-Id: Ie2679ace999eb0dbdc4db280169aaed97fbbac52
(cherry picked from commit 3cbb53005cf5369a78628975662070cd2791bd10)
2017-07-11 23:12:35 +00:00