Expand group names to be 255 characters
I was surprised by unexpected server failures when creating a new group with a fairly long name. The root cause was the db rejected the value because it was more than 40 characters. So expand our column to 255, like project names. 40 is just not a reasonable restriction, and we had no good reason for it. While doing this I discovered we weren't fully using the new AccountGroupName object right, e.g. the schema creator didn't create it for the 3 default groups, and query logic was using the unindexed account_groups.name column, not the indexed name in account_group_names. So fix all of that. Change-Id: If1cb7abbde07df65ebbfdf851faed5e857707209 Signed-off-by: Shawn O. Pearce <sop@google.com> Reviewed-by: Nico Sallembien <nsallembien@google.com>
This commit is contained in:
@@ -16,7 +16,7 @@ package com.google.gerrit.client.ui;
|
||||
|
||||
import com.google.gerrit.client.RpcStatus;
|
||||
import com.google.gerrit.client.rpc.GerritCallback;
|
||||
import com.google.gerrit.reviewdb.AccountGroup;
|
||||
import com.google.gerrit.reviewdb.AccountGroupName;
|
||||
import com.google.gwt.user.client.ui.SuggestOracle;
|
||||
import com.google.gwtexpui.safehtml.client.HighlightSuggestOracle;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class AccountGroupSuggestOracle extends HighlightSuggestOracle {
|
||||
RpcStatus.hide(new Runnable() {
|
||||
public void run() {
|
||||
SuggestUtil.SVC.suggestAccountGroup(req.getQuery(), req.getLimit(),
|
||||
new GerritCallback<List<AccountGroup>>() {
|
||||
public void onSuccess(final List<AccountGroup> result) {
|
||||
new GerritCallback<List<AccountGroupName>>() {
|
||||
public void onSuccess(final List<AccountGroupName> result) {
|
||||
final ArrayList<AccountGroupSuggestion> r =
|
||||
new ArrayList<AccountGroupSuggestion>(result.size());
|
||||
for (final AccountGroup p : result) {
|
||||
for (final AccountGroupName p : result) {
|
||||
r.add(new AccountGroupSuggestion(p));
|
||||
}
|
||||
callback.onSuggestionsReady(req, new Response(r));
|
||||
@@ -46,9 +46,9 @@ public class AccountGroupSuggestOracle extends HighlightSuggestOracle {
|
||||
|
||||
private static class AccountGroupSuggestion implements
|
||||
SuggestOracle.Suggestion {
|
||||
private final AccountGroup info;
|
||||
private final AccountGroupName info;
|
||||
|
||||
AccountGroupSuggestion(final AccountGroup k) {
|
||||
AccountGroupSuggestion(final AccountGroupName k) {
|
||||
info = k;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user