465 Commits

Author SHA1 Message Date
Dave Borowitz
9cad868a80 Fix race conditions in LabelTypes map creation
Change-Id: I9e6d51f73bd664e82d9f54d127bbdd5bc46ab382
2014-01-02 15:58:39 -08:00
Shawn Pearce
dfbe6d6ead Add MessageOfTheDay extension point for plugins
Allow plugins to contribute messages to the UI during initial page
load. Gerrit displays the messages in a butter bar at the top of
the page and allows users to hide them with the "Dismiss" button.

Messages are hidden per-browser using a cookie named after the
message id, set to expire at a date supplied by the server. After
this date the same message could redisplay if the server sends the
same message again.

Change-Id: I0bcca845f501cbeb8c31356fff398c3adb43099a
2014-01-02 08:19:57 -08:00
David Pursehouse
0337010691 Fix misspelling of ParameterizedString
Change-Id: I3fa3ea32e25051fb4712faf04f9fc6542a1e6dcb
2013-12-17 19:38:04 +09:00
Colby Ranger
ac2f30c3e0 Link the tree of the filename in SideBySide2 to gitweb
It is often convenient to be able to see the files in the same
tree as the file being reviewed. Update the gitweb linker to
support linking to a specific revision and file.  Link the base
of the filename to the tree and link the project name to the root
tree.

Change-Id: I11a969e9b1d14ea4180699ae9c02a6a62147d3de
2013-12-16 12:44:36 -08:00
Shawn Pearce
ec51eba12b Merge "Replace PatchDetailService saveDraft and deleteDraft" 2013-12-12 20:09:47 +00:00
Dave Borowitz
57ecf24c06 Consolidate parsing and formatting for label votes
We currently support two styles of parsing, Label-Value and
Label=Value. Consolidate these into a single LabelVote class.
(Unfortunately for backwards-compatibility reasons we can't just
eliminate Label=Value in ReviewCommand.)

Change-Id: I9e5255b184d786226e6b11fe059001608c00673d
2013-12-11 13:57:50 -08:00
David Pursehouse
753ca33878 Allow the text of the "Report Bug" link to be configured
The title text shown on the link to the bug tracker can be configured
in the gerrit.config file.  If not set, it defaults to "Report Bug".

Bug: Issue 2318
Change-Id: I38c6057b96bf97fc96341621c9d8bbb49060dc40
2013-12-10 17:08:47 +09:00
Dave Borowitz
12e79a4edd Eliminate "invalid member type qualification" warnings
These warnings are spurious in that the member types are correctly
qualified within the appropriate scope, but Eclipse reports them
to be consistent with javadoc[1], which has a long-standing bug.
Unfortunately, they also cannot be turned off.

For references to common Gerrit key/id types (e.g. Account.Id), just
use @code, as the @link isn't providing much value. For references
where the link might be more useful, use the fully-qualified type.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=371420

Change-Id: I0baca75c20e69c51d3bf251aa818460d30e3d631
2013-12-10 04:20:40 +00:00
Shawn Pearce
b74e0e34b3 Replace PatchDetailService saveDraft and deleteDraft
Change-Id: Ia3bafdd87a7760b52a153fa8ebdcafd9152d53e5
2013-12-09 12:30:12 -08:00
Matt Baker
b2a7d239bd Remove the use of + when using StringBuilder (1 of 2)
Change-Id: I010b487de26c5a16b3dfda41130d7ea91b1587e8
2013-12-08 19:59:00 -07:00
Shawn Pearce
d020143837 Remove old patchSetPublishDetail RPC
Change-Id: I776761163f747117fb94e4c3fd57dde77de2d31e
2013-12-07 10:00:30 -08:00
Shawn Pearce
adb91286f8 Remove old changeDetail RPC
Convert the new RPC data into the old data, just enough to keep the
old UI alive against a newer server.  This will allow us to build a
final version of the old UI code and run it for quite some time
against a modern REST API.

Users who refuse to upgrade to ChangeScreen2 can run this frozen old
UI build until it no longer works.

Change-Id: Ieef15c39e97673f6bcdeb03567fc48ddbd289a6e
2013-12-07 09:58:04 -08:00
David Ostrovsky
ad47c869c5 Remove old deleteDraftPatchSet RPC
Change-Id: I89f4a6dd5307f40a7b1b58596ce111b5b7c51a0b
2013-12-07 01:11:23 +01:00
David Ostrovsky
a15cfff1b2 Remove old rebaseChange RPC
Change-Id: Ieb55dd1c01f1161649400a375119bdd89ec50330
2013-12-07 00:59:44 +01:00
David Ostrovsky
68b7449da7 Remove old publish RPC
Change-Id: I23d2b007ab4f0154d763973f838505f31d071c48
2013-12-07 00:59:42 +01:00
David Ostrovsky
d0a4fea342 Remove old DeleteDraftChange RPC
Change-Id: I77f1cb57123922aa519eddbeda3b6b9fa44ea559
2013-12-06 22:42:56 +01:00
David Ostrovsky
0561211396 Remove old EditCommitMessage RPC
Change-Id: Ic25c5d68f3bb27423b7c6b829169e33c8361eba5
2013-12-06 22:11:00 +01:00
Shawn Pearce
d043611713 Add server config option to disable new features
Some user groups are intolerant of any sort of new feature or
funcationalty being added to the web interface.  Add a server
variable that disables or hides most new functionality.

Change-Id: Ide3a6a5e66cbba9c58575345a4a9ad1da209bb16
2013-12-05 17:40:28 -08:00
Dave Borowitz
86f08f504a Fix Javadoc warnings in SuggestService
These constants moved into the server package, which depends on this
package, so we can no longer import the necessary class for a @link.

Change-Id: I0695a991835a8d83db5b8f40def1e106babdc091
2013-12-05 09:51:58 -08:00
Shawn Pearce
0a70c69cb8 Hyperlink to groups in access editor
Internal group names are automatically hyperlinked in the access
control editor. This makes it easy to view the members of the group
and determine if access is correctly assigned.

Plugins supplying group systems may include a url to a group
information page. If present use these URLs as hyperlinks in the
access editor, providing the same functionality.

Change-Id: I9605fdc1d43d6705a01ec2b68b083e8678dbc88a
2013-12-03 15:13:47 -08:00
Shawn Pearce
05cb053378 Save GWT compile time by avoiding javac
GWT only needs the rebind code for CSS and ServerLinker to be
precompiled as bytecode. Save build time by passing no source
files to the java_library() used by gwt_module().

For a full draft build of ui_safari this cuts the refresh time
down from 32.015s to 26.158s on my MacBook. Saving 6s on each
UI reload adds up during development.

The common annotations need to be provided as bytecode, avoiding
spurious warnings from GWT when there is a Java syntax error.

Change-Id: I37826498650c65c05303e7d4d1177d05781c56f6
2013-11-30 11:06:50 -08:00
Shawn Pearce
d4ae3a16d5 Delete SQL index support
Require the secondary index to be enabled in Gerrit 2.9.  Unless
configured differently, Lucene is used for the secondary index.

Change-Id: I3d2d804170835d69ffbfef586ddc3873ea3cd1c8
2013-11-29 11:35:39 -08:00
Gustaf Lundh
639f2a3081 Remove ToggleStarRequest.java
Since:

  d4765db81686cb00ee80952201d40ae5ceb4f863
  Add REST API to toggle starred change state

ToggleStarRequest is not used anymore.

Change-Id: I1d798541e6a7f9377d4a1b8ad9c2d93d5b4a4f82
2013-11-29 17:24:36 +01:00
Shawn Pearce
72fb6cc514 Remove unused .gitignore
These were necessary only for the Maven based build.

Change-Id: Ie26669e6ccae60a52d2db1b8ad362e2fa88a26f2
2013-11-28 22:56:51 -08:00
David Ostrovsky
c53fd3ae49 Delete eclipse left-over files from the Maven poop era
Change-Id: Ie3a75e8c6a2d274cd39e362259ab20cff474eb8d
2013-11-28 22:55:09 -08:00
Edwin Kempin
475b241f4d Always keep Submit button enabled even if change is not mergeable
If 'changeMerge.test' is set to true Gerrit checks if a change is
mergeable and shows this on the ChangeScreen. If a change is not
mergeable the submit button is hidden. There are two problems with
hiding the submit button:

1. Users get confused why the change cannot be submitted. They are
searching for the submit button and do not understand that they have
to rebase the change. Gerrit administrators are annoyed to answer
questions about this. If trying to submit the change fails there is a
good error message that tells the user that he needs to rebase the
change. This is mostly a problem with the old change screen. On the
new change screen the red "Cannot Merge" and the "Merge Conflict"
status can hardly be overlooked.

2. If a change has a conflict it is possible to resolve the conflict
in a merge commit which is a successor of the conflicting change. If
this merge commit is submitted it is in state 'Submitted, Merge
Pending'. If now the conflicting change is submitted the merge
succeeds. This way of resolving conflicts is not possible if the
submit button is not available on conflicting changes.

Since we are now always showing the submit button (if the approvals
allow submit and the user has the permission to submit) and we are
also always computing the mergeability flag for each open change,
there is no need for the 'changeMerge.test' configuration parameter
anymore. This feature is now enabled by default and the
'changeMerge.test' configuration parameter is removed.

Change-Id: I37e69e67992b3aea153e134a5f21fe76ba7e2b91
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-25 14:14:23 +01:00
Shawn Pearce
dd218662c0 Replace <code> with {@code} in javadoc
{@code foo} is shorter and easier to read and write than
<code>foo</code>, which is why it was introduced years ago in the
javadoc processor.  Make consistent use of it throughout the
documentation comments.

Change-Id: I59d428cb6c5015453629398b0697891b83c8e91d
2013-11-24 13:12:20 -08:00
David Ostrovsky
eaeb9ad104 ChangeScreen2: Make diff against revision persistent
2d2a3c405e5472f27b96484b068f51c34ee5e6cb added diff against to the change
screen2. However base revision is lost when side by side view is closed.

This change fixes that.
Change-Id: I7f74760fde96469a60556f657923a3936d6516c7
2013-11-24 12:47:16 -08:00
Edwin Kempin
662e55f6af Visualize sizes of changes in change tables and user dashboards
Add a new column to change tables and user dashboards in which the
size of a change is visualized by a colored bar. For small changes a
short green bar is shown, for medium sized changes a middle sized
yellow bar is shown and large changes have a full red bar.

Visualizing the change sizes gives a hint to the reviewers about how
complex a change is and how long it will take to review it.

For contributors the visualization of the change size may be a
motivation to split large changes into smaller pieces which will speed
up the review process.

How many changed lines are considered as a large change is
configurable.

Change-Id: I88497b8aea00047d93ad7d079eecc5e1052187d2
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-23 21:10:28 -08:00
Edwin Kempin
fb3e5b43b8 Show tab with conflicting changes only if secondary index is enabled
This tab makes use of the 'conflicts' operator which is only supported
if a secondary index is enabled.

Change-Id: I25cc023e10f10a80efce12c1a3e62a65cb8940f3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-22 16:46:19 -08:00
Edwin Kempin
053853b6a3 Quote topic name in same topic query
Topic names may contain whitespace. This is why
we need to quote the topic name in the query.

Change-Id: I0ce6a8ca57cec987ddeeaeed71cee757dcb9d17b
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-22 16:24:48 -08:00
Shawn Pearce
3eb9776740 Delete dead old style myDiffPreferences RPC
This method is not invoked by any UI code. Drop the method.
/accounts/self/preferences.diff provides the same data on
a supported REST API.

Change-Id: If88d8449f48e898fc84fdabad19341bd8063a737
2013-11-20 23:13:09 -08:00
David Ostrovsky
8e4a99051d Document programmatic HTTPD and SSHD logging configuration
Change-Id: Ie342a593a8ae854fe33f312cac22e1089119614a
2013-11-20 00:02:12 +01:00
Shawn Pearce
e5bddc9099 Merge "Enable sshd_log and httpd_log to use log4j config" 2013-11-19 21:16:31 +00:00
Eryk Szymanski
66252ed8ea Enable sshd_log and httpd_log to use log4j config
At the moment log4j configuration is a bit inconsistent: it is
possible to configure error_log and gc_log using file provided
with log4j.configuration system property, however httpd_log and
sshd_log configuration is hard-coded in corresponding classes
(HttpLog and SshLog).

Make logs configuration more consistent by using log4j for all
logs. If log4j.configuration variable is not set, log behavior
remains intact and code-level log configuration will be used.

In case of log4.configuration points to log4j.properties file the
hard-coded configuration will be ommited and log4j.properties will
be used instead.

In addition shouldConfigureLogSystem() call moved from ErrorLogFile
to LogUtil in com.google.gerrit.util package and removed deprecated
reference to log4j LogManager.DEFAULT_CONFIGURATION_KEY so that
gerrit common does not require log4j.

Two inner MyLayout classes (one from SshLog and one from HttpLog)
have been extracted to separate files and renamed accordingly to
enable to use them from log4j.properties file if required. At the
moment those are extracted as is - refactoring will follow.

Change-Id: Icb1a3787b98392a9df9bb2afa4dc857f8cfada3a
Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
2013-11-19 13:06:05 -08:00
Edwin Kempin
9d945ed1e9 Support setting HEAD from WebUI
Project owners can now change HEAD from the ProjectBranchesScreen.

Change-Id: I1394312bd9bdead3c71772ba35fd2e0798c04d44
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-19 14:55:38 +01:00
alex.ryazantsev
9d3492c0c8 Remove unnecessary invocation toString() method
Change-Id: Ibbf86c9b5a31e65d0f46b869976687727e925624
2013-11-14 02:56:47 +04:00
Edwin Kempin
b0b0bbba71 Allow updating the parent project from the WebUI
This change adds support for updating the parent project of a child
project from the WebUI. This functionality is offered in the
ProjectAccessScreen. When the access rights are changed the user is
also able to change the parent project (if the user has the needed
privileges, means if he is administrator). When the user saves the
new settings only one RPC to the server is done that updates both the
access rights and the parent project property. Technically both
updates are modifications of the 'project.config' file in the
'refs/meta/config' branch. There will be only one commit for this
file that does both updates.

In the UI only valid parent projects are suggested as new parent
project (all projects that would cause a cycle in the line of parent
projects are not suggested).

Bug: issue 1298
Change-Id: Ic63bdb039ea5057a0551138f8fef9ede280b2be3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-13 08:09:32 +01:00
alex.ryazantsev
997b04783a Remove unnecessary semicolons
Change-Id: I7db3f3dd3ae6feee3d28415fc13615e4ac00af50
2013-11-10 05:44:17 +04:00
Shawn Pearce
4c62f72ff4 Merge branch 'stable-2.8'
* stable-2.8:
  Bump SSHD version to 0.9.0.201311081
  Add REST API to toggle starred change state

Change-Id: Ic8d7a1802f6d6319f8f1012f9fe0c7f0c030f60a
2013-11-08 21:36:02 -08:00
Shawn Pearce
d4765db816 Add REST API to toggle starred change state
Tests-by: David Ostrovsky <david@ostrovsky.org>
Change-Id: I4c1da5f7e0a1514e091eaab8c532b356c53f138a
2013-11-08 19:21:45 -08:00
alex.ryazantsev
d215908bae Completed test migration to junit4, easymock updated to version 3.2
Change-Id: I6381045b3dae7133cc3589c5dd20ed977118a83d
2013-11-07 11:22:24 -08:00
David Ostrovsky
0743d8a100 Permission: add getString() method
Change-Id: Ie64d546f9a01348aafe593187373fdd7852e6fa1
2013-11-06 22:40:57 +01:00
Edwin Kempin
a2b2a2703e ChangeScreen2: Add query icon for project
As on the old change screen the project link should link to the
project administration page and there should be a query icon to search
for changes on the project. Clicking on the query icon opens the
default dashboard of the project or if no default dashboard is defined
it queries for the open changes of the project.

This behaviour is consistent with the old change screen so that users
don't get confused.

Bug: issue 2075
Change-Id: I62f87466b60896ecb046e6053f8361405a5c4285
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-29 08:23:29 +01:00
Edwin Kempin
ea62148983 ChangeScreen2: Show download commands defined by plugins
The download commands are returned as part of the FetchInfo of a
revision, but only if the download commands are requested by setting
the option DOWNLOAD_COMMANDS.

This allows to completely customize the download commands on a Gerrit
installation.

This change only effects the download commands that are shown on
ChangeScreen2.

For non-anonymous download commands the username is now again included
into the displayed download commands. Also the HTTP scheme and the
Anonymous HTTP scheme can be used at the same time.

With this change the patch download (base64 & zipped) is still
hard-coded in Gerrit core and does not come from a plugin.

Bug: issue 2116
Change-Id: I8fb21fdeb1a98548ce9027655e1b5e467ee2d27e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-17 11:25:48 +09:00
Luca Milanesio
2531203895 Allow gitweb URLs to be passed unencoded for viewing.
Gerrit composes the viewer URL using information
about the project, branch, file or commit of the
target object to be displayed.

Context:
Typically viewers such as CGit and GitWeb do need
those parts to be encoded, including the '/' in
project names, for being correctly parsed.
However other viewers could instead require
unencoded URL (e.g. GitHub web based viewer).

This patch allows to disable the URL encoding for
allowing GitHub to be used as "gitweb custom viewer"
on top of Gerrit.

Example of GitHub configured as viewer:

[gitweb]
    type = custom
    url = https://github.com/
    project = ${project}
    revision = ${project}/commit/${commit}
    branch = ${project}/tree/${branch}
    fileHistory = ${project}/blog/${branch}/${file}
    linkName = GitHub
    urlEncode = false

Change-Id: Ief59de7eb19def60c5e765c4a495bcac00384d83
2013-10-11 13:08:21 +01:00
Dave Borowitz
23da0d9f13 Miscellaneous Javadoc cleanups to cut down on Eclipse warnings
Change-Id: Ifd80c546641db979911e3339fa40ab3585ca69a1
2013-10-09 12:18:31 -07:00
David Ostrovsky
17d0d337aa ChangeScreen2: mark patch sets with draft comments in revision list
Bug: Issue 2072
Change-Id: I10294b78cd3d832b5b64b146286f9368e12fa87b
2013-10-02 15:24:01 +09:00
Shawn Pearce
0bc486989b Merge changes I105f85bd,I4768e35b
* changes:
  Support copying of approvals if new patch set has no code changes
  Support copying of approvals on trivial rebase
2013-09-27 18:32:48 +00:00
Edwin Kempin
54122d3725 Support copying of approvals if new patch set has no code changes
It can now be configured that all scores for a label are copied
forward when a new patch set is uploaded that has the same parent
commit as the previous patch set and the same code delta as the
previous patch set. This means only the commit message is different.
This can be used to enable sticky approvals on labels that only
depend on the code, reducing turn-around if only the commit message
is changed prior to submitting a change.

E.g. this configuration could be used for the Verified category if
it is only used by an automated tool to express that build and tests
succeed.

Change-Id: I105f85bd28d0bea39a4e16aaebf2630ef1860fbe
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-09-27 20:15:08 +02:00