JGit 5.1.13.202002110435-r adds
- new WindowCache metrics
- and enables using strong references to reference cache pages in the
WindowCache. Set core.packedGitUseStrongRefs = true to enable using
strong references to reference packfile pages cached in the WindowCache.
If this option is set Java gc can no longer flush the WindowCache to
free memory if the used heap comes close to the maximum heap size. On
the other hand this provides more predictable performance.
Change-Id: I895369a8596dfc5adce76c65202ecf37e6a8386d
BucketedCallback enables defining compound metrics having a set of
sub-metrics along a dimension. This is used e.g. in CallbackMetric1
where the additional type parameter F1 defines the type of this
dimension. For each of the values of this dimension present in the
current dataset of the compound metric BucketedCallback registers a
corresponding metric in DropWizard's metric registry which isn't aware
of the relationship between a compount metric in Gerrit and the
corresponding sub-metrics.
If another measurement yields a new metric dataset which no longer
contains some of the earlier registered sub-metrics doPrune() did remove
these stale sub-metrics from the "cells" collection but missed to remove
them from DropWizard's metric registry. This had the effect that such
stale metrics no longer present in the current dataset were still
reported via the used metrics reporter plugin albeit the underlying
monitoring dataset didn't contain that data anymore.
Fix this by removing the stale sub-metrics also from the DropWizard
metric registry.
Change-Id: I767530f57883379c976614705241cbd1d1597541
Draft comments refs are stored in the "All-Users" repo under a special
ref with the form refs/draft-comments/$change_id_short/$change/$user.
Previously, ref updates used fast forward updates for all operations
(add draft, delete draft, edit draft), and the new commit pointed to the
last commit of the ref. This behavior caused draft deletions to persist
in history.
In this change, the implementation of the change draft update is
modified so that new commits point to an empty parent list, causing
draft deletions to be garbage collected by git after a period of time.
Change-Id: Ifbb7ad2fe1b1370eac30feb3fe7b181cbb626257
When no other ref than a RegExp with a gerrit username or shardeduserid
pattern, the permission is not properly validated and repository access
is denied.
With change Iedf3022f6c, calling shortestExample on regexp+parameters
refs produces a reference that won't match the username or the
shardeduserid.
For a reference like : ^refs/heads/users/${username}/.+
we will have the following:
'refs/heads/users/user1/my_branch' vs
'refs/heads/users/_PLACEHOLDER_/my_branch'
When we remove shortestExample, we have to modify Regexp and
ExpandParameters to skip the regexp start anchor caracter when comparing
against the prefix, or to compare regexps themselves.
Bug: Issue 3340
Change-Id: Id6a890a91c5d6d954dab74694c2d3fd53c15897c
The special regexp caracters ('{', '}') from gerrit pattern are causing
an exception. As ${username} and ${shardeduserid} are only meaningful to
gerrit, we substitute them for placeholders.
Unlike what is done in RefPatternMatcher.ExpandParameters, the
placeholder does not contain ':' but '_' to be correctly evaluated by
Repository.isValidRefName later on.
Bug: Issue 3340
Change-Id: Iedf3022f6ce3068f7e9534f224cf05bb99b0f970
Allow optionally enabling DEBUG level logs for Lucene and Elasticsearch
query tests. It occurs in the form of a command passed to the JVM before
tests start. Tests will only emit INFO level logs if not enabled.
Enable rootLogger default INFO log level after tests conclude.
Add missing log4j-config rule which includes log4j.properties in BUILD
files.
Update online Gerrit documentation to explain how to optionally enable
DEBUG log level for these specific tests.
Bug: Issue 10498
Change-Id: I75492de1c5ef8721ae745266e36b8cbfb0b67682
This occurs very frequently and the cause is always the same, so
logging with the stack trace spams the logs making it difficult
to find stack traces that are caused by real issues.
Change-Id: I6acc32937ee647337337f99309947b0d414dffad
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
In order to enable detailed performance and problem analysis add
upload-pack metrics to the sshd log. The log format for upload-pack log
records is now enhanced to:
- timestamp
- session id
- thread name
- user name
- account id
- message
- command wait time
- command execution time
- time negotiating
- time searching for reuse
- time searching for sizes
- time counting
- time compressing
- time writing
- total time in UploadPack
- bitmap index misses (-1 means no bitmap index available)
- total deltas
- total objects
- total bytes transferred
- client agent
If statistics aren't available e.g. since an exception occurred they are
logged as -1.
Change-Id: I4ec08579cedfeb6a30eb41d2e2a110f4f8eee8fa
The option may be specified multiple times, but this is not explicitly
clear in the documentation.
Change-Id: I33a6030b00a24f578c79cdd369bff246fd4470b0
* changes:
Fix method name to register custom event types in plugins
Don't send mails on publish change edits for WIP changes
PatchSetInserter: allow to set "sendEmail" bit
With this new "sendEmail" bit, we will have more control
for whether emails are going to be sent out after a new
patch set is added. This is useful for avoiding duplicate
emails, e.g merge (already have an email to notify a change
is merged, no need to have another email to say a new patch
set is uploaded).
Change-Id: I43c5d7c6560316d5a6034dc8e711f7e87b7af932
Use enableCreateNewChangeForAllNotInTarget() from AbstractDaemonTest
instead of duplicating the code.
Change-Id: Ic2fe137533a7b6ad33fc1705947473766730bf56
If Change-Ids are computed from the commit content and timestamp it can
happen that 2 changes get the same Change-Id. E.g. this can happen if
the Create Change REST endpoint is used to create empty changes in
parallel. In this case the base commit, the commit content (empty) and
the commit timestamp are the same, so that the same Change-Id is
computed for several changes. This also means that the commit message
and hence the commit SHA1 can be identical between the changes. If in a
follow-up steps identical change edits are published in parallel on
these changes you can even get non-empty changes for the same commit
SHA1. Having multiple changes for the same commit SHA1 (and with the
same target branch) is an inconsistency in Gerrit that Gerrit cannot
deal well with (e.g. this causes issues during submit).
To prevent such duplicate Change-Ids we are now randomly generating
Change-Ids. This means 2 parallel Create Changes requests will use
different Change-Ids even if the commit content and timestamp is the
same. A new test does parallel calls to Create Change REST endpoint and
verifies that commit SHA1's of the created changes differ (they differ
because in the commit message we have different Change-Ids now). When
the Change-Ids were computed from the commit content and timestamp this
test failed.
Also cherry-pick Change-Id: I9de36332 for keeping the secure random
generation out of the GWT-related code and minimise the conflicts
with the merge upstream.
Bug: Issue 12246
Co-authored-by: Luca Milanesio <luca.milanesio@gmail.com>
Change-Id: Ie4f01e5a32b1efca58f8b443ff046623f0e5f188
(cherry picked from commit 73163490b75a8d39aaa2eb60ba2de0cb27f6ba70)
Bazel supports both BUILD and BUILD.bazel files and in this issue: [1]
there is a discussion to prefer BUILD.bazel over BUILD naming
convention. Detect BUILD.bazel files as Python code in addition to
BUILD files.
[1] https://github.com/bazelbuild/bazel/issues/4517
Change-Id: Iabc719b914fcd08ef6e73c314f09f924540c3794
Follow-up change for be4184f7 which missed documentation. Also names of
newly added metrics didn't align with existing metrics for REST API.
- add documentation for the jetty metrics
- improve descriptions of the jetty metrics
- rename jetty thread pool metrics from httpd/jetty/* to
http/server/jetty/* in order to align metric names with already
existing REST API metrics
Change-Id: I1d4eabec91749f28d09df7d2d29606b133fefc4d
This change adds an UI element that displays messages registered with
the MessageOfTheDay extension point. The messages will be displayed
below the main navigation header. This functionality was already part
of the GWT-UI, but was never migrated to the new UI.
The messages can be dismissed by a button click, that will create a
cookie that will prevent the message from being displayed again until
the redisplay time configured with the message.
The content of the message can be HTML. Depending on where the message-
content is coming from, this might be harmful. In case of the
messageoftheday plugin, the message is added as a config from the Gerrit
server site, which can probably be considered save. However, in a future
change rendering HTML should be made configurable and switched off by
default. Text should then be rendered using `gr-formatted-text`.
Change-Id: I2cbbcbcd49734b645701b9fac62a016a269d37f2
The message of the day functionality was lost in the new PolyGerrit-UI,
since the original implementation relied on the server side addition of
the messages to the host page.
This change adds the messages registered to the MessageOfTheDay-
extension point to the ServerInfo, which can be fetched via Rest API.
This allows accessing this information from the new UI.
The UI elements that consume this information will be added in a
followup change.
Change-Id: I1deff5afbd812a1efaf6ad11e871544b36a5d88d
If using the commentlinks.%NAME%.links option and having the same prefix
in the pattern and the url, the parsing did not work properly.
For example:
[commentlink "test"]
pattern = [Hh][Tt][Tt][Pp]example
link = http://example.com
and the line in the message:
httpexample 1234
would result in:
http<a href="://example.com" ...>httpexample 1234</a>
This bug was introduced in a change implementing the possibility to
have overlapping patterns, e.g. allowing a comma-separated list of
issue ids. (commit: fb48902ef303d008c6f0dd38d654106c00313530). This
would have however anyway only worked for the `html`-variant of
comment links, which allow to directly provide html-elements as a
substitute for the text matching the pattern.
Thus, this change restricts the logic introduced in the above mentioned
commit to the html-variant.
Bug: Issue 12197
Change-Id: I9efd9308f2b40f3fec8405c93849d13d4576562a
The tests are using code.google.com issue tracker links but this
tracker has not been used for ages. Replace them with links to the
new Monorail tracker on chromium.org.
This makes no functional difference in the tests, it is just a
cosmetic change.
Change-Id: I33fbc1cdc1f28a585f4c6c12a8bbd88568a20fc4
In case of lock failure there is no hint on what commit has caused it.
This change adds ref log message, which is "commit:" + subject line
of commit message or "commit: meta data update" in case of no commit
message, to the exception message.
Also extract the exception message creation to a separate method, so
that the same info is available when update fails for other reasons.
Change-Id: I5686e079853807ba88dae6d8ccf184eb81b50013
A service-user (either created by SSH command or through ServiceUser
plugin) is actually not bound to the realm : so it makes no sense to
check if the realm supports editing FULL_USERNAME or EMAIL.
To overcome, we now check realm capabilities only for users which belong
to that realm.
Change-Id: Ic4e04936a5d2444bf6b4644a2f8a3838a2686256