Do not construct clone commands on client-side, but rely on the scheme
URLs that are retrieved from the server.
Change-Id: I7077ce0dcf21941d44ec69e4aecf7adb94bbeebe
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The Gerrit Client needs to know about some server configuration
parameters in order to render the UI and enable/disable certain
functionality. At the moment the information about the server
configuration is embedded into the host page, but there is a new REST
endpoint that exposes some of the configuration parameters, and it
should be used instead. Retrieving the data via REST is cleaner as
this is an API which can be also used by other clients. Also it
reduces some code duplication if the configuration parameters are only
exposed via REST and not once again via the host page.
This change is only a start to get rid of the configuration data which
is embedded in the host page. It only consumes those configuration
parameters via REST which are already exposed in the REST API. In
future changes the REST API should be extended to provide all
information that is needed by the Gerrit Client, so that no such data
must be embedded into the host page.
This change doesn't consume the download commands which are already
exposed via REST, since this requires quite some changes in the Gerrit
Client, and it is better done in an own change.
Change-Id: Id367ba82a29bfc8f84fa4bb3c2fc973355e5cc4a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* stable-2.11:
Position cursor on first column on diff chunk navigation
Restore default Codemirror cursor style
Update 2.11.1 release notes
Update replication plugin
rest-api-changes.txt: fix minor spelling mistake
Fix various spelling mistakes
Prolog-Cookbook: tidy up rule status descriptions
Upgrade replication plugin
Always add SecureStore module in WebAppInitializer
Batch index executor: Don't fall back to interactive executor
Fix minor typo in set-account command documentation
ChangeJson: Don't load all approvals on closed changes
ChangeJson: Less eager loading of patch sets
ChangeJson: Eliminate patch set loading in search results
Remove StoredValues.PATCH_SET
Update 2.11.1 release notes
JarPluginProvider: Add JarScanner on running plugin JAR file
GitWeb config: Delete temporary config on exit
Fix description of auth.* parameters
Change-Id: I9fc13aa3665c29e488d49a36c9b57f908a74c2f8
GitWeb config file remains undeleted in temporary directory on Gerrit
exit.
Call deleteOnExit() for this temporary file.
Change-Id: Ib62579b36cfe73bca0fa1f44383e6a613609cb45
The clone commands on the project info screen were only shown when a
checkout command was configured on the server. This doesn't make sense
since clone has nothing to do with checkout. Remove the check and
always show the clone commands.
Change-Id: I7f9095046004d8643fc810c61b7ca53cfed1b4a7
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Certain code paths may trigger execution of the finally block before a
value is assigned to the viewData variable. This change properly
handles the case where viewData is null.
Change-Id: I41723257fa3a3a6d99aaae56f6ce9392b1a4250b
Some of the Gerrit configuration parameters can now be accessed by
GET /config/server/info
This REST endpoint can also be used anonymously.
For now the REST endpoint returns only a very limited set of
configuration parameters, which are needed by the Gerrit Mylyn
Connector. The result contains information about:
- auth type, editable account fields, if contributor agreements are
used
- contact store
- download schemes, commands and archive formats
- All-Projects and All-Users project names
At the moment the Mylyn Gerrit Connector retrieves this information by
parsing the config from the HostPageData which is sent to the client.
This is an internal data structure which is used to exchange
information between Gerrit server and Gerrit WebUI. It's not an API
and third-party tools should not rely on it. As a result the Mylyn
Gerrit Connector is currently broken for Gerrit 2.11 and newer.
Provide the Mylyn Gerrit Connector team a stable API that provides
them the information they need so that future breakages can be
avoided. See Eclipse Bugzilla issue 465132 [1] for further details.
The structure of the returned JSON correlates to the structure in the
gerrit.config file.
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=465132
Change-Id: Iac4be762bff971403438aa84923d9f0e11883366
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
In order to facilitate action-specific auditing, the RestResource,
RestView, and HttpServletRequest are incorporated into a new extended
audit event class, supplementing all existing fields (some redundant)
in HttpAuditEvent. Although the request is already available from the
Guice injector, adding this high-value information as a field
facilitates convenient access.
Change-Id: I3ebd629c90921237bbcfbb00d9ea990740099104
The REGISTER_NEW_EMAIL is only supposed to be included into the
editable account fields that are sent to the client if it is editable
and if an email sender is available and enabled. At the moment it is
always included when it is editable, even if there is no enabled email
sender.
Change-Id: Ib64851b9e6f5853ba7e111b4ddcd22a4fffa833e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This allows use the standard git archive command to create an archive
of the content of a repository:
$ git archive -f tar.bz2 --prefix=foo-1.0/ \
--remote=ssh://john@gerrit:29418/foo \
refs/changes/73/673/1 > foo-1.0.tar.bz2
Different compression levels can be configured for zip format:
$ git archive -f zip -9 \
--remote=ssh://john@gerrit:29418/foo \
refs/changes/73/673/1 > foo.zip
TEST PLAN:
buck test --include ssh
Bug: Issue 2061
Change-Id: Ifc1a92bacef3155cf474adee883cbe587dd8759f
* stable-2.11:
Acceptance-tests: Don't assume UTF-8 system wide encoding
Update version to 2.10.3.1
Release notes for 2.10.3.1
Project Owner Guide: Mention importer plugin to rename project
Update the cookbook plugin revision
Acceptance tests: Always treat response encoding as UTF-8
Fix broken formatting in 2.10.3 release notes
Update 2.11 release notes
Add anchors to plugin sections in plugin documentation page
Add description of importer plugin to the plugin documentation page
Fix rendering issues in Configuration documentation
Document that submit should for granted on refs/heads/*
Update version to 2.10.3
Update 2.10.3 release notes
Improve the version computation for the release notes
Check reachability from R_HEADS/R_TAGS/REFS_CONFIG when creating branches
Update 2.10.3 release notes
Include submitter in ChangeMessage on submission
Support hybrid OpenID and OAuth2 authentication
Move edit ref name methods from ChangeEditUtil to RefNames
Remove tests related to duplicate event type registration
Events: Allow same event type to be re-registered
InlineEdit: Clarify difference between remove and revert operation
Documentation: clone buck from Github
ChangeTable: Always add the title tooltip on label column entries
Enable 'Save' button when 'Display In Review Category' pref is changed
Add ForcePushIT to acceptance tests
InlineEdit: Handle enter event in add file dialog box
Update replication plugin to latest revision
Release notes for Gerrit 2.10.3
Fix NPE in GitWebServlet
Update revision of the replication plugin
Fix required index version for online reindexing in 2.11 release notes
Update buck version to same as master
OAuth: Respect servlet context path in URL for login token
Invalidate OAuth session after web_sessions cache expiration
Set version to 2.11
Update 2.11 release notes
Prevent wrong content type for CSS files
Improve rebase usability with the RebaseDialog
Update 2.11 release notes
MergeabilityCacheImpl: Only get needed refs
Explain online reindexing in 2.11 release
Revert marking merged or abandoned changes in related changes
Change-Id: Id915ef7316b3e721738064bb1cce97020e04296e
* stable-2.10:
Update 2.10.3 release notes
Improve the version computation for the release notes
Check reachability from R_HEADS/R_TAGS/REFS_CONFIG when creating branches
Update 2.10.3 release notes
Include submitter in ChangeMessage on submission
Support hybrid OpenID and OAuth2 authentication
Release notes for Gerrit 2.10.3
Change-Id: I03e0cbb444e9ae2090f510d6f4e49c6db5ece033
e9707d8f85 exposed OAuth authentication extension point. Using this
extension point plugins can offer OAuth2 authentications.
That is fine for new Gerrit sites, which can restrict the auth scheme
to OAuth2 only.
For the existing sites, that rely on non SSO OpenID auth scheme it
doesn't work to migrate to OAuth2 because of diverse contributors
base that use different OpenID providers. Not all OpenID providers
offer OAuth2 protocol. Particularly, widespread OpenID providers
among open source Gerrit communities are Launchpad/UbuntuOne and
FedoraProject don't offer OAuth2 protocol. To not lock out those
contributors from being able to contribute to open source Gerrit
based projects OpenID must still be supported.
With Google's shut down of their OpenID service in April 2015, big
user base is locked out from contribution to Gerrit based projects
that only support OpenID auth scheme.
The only way to still support OpenID 2.0 providers and new OAuth2
based protocol is native support for hybrid authentication scheme
in Gerrit.
This change extends OpenID auth scheme by making it aware of optional
OAuth plugin-based authentication.
When no oauth-provider plugins are deployed, OpenID auth scheme works
as usual. When OAuth provider plugins are deployed, OAuth2 providers
are offered on the OpenID login form, in addition to hard coded Yahoo!
and Launchpad OpenID providers: [1].
[1] http://imgur.com/IcCrChN
Change-Id: I6d70212f4fea5443a6322c7da683e1e943d058eb
When modifications of access rights are saved for review, a new change
is created. Now this change has a Change-Id in the commit message, so
that it's easier to manually rework the change and push further patch
sets.
Bug: issue 2817
Change-Id: I0a6399d731644bdc28147cfd8527e3b692c953da
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The mime-util library contains two content type mappings for .css
files: application/x-pointplus and text/css. Unfortunately, using
the wrong one will result in most browsers discarding the file as
a CSS file. Ensure we only use the correct type for CSS files.
This happens because MimeUtilFileTypeRegistry attempts to get all
MIME types from mime-util and then sort the result based on the
specificity of each type. Since both types have no magic string,
only the ExtensionMimeDetector matches.
Change-Id: Idfe88dc823f191d9c9e0b9c9da3b5d2ec471f9db
The login redirect was set up to strip '#/' when redirecting to
the login page. In 2.10, HttpLoginServlet assumed the URL already
contained '#/', which means the redirect back to the original
page after login would fail.
Bug: Issue 3044
Change-Id: I5dc297e31d26006f52f869a63e5b9cc6f9591b21
Java 8's javadoc fails hard on unknown HTML tags. Due some
documentation code snippets that contain generics and lacked a
{@code...}, the code got picked up as html, which made the target fail
like:
[...]/extensions/registration/DynamicSet.java:64: error: unknown tag: Foo
* DynamicSet.setOf(binder(), new TypeLiteral<Thing<Foo>>() {});
We insert the needed {@code...} to make the build pass for Java 8.
Change-Id: I430b8eb9f2f158c2c7a2a7a8d93446eff3253529
A message "Forbidden" was displayed when clicking on any part of the
breadcrumb trail displayed at the top of Gitweb pages. That happened for
projects with parent folders because browsing parent folders is not
supported by Gerrit.
Now when the user clicks on the parent folder, redirect to Gerrit projects
list screen with the parent folder path as the filter.
Change-Id: I86dfb3f29d8da6ee02efc95470673fe70a1f2d3e
Repository, RevWalk, and friends have been converted to AutoCloseable.
Use them in try-with-resources blocks in order to avoid warnings about
unclosed resources or calls to deprecated release() methods. Where a
larger rewrite might have been possible to reduce try/finally blocks,
err on the side of keeping the same behavior.
The proximate goal of this change was to eliminate all Eclipse
warnings about deprecated method calls (namely release()) and leaked
resources. Some of these warnings were in fact potential leaks;
Eclipse finding such cases is a side benefit of having these classes
implement AutoCloseable. However, this change certainly does not cover
all cases where try-with-resources could have been used, where it was
not causing a leak.
Fixes all such warnings in plugin submodules as well.
Change-Id: I5d151996ae012d0e8fdfa27cce8cf5e2bfc856a2
Due to the Guice issue [1] cloning of a repository with a space in its
name was impossible. If the space wasn't encoded:
$ git clone 'http://gerrit/My Project'
then such a request failed already in Jetty code.
If the space was encoded:
$ git clone 'http://gerrit/My+Project'
or:
$ git clone 'http://gerrit/My%20Project'
then the HttpServletRequest.getPathInfo in the GitOverHttpServlet would
return a non-decoded string i.e. "My%20Project' and the project wouldn't
be found. The HttpServletRequest.getPathInfo is expected to return a
decoded string [2].
Unfortunately, there is no Guice release which contains the bugfix for
the issue [1].
Workaround: decode the projectName in the GitOverHttpServlet.Resolver
explicitly.
[1] https://github.com/google/guice/issues/745
[2] http://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getPathInfo()
Change-Id: I8872cd2d1bab3f8e454d0d7399b35eb850068042
There are several classes that have inner classes not declared with the
'static' modifier. For these classes Findbugs reports:
This class is an inner class, but does not use its embedded reference
to the object which created it. This reference makes the instances of
the class larger, and may keep the reference to the creator object alive
longer than necessary. If possible, the class should be made static.
Add a 'static' modifier on these classes.
Change-Id: I0244bb1cd5662398f79c61d442df815e3811bf12
Update the Checkstyle configuration to only warn on lines that exceed
150 characters.
In code reviews we usually ask people to wrap lines at around 80 columns,
but there are too many existing long lines (between 80 and 150) to bother
fixing them all now.
Only wrap the ones that are egregiously long (i.e. more than 150) and add
suppressions for the ones that cannot be wrapped, for example containing
long URLs.
Change-Id: I09625efa7a0509f1d88c27ebc83dda67b6afd026
* stable-2.11:
Align parent links with parents in CommitBox
Allow scrollable cover messages
Update Review UI documentation to include new rebase functionality
ChangeData: check patch set visibility in change mergeability check
Prevent recursive rebase attempts
RebaseDialog can now be closed with ESC
Make use of true as default for copyAllScoresIfNoChange consistent
Set version to 2.10.1
Release notes for Gerrit 2.10.1
Expose extension point for generic OAuth providers
Change-Id: I93af48ce7a600dffc9f73afb9cc8131da26b2a59
JGit's TemporaryBuffer.Heap recently gained an estimatedSize argument
used for presizing the backing block pointer list. Without this
argument, it assumes callers are going to use the entire maximum size,
and allocates an array large enough to hold enough pointers to
8192-byte blocks to fill the maximum size.
This is pathologically wasteful in RestApiServlet, where we might
allocate one or more buffers with size Integer.MAX_VALUE just to store
JSON serialization results. This allocates an array with over 250k
elements, taking about 2M of memory which is immediately made garbage.
On *every* request.
Most JSON responses are small. We can even be pretty liberal and guess
that they are under 10 blocks (80 KiB) in size, costing us only 10
object pointers (<100 bytes) worth of memory.
Change-Id: I9e1806737706ab2a24693455d64caa7d1067af35
* stable-2.10:
Set version to 2.10.1
Release notes for Gerrit 2.10.1
Expose extension point for generic OAuth providers
Change-Id: I33006b0ea12611590979f376816d066883177d4f
JavaScript plugin load time depends highly on the network performance.
In some cases default value of 5s would be not enough to load all
plugins. This will result in standard Gerrit error page saying that
plugin failed to load.
New configuration option plugins.jsLoadTimeout allows administrators to
configure the plugin load timeout value, giving them possibility to
increase this value when 'plugin load failed' message is showing too
often.
Change-Id: I5979bc16e218db514a7eadefb2b41eacd935897d
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>