This metric reflects the user experience of pushing to Gerrit. Add a
new push type "NORMAL" to distinguish AUTOCLOSE from Gerrit serving
standard git push (which should be much faster).
Put the CREATED and REPLACED stats in the change counter together as
CREATED_REPLACED to mirror the latency metrics.
Change-Id: I1aae3bc0c0fe430086221503b8e529fa06967517
Our REST documentation mentions that the status contained in
RelatedChangeAndCommitInfo has one of the values NEW, MERGED,
and ABANDONED. It explicitly lists them in upper case. In addition,
our frontend depends on the exact casing of those values.
This regression was introduced as a side-effect of I9ed389b01. Add a
test to prevent future regressions.
Bug: Issue 10559
Change-Id: I7486b71899c57e185d90d7357873834539933637
* stable-2.16:
Fix account and group query with Elasticsearch 6
Fix support for "SystemVerilog"
Add "Show Relative Dates In Changes Table" to settings preference
Update syntax highlighting class
Change-Id: I0189b0e27d923d638aee2bc5779dca7261084841
* stable-2.16:
Strip trailing slash at the end when creating repos
Add support for cherry-picking even with merge conflicts
Change-Id: I1656c751d3ac3ef6de27085b6d004249923e75d4
* stable-2.16:
Fix mobile display on gr-create-change-dialog
LogThreshold: Allow the annotation to be inherited
Do not show "Patch file" if change does not have a parent
Fix support to use "Default Base For Merges" preference
Re use gr-diff-preferences inside gr-settings-view
Fix avatars not showing correctly
Change-Id: I26b8326304343bbe665b3ddcac401dc7b355a2bc
We want to reduce QPS to Gerrit where easily possible. The framework for
this is already in place: On every Response, we can set caching.
We don't want caching to impact users by showing them stale data that is
in the critical path of their work. For admins, this is slightly more
acceptable.
To start with, we cache /server/version (30s) and /server/top-menus
(300s). These only change if Gerrit gets upgraded or plugins that
contribute top-menus reload.
Change-Id: I33ef5792bffba79bde5d7e7dda6b4291f2db9cc7
With the current implementation the log threshold is only set when the
annotation is done on the exact class, which means that in cases where
an abstract test class is extended by several derived test classes, it
is necessary to add the annotation on each derived class individually.
Allow the annotation to be inherited, so that it is possible to only
annotate the base class, and it will also be effective for all derived
classes.
Change-Id: I0501b2a617161a391478313b6f9891108bdf9969
Allow to grant the ACL to arbitrary users using new permission to
control who is able to flip the Work In Progress bit in addition to
three different groups allowed to toggle Work In Progress state: change
owner, server administrators and project owners.
Feature: Issue 10385
Change-Id: I66f6078936c4fae20f3a12dbd3a5d9a244eb75cb
This commit allows plugins to define project permissions
and updates the PermissionBackend interface to accept
plugin defined project permissions.
This commit doesn't implement the strategies for handling
plugin project permissions and leave it to follow-up
commits.
Change-Id: Ib9d8d80045e50d51237da6d420aa9bfe001ca207
This commit updates some code introduced by I977a77286f
to improve its readability and also honor some java best
practices, e.g.:
* explicitly prohibit inheritance if a class isn't
intended for that (Effective Java Item 19's advice:
design and document for inheritance or else prohibit it).
* Write unit tests in three sections, aka "arrange",
"act", "assert".
Change-Id: I8939370f16c2465c7ba102afd3877a31babd0c89
ChangeIT#changeDetailsDoesNotRequireIndex should detect when we regress
in adding a dependency to the change index to rendering a single
change's details page.
This commit brings the options in line with PolyGerrit and is more
generous in swallowing an exception in a single UI action that made the
test - hence rendering the page when the index is unavailable - fail.
Change-Id: If3783fd258bcd5a133b01cf1ce41a3522fd9b535
Iad564dd47 was problematic in the error case because it returned
Predicate.not(Predicate.any()). The "any" predicate is not an index
predicate, which produces at least two problems:
* When used in a with another non-index predicate, it
might throw "no ChangeDataSource" from AndSource/OrSource.
* More dangerously, when combined with an index predicate, it is used as
a post-filtering predicate. A post-filtering predicate that matches no
results means it gets applied to every change in the index before
returning an empty set, which is bad.
Instead, reuse a handy existing index predicate that is designed to
return no results efficiently from the index:
ChangeStatusPredicate.NONE. Expose this from a more general location,
ChangeIndexPredicate#none().
Change-Id: Ic9a7e277070cff7768ec91c1972cf8e9f6deacb1
The Gerrit Plugin injector and the RestApiServlet currently have
different bugs. This commit papers over the most pressing ones and adds
tests so that plugins can bind child collections and offer modifications
directly on the collections (e.g. postOnCollection).
When binding rest views from plugins, the plugin name is incorrectly set
to "gerrit" which is what we use for core Gerrit views. This does not
apply to collections though. These are bound with the correct plugin
name "plugin-name".
In RestApiServlet, this leads to a situation where the collection thinks
it belongs to a different part of Gerrit. For operations that modify the
collection (post, delete) this means we have to use "gerrit" as the
component name when looking up child views. For root collections, we
already do this and this is why it works for existing plugin root
collections. For subcollections, however, we did not - which is what
this commit changes. Now the two usages in RestApiServlet are
consistent.
To be clear: They are now consistently wrong across the different parts
of Gerrit, but they are consistent which means they work.
As future work, we want to fix this long standing issue by binding the
correct plugin names from the beginning. This is non-trivial though
because the DynamicMapProvider has no context on the plugin that is
performing the binding.
This commit adds the same logic that we have for core-collection
delegation to plugin-collections in RestApiServlet.
Change-Id: I954105155c4a354b6c577d8cc246d00998e33f57
This commit makes it possible for plugins to declare
project permissions like what they are doing for
capabilities.
In the access section of a "project.config" file,
a plugin delcared permission is stored in a format
like "plugin-{pluginName}-{permission}" so that we
can tell if a config name could possibly be a plugin
permission with some confidence. This is helpful
when we load/save "ProjectConfig" where listing
plugin defined permissions is not trivial, e.g.
DynamicMap doesn't present when a test site is
initialized.
Note plugin declared capabilities have to keep the
old format "{plugin-name}-capability" before a data
migration is done.
In the child commit, we are going to extend
the "PermissionBackend" to accept project permissions
declared by plugins.
Change-Id: I977a77286f56214f90a5ff6a5b482e2701cf9916
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
When the conflicts operator fails, the result is not actionable, and the
UX is bad in the PolyGerrit UI, producing a modal error dialog. The
conflicts operator is already known to be subject to false positives and
false negatives; this just replaces some errors with silent false
negatives.
This code is in a bit of an odd situation where the actual stack trace
is useful[1], but it's extremely long and noisy to log every time. Log a
single line most of the time, and a stack trace every once in a while.
[1] It's how I found https://git.eclipse.org/r/137886
Change-Id: Iad564dd4708080e8dabc88e9ad1ad7521ec6b603
Instead of saying "a non-open change", use the actual status of the
change, i.e.:
cannot set abandoned change to private
cannot set merged change to private
Adjust the setMergedChangePrivate test accordingly, and also add a
new test to cover the abandoned change use case.
Change-Id: I896f20b68e82edf1341c898ab2c0ba680cde1d69
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