This class is using a map to store the memberOf and can be accessed
by multiple threads concurrently. The map was not synchronized which was
causing an infinite loop under very specific sequence of events. Here is
a snippet of the thread dump when that problem happened:
"SSH gerrit review ..." prio=1 RUNNABLE
java.util.HashMap.getEntry(HashMap.java:446)
java.util.HashMap.get(HashMap.java:405)
com.google.gerrit.server.account.IncludingGroupMembership.containsAnyOf(IncludingGroupMembership.java:77)
com.google.gerrit.server.account.UniversalGroupBackend$UniversalGroupMembership.containsAnyOf(UniversalGroupBackend.java:152)
com.google.gerrit.server.account.IncludingGroupMembership.search(IncludingGroupMembership.java:115)
com.google.gerrit.server.account.IncludingGroupMembership.containsAnyOf(IncludingGroupMembership.java:93)
com.google.gerrit.server.account.IncludingGroupMembership.contains(IncludingGroupMembership.java:69)
com.google.gerrit.server.account.UniversalGroupBackend$UniversalGroupMembership.contains(UniversalGroupBackend.java:129)
com.google.gerrit.server.project.ProjectControl.match(ProjectControl.java:493)
Change the HashMap to a ConcurrentHashMap to handle concurrent access.
Change-Id: I36f654281b7a1d7126936d86d64e6827d8987577
Commit 3bde74c2797 introduced a bug in the REST API. Methods other
than GET could not be used anymore from plugins. For example it was not
possible anymore to delete projects with the delete-plugin using DELETE.
Bug: issue 2949
Change-Id: If90247ec4e0dad03b02d0a9e21202455fece90a7
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
(cherry picked from commit 3d227bbadfa234bcac7400cf41030423bf183ff3)
Within MergeOp these are keyed by Change.Id, but some error handling
code only receives the CodeReviewCommit and not the ID. That code is
reasonable in assuming there is a change/notes/control available, so
ensure this is the case when creating error instances.
Bug: issue 2911
Change-Id: If65398652f0e5b1a2b10a2fadc9a3b74bce7d556
The instances returned by this static factory method are severely
limited, in that they are not tied to actual commit objects. In most
cases, we can tie them to commit objects, so do that whenever
possible. Limit the statuses that we can pass to this method by
making it private, and creating separate factories only for those
statuses where there is really no commit.
Change-Id: I0cb392f4f7f5134d4a7487a2a7bb7ac9d770f334
* stable-2.9:
Update 2.9.1 release notes again
Update 2.9.1 release notes
Fix: permission on user specific reference name cannot work
Change-Id: If55ca570970fb22ba0590dbf598b4fe342ffeb56
In ExpandParameters.match() the parameter 'ref' may also contain
"${username}", e.g. in ProjectControl.canPerformOnAnyRef() the call
on controlForRef() puts in a access section name, in this case 'ref'
also need evaluation before doing next match, else it will not be
matched and that section is skipped in preparing RefControl.relevant,
as a result when a user has PUSH power *only* on that section, Gerrit
will reject any upload request from this user.
Fixed. evaluate any per-user ref in ExpandParameters.match().
Change-Id: I42c8e15d147eb4ad031b929cf51ccfc1e17a16e3
* stable-2.9:
Release notes for Gerrit 2.9.1
Set version to 2.9.1
Display parents for all changes, not only merge commits
Fix JS plugin load when using non-root Gerrit URLs
Don't require secondary index when running daemon in slave mode
Remove fixed limit of results returned by secondary index query
Conflicts:
VERSION
gerrit-extension-api/pom.xml
gerrit-gwtui/src/main/java/com/google/gerrit/client/change/CommitBox.java
gerrit-plugin-api/pom.xml
gerrit-plugin-archetype/pom.xml
gerrit-plugin-gwt-archetype/pom.xml
gerrit-plugin-gwtui/pom.xml
gerrit-plugin-js-archetype/pom.xml
gerrit-war/pom.xml
Change-Id: Id7a49d3792510653da4312e240924d47e8b52724
When Gerrit is not on the root URL path the JS plugins
failed to load because of the exact matching required
on the request URL.
Current check is now more flexible by checking only
the suffix of the JS plugin path.
NOTE: In theory this may recognise even different URLs
than the intended one (e.g. /gerrit/bla/bla/bla/plugins/...)
but however they would not land on the HttpPluginServlet
anyway. That's why "endsWith" is good enough for this check.
Change-Id: I299b244a9fcdc9b00175e2054a7ba7363620979b
Add a dummy index implementation and install it when the daemon is
started in slave mode.
Make the reindex program exit with an error if run on a server that
is configured to run in slave mode.
Disable the query ssh command when in slave mode.
Change-Id: Ia323d7dfc3b8f333857ba310072e41943878c11b
The global query limit capability can be set to any value in the
project settings, however in the query implementation the limit
is hard coded to 1000.
Remove the hard-coded limit so that the limit specified in the
global capability is honoured.
Bug: Issue 2879
Change-Id: I9974f43da7cf9902b7e46607d44abc7383f77ecd
* stable-2.9:
Fix NPE when ReviewInput's message is empty
Fix NPE in /projects/{name}/children?recursive when a parent is missing
Fix NPE when submitting review with inline comments via REST
Conflicts:
gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
Change-Id: Icfde6f0274f0ccc92773fd5a376e8c27099437ac
* stable-2.9:
Add full names for options on list groups REST API
Add full names for options on list projects REST API
Make `-S` an alias of `--start` in changes query REST API
Mention deprecation of sortkey parameters in 2.9 release notes
Run change hooks and ref-updated events after indexing is done.
Fix broken formatting in changes REST documentation
Restrict the input of plugin_archetype_deploy.sh
Gracefully handle `buck audit` failure
Revert "Make VisibleRefFilter.Filter reuse the refs passed from JGit."
Conflicts:
gerrit-server/src/main/java/com/google/gerrit/server/change/PutTopic.java
gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java
tools/pack_war.py
Change-Id: I89a9b42c049ec1365ef6dec53c73c7a10a41e888
The option had been added with the name `-S`. Change the name
to `--start` with `-S` as an alias, making it consistent with the
naming in other REST APIs.
Add the option to the documentation.
Remove the documentation of `-P` and `-N`. These options only exist
to support online reindexing from clients with outdated JS, and are
deprecated. Keeping them in the documentation will potentially
cause confusion.
Bug: Issue 2878
Change-Id: I992acf4a3d1aeebb1ef40c6fed1afcb0fe26fa92
The change hooks and ref-updated events were run parallel to the
change (re)indexing. This meant that an event-stream sent events
to the clients before the change indexing was finished. If a client
queried for that change immediately after receiving the event it
happened that the response was not-found as the indexing wasn't yet
done.
Although we haven't had issues with a ref-updated event processors,
firing this event will also wait for the indexing task to finish
as we never know if a ref-updated event processor may trigger a
change query.
Change-Id: Iff17c5aeb9675f3991f938d31ef5048ef5b3b956
When a plugin provider was using the AbstractPreloadedPluginScanner
to automatically scan its contents, the Guice modules were incorrectly
detected and wrongly assigned:
- Modules not initialised to null at the beginning of the scan
- SshModule incorrectly assigned to SysModule and the other way around
- Inner modules were clashing with named Guice modules
e.g. install(new Module() { })
This fix brings much more sanity to module detection for plugin
providers (e.g. Groovy, Scala or other pluggable plugin formats).
Change-Id: I4edddd29acd0ff81cd61841bef8d2356ea20e716
Input mispelled option of plugin_archetype_deploy.sh
it starts to run. Restrict the input to avoid this error.
Add confirm before run.
Change-Id: I6fdc8b592679c45891210261a47285171b50e35f
Handle exception raised when invoking `buck audit` and exit
with an error message, instead of dumping a python Traceback.
Change-Id: I3786c4eddffa03117f4437314fc12ee68c689a85
This reverts commit b032a529f83892dfbdfb375c47a90d89756dd8ab. This
commit introduced an issue where tags were not replicated under certain
circumstances.
Bug: Issue 2500
Bug: Issue 1748
Change-Id: I9c902b99c7f656c7002cf3eab9e525f22a22fb85
If there is a broken edge in the parent graph treat it as having no
children instead of throwing NPE and failing the REST API call.
Change-Id: Ib72f76f04f5804d2b953f0951d3304fc1d6329a2
NPE occurs when submitting a review with inline comments in
the format:
{
"comments": {
"test.txt": [
{
"line": 1,
"message": "comment"
},
]
}
}
The comma following the closing brace after the `"message": "comment"`
line seems to be causing an iterator with a null element to be
generated.
NPE does not occur when the comma is omitted.
To prevent the NPE remove the null element from the iterator.
Change-Id: I248739fce955522f7ee4a93441e48914342d3d7d
Account can be null which was causing a 'Guice provision errors' and
preventing the Merge operation from completing. Add @Nullable for
account parameter in constructor.
Change-Id: I17103ede239190840eaffdd8aaae0bb71de3609c
If an update check fails, it may be change specific. Record the
change as part of the logged message.
Change-Id: I33aba050572f919e150d8e0f1bd678f575301b72
If a change is missing its current patch set the mergeablity check
will NPE. Skip the check and just return false, indicating there
was no update made to the change.
Change-Id: Ic82b2db1d2f7d27105a06c4082b51e7308f02b04
When a range comment is given in the review, the caller must specify
the "range" entity with "start_line" and "end_line" values, and also
the "line" value.
The documentation simply says that the "line" value 'should equal the
end line of the range', but the implementation does not validate this.
If "line" is not specified, the comment is added as a file comment
regardless of what "start_line" and "end_line" values are given in
the range. This can be confusing for users.
Change it so that when a "range" is given, the "line" value is not
necessary, and if given at all will be overridden with the value from
the "range"
Bug: Issue 2861
Change-Id: I5d0d31c392937b1955572781375fc48982ea7664