* stable-2.14:
PolyGerrit: Add support for erlang and puppet in highlight
PolyGerrit: Add support for php and shell in highlight
Change-Id: Ic30a9c97d46e38a7c9bce2e2480d64d4f1fa4e5a
shell is a common languge + php is used alot downstream.
Change-Id: I419bdee569d5763b03414f7527ede3b7aefc4ae7
(cherry picked from commit f4e0308f0c3a8edafa1fb63fee9a9b9b65fa4692)
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
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
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
* 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
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
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
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
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
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
* 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
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
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
Migrates all alert calls to toasts. Also corrects one test that checked
for an alert on the window.
Bug: Issue 6701
Change-Id: I4d41790f63edc15873014df4f98013ac2bb2af7c
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
* stable-2.14:
Use quoted-printable for SMTP transfer encoding
Refactor email rendering of SMTP sender
Change-Id: Ibfc69da5f4b0473866d1a6434220e695422994d3