Issue 3682: Plugin list shows settings icon for reviewer plugin even though the plugin has no settings screen
Status:  Released
Owner: ----
Closed:  Nov 19
Project Member Reported by david.pu...@sonymobile.com, Nov 16, 2015
*****************************************************************
*****                                                       *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!!  *****
*****                                                       *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD,  *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
*****                                                       *****
*****   THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS     *****
*****                                                       *****
*****************************************************************

Affected Version: 2.11.5

What steps will reproduce the problem?
1. Build reviewers plugin latest stable-2.11 and install in 2.11.5
2. Go to the plugin list screen
3. Click on the reviewers plugins gear icon in the settings column

What is the expected output? What do you see instead?

"The page you requested was not found, or you do not have permission to view this page." is displayed.

As far as I can see, the reviewers plugin does not have a settings screen.  It's not clear if the problem is in Gerrit or if the plugin is doing something else that causes the icon to incorrectly appear.

Please provide any additional information below.


Nov 19, 2015
Project Member #1 David.Os...@gmail.com
It has something to do how setting page is discovered, if plugin provides it or not.
For exampple we have this logic in serviseuser plugin

public class ServiceUserPlugin extends PluginEntryPoint {
  public static final Resources RESOURCES = GWT.create(Resources.class);

  @Override
  public void onPluginLoad() {
    Plugin.get().screen("create", new CreateServiceUserScreen.Factory());
    Plugin.get().screen("settings", new ServiceUserSettingsScreen.Factory());
    Plugin.get().screen("list", new ServiceUserListScreen.Factory());
    Plugin.get().screenRegex("user/(.*)", new ServiceUserScreen.Factory());
  }
}

and this what happens in Reviewers plugin:

public class ReviewersPlugin extends PluginEntryPoint {
  @Override
  public void onPluginLoad() {
    Plugin.get().screenRegex(".*", new ReviewersScreen.Factory());
  }
}

The logic in PluginLitScreen is trying to match:

        if (new ExtensionScreen(plugin.name() + "/settings").isFound()) {
          InlineHyperlink adminScreenLink = new InlineHyperlink();
          adminScreenLink.setHTML(new ImageResourceRenderer().render(Gerrit.RESOURCES.gear()));
          adminScreenLink.setTargetHistoryToken("/x/" + plugin.name() + "/settings");
          adminScreenLink.setTitle(Util.C.pluginSettingsToolTip());
          table.setWidget(row, 2, adminScreenLink);
        }

and renders the icon.

The problem with reviewers plugin, that it's genric one with URLs like:

* http://gerrit/#/x/reviewers/<p>

where p is a project name, so that when settings would be a valid project name, than we would have a collision. So may be we should just route the actual plugin per project setting to:

* http://gerrit/#/x/reviewers/p/<p>

and only bind:

Plugin.get().screenRegex("p/(.*)", new ReviewersScreen.Factory());

Status: Accepted
Cc: -David.Os...@gmail.com edwin.ke...@gmail.com
Nov 19, 2015
Project Member #2 David.Os...@gmail.com
https://gerrit-review.googlesource.com/72579
Status: ChangeUnderReview
Cc: -edwin.ke...@gmail.com
Nov 19, 2015
Project Member #3 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released