Change I458b807dd introduced a warning:
Type Integer[] of the last argument to method containsExactly(Object...)
doesn't exactly match the vararg parameter type. Cast to Object[] to
confirm the non-varargs invocation, or pass individual arguments of type
Object for a varargs invocation.
Changing `containsExactly(range)` to `containsExactlyElementsIn(rangeList)`
fixes it.
Change-Id: I1febc7f30dba07faba60f8ee2191a0585637f5c8
* changes:
LabelType: Use Optional#orElseThrow
Simplify LabelType#sortValues
LabelType: Make all collection fields unmodifiable
LabelType: Eagerly populate byValue
Inline LabelType#getValuesAsList
Add test for populating LabelValues
If user optionally pass error handling function to the send method of
rest API, request error can be processed in custom elements, e.g.:
const errFn = response => {
this.fire('page-error', {response});
};
return this.plugin.restApi().send(method, endpoint, body, errFn)
.then(r => {
Gerrit.Nav.navigateToRelativeUrl('/admin/repos');
});
Considered alternative is to handle errors in plugin requests by
providing generic function that does the same: fire page-error event,
but having a way to provide custom error function is more flexible
approach.
Change-Id: Idd7e86dd0c40d53f4327c013fa0bb469ee8a6fff
Project core and plugins actions exposing label and title. Label
supposed to be used as button name and title is supposed to be used
as button tooltip. Support for tooltip is added in this change. To make
minimal invasive change, we preserve title that was already taken as the
name of the button and add new tooltip attribute.
Alternative approach would be to consistently use label and title, like
it is done on change screen. However that approach may break some users,
that rely on current naming convention.
Note that this also fixed the problem for plugin authors. For example in
custom element in project screen, tooltip can be used as following:
<gr-repo-command
title="[[action.label]]"
tooltip="[[action.title]]"
on-command-tap="_handleCommandTap">
</gr-repo-command>
Bug: Issue 9638
Change-Id: Ib1b54eb7cd4ba544402d293b9fce9bb176b01065
Make a sorted copy with streams and lambdas. Use ArrayList#trimToSize
instead of writing extra logic to precompute the size.
Change-Id: I807f394de25493ae8a078a5bec45551d0c299e66
Defensively copy refPatterns. We still can't use Guava's immutable
collections in the GWT UI code.
Change-Id: I3652b2af957d10f8d88ef7200e608150d3203159
Lazily populating it adds complexity and is premature optimization.
LabelType#getValue is called by PostReview, so in the steady state the
byValue map would always be populated anyway.
Change-Id: I80c8efd64f88771bc60537a5b48eedda5cb23ee5
This method was unnecessarily complicated and had other issues:
* It was confusingly named, returning Integers rather than LabelValues
as #getValues does.
* It stored its result in a transient field, even though it was never
called more than once in its lifetime.
* It was only used by a single test method.
Simplify the LabelType class by moving this logic into a stream
expression in SchemaCreatorTest.
While we're in there, improve the assertions in assertValueRange:
* The input range doesn't need to be in reverse order.
* Check preconditions on the range argument.
* Use Collections.{min,max} instead of hard-coding indexes.
* Use StringSubject assertions instead of checking
Strings#isNullOrEmpty, for better failure messages.
This method was confusingly named (it returned Integers, not
LabelValues) and was only used by a single test
Change-Id: I458b807dd5a4ae20048f18153cd6154589888fb3
This adds a short-cut to reduce the number of permission checks we have
to do in case the user has the permission to remove reviewers.
Change-Id: Iaadadf83bc852d0d31abbd2305f2a20537e30aed
Change Ie5cd0c2b5d (commit d0c160bd18) marks the feature as
deprecated, but only in the documentation, which few people read.
Hopefully, people will notice the push messages.
Change-Id: Ia6fbc9e580e2c02b9264ed1bfe484e71d7d74199
* Update plugins/commit-message-length-validator from branch 'master'
to 4f6b685e12e34a4f583cf84ba1c58ccc2b75e8b0
- Use "warning" prefix to allow colorization of remote output
Since commit bf1a11f "sideband: highlight keywords in remote sideband
output" [1] in git, the "warning" keyword will be highlighted in the
remote output when color.remote is enabled in the git config.
Change "(W)" to "warning" to make use of this feature.
Also make the messages a bit less verbose by removing "commit".
[1] bf1a11f0a1
Change-Id: I9d337af70fc12ddea356d361da23ce8f0bfa85a2
This way gr-diff can be reused with a different server.
I decided to move tests concerning the server calls almost unchanged to
gr-diff-host, even when they reach into gr-diff and deeper to check if
certain things happened as a result of loading.
I added similar tests, minus the actual loading, back to gr-diff. This
results in a bit of duplicated test logic, because e.g. the rendering
is tested both in gr-diff and gr-diff-host. I think that is worth it to
reduce the likelihood I broke something.
Bug: Issue 9623
Change-Id: Ib460094eb8d5b8e856c0d7954ee801fa3b5946d3
Before, it used the promise returned by the gr-diff-builder.render()
instead. Using the event is a prerequisite from moving away from
explicit render calls.
This comes with a small behavior change: Before, gr-diff would not
dispatch a `render` event when no rendering happened because prefs were
unset or the diff was too large and no safetyBypass was used. Now it
does because we still want reload to resolve the promise it returns.
This should not break anything though because currently only tests
listen for this event.
Bug: Issue 9623
Change-Id: I15dd07d706c21cb441f2bc597391e4620c9c12fc
When gerrit.sh gets started from a non-root user, the JVM PID is not
protected against the Kernel OOM killer attacks.
Instead of silently ignoring the setting, display a warning making aware
of the danger and telling the user what to do.
Bug: Issue 9514
Change-Id: I4c1c0e06b260e75d900f436d37f0b91d031cd24e
It is sufficient to set the trace push option as '-o trace' to enable
tracing. '-o trace=true' also works but requires more typing.
Change-Id: Ifa15bb978531a5ebaa7aaf34c79960407249387b
Signed-off-by: Edwin Kempin <ekempin@google.com>
E.g. this will log the magic branch options that have been set on a push
if tracing is enabled.
We only log the parameter names since the values may contain sensitive
information which should not show up in logs.
Change-Id: I26b0c22307f912ad0dbaa13b62f6356d714f2c80
Signed-off-by: Edwin Kempin <ekempin@google.com>
Before
[abcdabc] missing subject; Change-Id must be in commit message
footer
After
commit abcdabc: missing subject; Change-Id must be in message
footer
Change-Id: I15ca67fb591b0d237cb9217936853ec8dc706aaa
* stable-2.15:
ElasticRestClientProvider: Make client field volatile
AbstractElasticIndexer: Specify charset for InputStreamReader
SshCommandsIT: Use immutable type for constant field declarations
rest-api-config.txt: Fix monospace `plugin`
Change-Id: Ib03a5976e13887bae3bf44f0864459418ed8a4f5
* stable-2.14:
ElasticRestClientProvider: Make client field volatile
AbstractElasticIndexer: Specify charset for InputStreamReader
SshCommandsIT: Use immutable type for constant field declarations
rest-api-config.txt: Fix monospace `plugin`
Change-Id: I4dbc4d1876c10ec1cc79a490c86082aa46999163