992 Commits

Author SHA1 Message Date
Shawn Pearce
4aba6912cc Switch to the xsiframe GWT linker
This will be the default in a future version of GWT.  It is not
compatible with Gerrit's hacky server side selector.  Get rid of
the hacky server selection and run only the stock code.

The new linker selection is compatible with Super Dev Mode.

Change-Id: I26c2ed184b6f336d4f964732023aa81d647a5e7c
2014-03-07 18:14:09 +00:00
Saša Živkov
626c731633 Add extension point to register JGit PostReceiveHooks
Plugins may want to get notified when a pack file is received.
For example, the quota plugin may want to cache the repository
size in the file system and update it every time a new pack is
received.

Change-Id: I0212eab6e4867819ebe7ecc7fc5532c26bb82282
2014-03-05 16:05:26 +01:00
Saša Živkov
779ede73cd Move ReceivePackInitializer to the proper package
Change-Id: I9bc00c5ee76b6cf6fd7c2d083bfb180334beffcb
2014-02-24 16:15:27 +01:00
Dave Borowitz
86caf9ec23 Support pagination using offsets instead of sortkey
We cannot guarantee that secondary index implementations (particularly
the one used by googlesource.com) can efficiently paginate based on
the sortkey, and in particular can both sort and reverse sort on the
same field. This particular performance issue notwithstanding,
searching is now generally fast enough that it is feasible just to
skip the first N results when doing pagination.

Add an option S= to QueryChanges to support starting at a nonzero
offset. Note that we still have to fetch n+S results from the index in
order to do visibility filtering, since if we skipped at the index
layer we wouldn't know how many of the skipped elements would have
matched later filtering.

Drop the sortkey token suffix from the legacy anchor parser; there is
no reliable way to convert it to an offset, and it's unlikely that
users have permalinks to specific sortkey values.

On the server side, remove the sortkey field from the current index
version, and use pagination by offset instead of sortkey in the new
version only.

Continue to support sortkey queries against old index versions, to
support online reindexing while clients have an older JS version.

Change-Id: I6a82965db02c4d534e2107ca6ec91217085124d6
2014-02-12 13:51:26 -08:00
Edwin Kempin
f94e9bb866 Fix validation of plugin capability on REST view that handles PUT on collection
If a plugin has a REST collection that accepts PUT requests and the
REST view that handles these PUT requests is annotated with
@RequiresCapability to require a plugin capability then the validation
of this capability in Gerrit core fails since the plugin name is not
forwarded to the capability check. Because of the missing plugin name
the capability check is looking for a Gerrit core capability although
it should check for a plugin capability.

Change-Id: I9779bd04b4b849bd8c3646a3e226b07faf3e9cc3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-02-07 10:47:16 +01:00
Shawn Pearce
ce290b9dc1 Merge "Add extension point for receive-pack initialization." 2014-01-31 22:32:39 +00:00
Saša Živkov
ec85a070b3 Add extension point for receive-pack initialization.
Plugins can register ReceivePackInitializer's in order to provide custom
initialization of the ReceivePack instance. For example, the quota plugin
may use this extension point to set the maximum allowed pack size based
on its quota configuration and the disk space occupied by that project.

Change-Id: I8d6e7d4bb75099b0fa5f6968ae5371883bf865ee
2014-01-31 16:38:13 +01:00
Edwin Kempin
42d89529d8 Support AcceptsPost for RestCollections in plugins
If a RestCollection in a plugin implements AcceptsPost POST requests
for it currently fail with Not Found.

Change-Id: I6db50cbe08c5ec53dac727d90af58fbe4538dbcf
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-01-29 21:25:24 +01:00
Dave Borowitz
68a55b9074 Use Java 7 StandardCharsets instead of Guava Charsets
Replace with static imports since the class name is so much longer.

Change-Id: If2cdede62a0977db05db69b4c9ec88bd980e011f
2014-01-27 16:59:31 -08:00
David Ostrovsky
e01d9b7f20 Bump Jetty version to stable 9.1 and Servlet API to 3.1
Change-Id: Ic6a374afa978e66ec1a04a2b39801da158ba31d7
2014-01-04 22:28:10 +01: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
Dave Borowitz
fcb204627b Only construct ChangeResources via ChangesCollection.parse
In a notedb world we would like to slurp all information about a
change from the git-based storage as soon as a ChangeResource is
constructed, which will involve extra work in this parse, analogous to
how parse currently validates the change permissions.

Preserve the ability to pass in a particular ChangeControl object,
since various callers have specific requirements like reusing the
control elsewhere, or using a control for a different user.

Change-Id: Ia7c9761ef92bb8f05ae3323210babaa02b0dbe6f
2013-12-17 16:03:16 -08:00
Colby Ranger
79d4ebec49 Include roottree and file in the GitWebConfig.
Change-Id: Ia33da71d36346a13b0993fef87cd86de3ffdc560
2013-12-16 14:19:18 -08:00
Shawn Pearce
ec51eba12b Merge "Replace PatchDetailService saveDraft and deleteDraft" 2013-12-12 20:09:47 +00:00
Dave Borowitz
31b599b40f Move "refs/..." constants to a RefNames class
This class lives in gerrit-reviewdb because "refs/changes/" needs to be
referenced from PatchSet in reviewdb/client (and other UI classes).

Rename constants to all use REFS_* instead of being inconsistent.

Change-Id: I76e6ee7e63a4549b51a43698fb50b54a19dabfc6
2013-12-11 12:41:07 -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
David Pursehouse
6a5850e3d0 "Report Bug" URL can never be null
The config provider will always provide a value.  Either the
value given by the user in gerrit.config, or the default value.

Change-Id: I9b7107857c79f939ed5315e52610277b05ef7d67
2013-12-10 17:06:21 +09:00
Shawn Pearce
b74e0e34b3 Replace PatchDetailService saveDraft and deleteDraft
Change-Id: Ia3bafdd87a7760b52a153fa8ebdcafd9152d53e5
2013-12-09 12:30:12 -08:00
Shawn Pearce
cb8fc9b4b5 Merge branch 'stable-2.8'
* stable-2.8:
  AllRequestFilter: delegate to the filters for init and destroy phases too
2013-12-09 09:57:38 -08:00
David Ostrovsky
3affee0141 AllRequestFilter: delegate to the filters for init and destroy phases too
It is not sufficient only to dispatch doFilter() methods. To initialize and
destroy filters, init() and destroy() methods must be honored.

Change-Id: I5b87583a212c4dc854cf205f2a57125b713736cb
2013-12-09 10:55:56 +00: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
Dariusz Luksza
357a242708 Enable standalone JavaScript plugins
The idea of 'standalone JavaScript plugins' came during the 'JavaScript
plugins' talk at the Gerrit User Summit.

The main concept is to automatically install and expose all *.js files
that are in Gerrit's plugins/ directory.  This should lower the entry
point barrier for JS developers.

There is one limitation of such plugins: they cannot contribute
additional resources.  When such are required, the implementer should
inline them in JS code or use the gerrit-plugin-js-archetype.

Change-Id: Ibad8c3938c0855fcabe6937fd8b4d508a9a2eac3
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2013-12-07 18:01:54 +01: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
4cb50ad3a5 Merge "Replace 'indexOf()' expression with 'contains()'" 2013-12-06 06:54:42 +00:00
Matt Baker
d62b60e13b use variable instead of calculating again and use final
Change-Id: I04ea7c1940a5f4c6a4cf990a520a877eec065404
2013-12-05 21:22:08 -07:00
Matt Baker
c7dbfed9f0 Replace 'indexOf()' expression with 'contains()'
Change-Id: Ida566a24d78174690b11d758c769b1d559b7fae9
2013-12-05 21:13:38 -07: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
87a8c5938e Remove unused variable in ProjectAccessFactory
Change-Id: Ib0c58d71164e976f85b8fff6462ed1e5a221f773
2013-12-05 09:53:04 -08:00
Dave Borowitz
8d2ab515cb Fix various unchecked warnings
Checked type inference has changed slightly in Java 7, so many of the
suppressions are no longer necessary.

Change-Id: I73585e888b8204429ea67c8f4822d81d4dad8c46
2013-12-05 09:11:11 -08:00
Shawn Pearce
d0414f2eda Merge "Hyperlink to groups in access editor" 2013-12-04 22:57:23 +00:00
Colby Ranger
faef658f38 Include addReviewer in ChangeApi.
Also, update the PostReviewers.Input to be named AddReviewerInput.

Change-Id: Ide60a3f261d59a3af988d94c3c1bdbd1dcfdcd79
2013-12-04 13:56:05 -08:00
Shawn Pearce
8eb4eb75ba Merge changes I14c49cb4,I12d17fe1
* changes:
  Inject ChangeUtil, making most methods non-static
  Inject ApprovalsUtil in more places
2013-12-04 00:36:20 +00:00
Shawn Pearce
2a2bfa483b Merge "Replace 'indexOf()' expression with 'contains()'" 2013-12-03 23:59:21 +00: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
Dave Borowitz
ef6cca84cb Inject ChangeUtil, making most methods non-static
Change-Id: I14c49cb4a0b9829d751ea96cd2d909f234654508
2013-12-03 15:08:54 -08:00
alex.ryazantsev
db721d46f0 Replace 'indexOf()' expression with 'contains()'
Change-Id: I10a5ed7c813af7ab40707369bf4c1953c030b10d
2013-12-04 01:15:19 +04:00
alex.ryazantsev
05872efbbd Replace 'for' loop with 'foreach'
Change-Id: I5ca01d678b8cf9e9fc75b21270329b483e31694e
2013-12-04 01:02:53 +04:00
Edwin Kempin
70259293e7 Update mergeability flag when access rights are saved for review
Change-Id: If38083bc5c815c510a25da196d8b9ac98505bd42
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-12-03 08:55:44 +01:00
Shawn Pearce
f43e915c5d Move system groups into their own backend
Delete 'Anonymous Users', 'Registered Users', 'Project Owners' and
'Change Owner' from the database and account_groups table.  Define
them inside of a specialized SystemGroupBackend class.

Change-Id: Ia67add4630579f3d0ce25edcfd662bbcf918dc8f
2013-12-02 11:36:27 -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
da07edd370 Merge "Delete SQL index support" 2013-11-29 20:48:26 +00: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
Edwin Kempin
a7e04e4eea Merge "Fix unclosed resource warnings" 2013-11-29 19:35:12 +00: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