Project-specific themes were only implemented in the GWT UI, which has
been removed.
Remove the ThemeInfo entity, and no longer include the 'theme' field in
the ConfigInfo entity returned by the project config REST API endpoint.
This is a breaking change for any client that still uses that endpoint.
The custom site header HTML, footer HTML, and CSS files are still used
by login screens and the internally managed Gitweb server. Update the
theme documentation to mention this.
PolyGerrit has site-wide theme support, but it is not documented in the
existing config-themes.txt, and adding it is not within the scope of
this change.
Change-Id: Ibe824a9416fac65bd365407b8ce22e03515b5b52
There seem to be an reoccurring mistake of using String.replaceAll
instead of the String.replace. The method names are misleading and one
may think that the replace method replaces only the first occurrence and
the replaceAll method replaces all occurrences.
Actually, both methods replace all occurrences. However, the replace
method interpretes the first parameter as the plain string while the
replaceAll method interpretes it as a regex. Using the replace method
when regex support is not needed improves both performance and
readability.
Change-Id: Iffed6aae4d7b541e4dc76e4b5bd20dcd8d5bad49
* stable-2.16:
ChangeCleanupConfig: Remove unnecessary usage of regex in URL replacement
AbandonIT: Add tests for changeCleanup.abandonMessage
UrlFormatter#getChangeViewUrl: Remove @Nullable and simplify default implementation
UrlFormatter#getSettingsUrl: Annotate section parameter as @Nullable
MergeUtil: Include project name in "Reviewed-On" URL
ChangeCleanupConfig: Inject UrlFormatter via DynamicItem
Adjust more classes to inject UrlFormatter via DynamicItem
Set version to 2.15.12-SNAPSHOT
Set version to 2.15.11
Allow LFS-over-SSH created auth pass through ContainerAuthFilter
Upgrade elasticsearch-rest-client to 6.6.1
ElasticContainer: Bump the test server version to 5.6.15
Change-Id: Ie90d450ddb16d165ed2d5ec91964d35b735214dd
RevisionNote is currently only used with lists. For the checks plugin we
want to use it to represent a map. Therefore, offer a getOnlyEntity
method to make sure we always just deal with a single entity.
Change-Id: I15b93e2517ce2dd3d8a6c421d5d8e7ac04c28220
There are no longer any callers in core that pass null project to
this method. Remove the @Nullable annotation and simplify the default
implementation.
Change-Id: I4359527e0167712a9d68efe08eb86392daa38f13
The method UrlFormatter#getChangeViewUrl has the @Nullable annotation
on the project argument, allowing the project name to be omitted from
the URL.
The URL used in the Reviewed-On footer, which is added to the detailed
commit message, is the only place that passes null for that parameter,
and as a result this is the only place in Gerrit where the change URL
does not include the project name.
Bug: Issue 10512
Change-Id: Ib6737af0a72adb7706caa20991780be71617dd24
Since change I375245647 the UrlFormatter is bound as a DynamicItem,
so it should also be injected as such.
For this class we can't simply change the constructor parameter since
the UrlFormatter is not stored as a member but is used to initialise
the abandon message, which may have a $URL placeholder which is used
to replace with the actual URL provided by the UrlFormatter.
Change it so that the abandon message is initialized in the construcor
as before, but the replacement of the $URL placeholder is only done at
the time the message is needed.
Bug: Issue 10500
Change-Id: If4299276ec94402e8d2b806ad179e185e307d1ab
Since change I375245647 the UrlFormatter is bound as a DynamicItem,
so it should also be injected as such.
Adjust most remaining classes to do that. The only one remaining is
the ChangeCleanupConfig which requires slightly more invasive changes
and will be done in a separate commit.
Bug: Issue 10500
Change-Id: Ie9eeef11bd5ce63168bb339e22ee3062482ddd25
* stable-2.15:
Set version to 2.15.12-SNAPSHOT
Set version to 2.15.11
Allow LFS-over-SSH created auth pass through ContainerAuthFilter
Upgrade elasticsearch-rest-client to 6.6.1
ElasticContainer: Bump the test server version to 5.6.15
Change-Id: I6a54f5b233cf9fa6053241b729cdd300f83dfdc9
For now, just tests a top-level binding under /plugins/X. Future tests
could check views bound in a RestApiModule under an existing collection,
but I wasn't able to get those working in this change.
These tests are in a separate class from the old
PluginsRestApiBindingsIT because they are really testing a different
type of endpoint: the former is about the remote admin endpoints, which
is different from actual plugin-provided endpoints. Rename
PluginsRestApiBindingsIT accordingly.
Change-Id: I71b82a14ded11cc77baf1313d82bc714f8602f67
* changes:
Warn the user about private changes on submit
Publish private changes when they get submitted through a Git push
Move private changes tests from ChangeIT to PrivateChangeIT
Inject ChangeMessageUtil into SetPrivateOp directly
Publish private changes on submission
Using reverse DNS lookup by default can cause unexpected performance
issues when writing the ref log, because the hostname of the user's
client is looked up on every ref log creation. For example this can
add a noticable delay (around 5 seconds) when adding a code review label,
due to the ref update of the notedb metadata refs in git.
Change the default of gerrit.enableReverseDnsLookup to false so that
DNS lookup is by default disabled.
Reported-by: Roman Karlstetter <Roman.Karlstetter@ifta.com>
Change-Id: I68af8e545fc54ea0c3819454d81bb4c598f65e93
Having a configuration option 'disable' with default value 'false'
results in a double-negative meaning which can be confusing.
Replace this option with enableReverseDnsLookup, with default 'true',
which effectively results in the same default behavior when no value
is configured.
Rename the DisableReverseDnsLookup and DisableReverseDnsLookupProvider
classes accordingly.
Change-Id: I36a8be9474f58a0d1457850bb5fae2fa7cc08ee8
* stable-2.16:
Acceptance: set log threshold level for tests
Re-introduce the cache-based listing by configuration
Change-Id: I6049c231690b98afd7a16fbb26f9a6004bc3a094
By default all acceptance tests start Gerrit in DEBUG level, which in
some cases may generate *a lot* of logs that may pollute the output
console and make troubleshooting very difficult.
Allow specific tests to customise the log level and reduce it to
a more acceptable level.
Sample use:
@LogThreshold(level = "INFO")
public class MyTest extends AbstractDaemonTest {
@Test
public void shouldJustWork() {
// test code
}
}
Change-Id: I2b0b8496de1a43de112ce5b5c427e3c8603d5d9e
They belong there right next to the JGit PushResultSubject, they were
just put in the wrong place initially.
Change-Id: Iaef009136888c813f1bd20b7988e4f59259e860e
* stable-2.16:
Update git submodules
Update git submodules
Update cmd-stream-events doc
PG: Set diff line lenght to 72 for commit message
Add support for 'base' in cherry pick dialog
Update git submodules
Update git submodules
CommitValidators: Inject UrlFormatter via DynamicItem
Allow omitting action in permission removal
Fix support for ldap groups that contains spaces
AccountIT: Extend assertKeyEquals to check that full key is included
Fix GPG public key export
Change-Id: Ia5396777b9922d090088fea4c010d2f1c6179534
* stable-2.15:
AccountIT: Extend assertKeyEquals to check that full key is included
Fix GPG public key export
Change-Id: I68c469722593a53b475144825673cb0e8e9708e7
DynamicMap#plugins() creates a new TreeSet on every invocation. We were
just doing this to presize an ArrayList, which makes it seem like we
care about reducing allocations, but was probably actually increasing
allocations. Fortunately, we can just presize using the multimap we
already have. This also allows us to remove a redundant instance field.
Change-Id: Ie5998add61d4848e184a37f4f237da132802a00f
This emphasizes to the reader that this map is not supposed to be
mutated after construction time.
It is tempting to store Extensions instead of constructing our own map.
However, repeatedly calling Extensions#get() could cause performance
problems. Leave a comment about why we aren't doing this.
Change-Id: I466b2c17ea1e1b8a9304c97a579cdd3184e033fc
This method was definitely not safe to call multiple times, since it
would add duplicate entries to the mutable map stored in the instance
field. The map should really only be initialized once, during
construction.
Change-Id: I6cbb792adb6ae9dbec70df3f45586dc518faf913
Debugging production problems is much more difficult when exceptions are
completely swallowed. At the same time, if a plugin fails on all inputs,
logging one entry for every change in a large query result set would be
terrible as well. Split the difference and log once a minute; Flogger
makes this very easy. We can always decide to come back later and
complexify it by logging e.g. once per plugin or per factory, but this
is dead simple and pretty quiet.
Change-Id: If512583aef10e48c745660c42f021837caeb2994
A plugin is really just a name plus one or more module classes. We
already have the TestServerPlugin magic which is used by
LightweightPluginDaemonTest, so reuse that. The difference is that the
use case for this new method is for testing the plugin plumbing itself,
not testing a specific real-world plugin.
Change-Id: I3ca4eda806519ad9bdd653e0b5f897e69ed119af
Subclasses that override resetProjects may want to add to the default
config, rather than recreating it all from scratch. Previously, the
default config was never exposed to subclasses. Now, they can get it via
super.resetProjects() (or not, as current implementors all prefer).
Change-Id: If116e5fce9e0fe0f826b66c1f84774660f20dec7
Introduce a new global configuration parameter gerrit.listProjectsFromIndex
to control the ability to render the project list from the secondary
index or the in-memory cache.
By default, the legacy in-memory cache is used as engine.
NOTE: The legacy in-memory cache provides an unlimited list
while the secondary index limit is defined by the global
capability 'queryLimit' which is defaulted to 500 entries.
Change-Id: I3dc089c2b546ff78c6a5aea65b2d6a255b6e20e1
If a plugin gets CommitValidators injected, the plugin fails to
load with:
No implementation for com.google.gerrit.server.config.UrlFormatter was bound.
Since change I375245647 the UrlFormatter is bound as a DynamicItem,
so it should also be injected as such.
Bug: Issue 10500
Change-Id: Ieabb12b2086f8f785c8013e62193c8b811e00500
Allowing plugins to specify custom action types may be feasible, but at
a minimum requires changing the type of the metrics.
Change-Id: Ieb659c8e86f59085e57dbcb134e3582039025223