gerrit-intellij-plugin icon indicating copy to clipboard operation
gerrit-intellij-plugin copied to clipboard

Multiple accounts / Settings per project

Open dratushnyy opened this issue 9 years ago • 20 comments

Allow adding multiple gerrit accounts: for example account for review.openstack.org and separate account for review.gerrithub.io

dratushnyy avatar Mar 31 '15 12:03 dratushnyy

How would you like to configure multiple accounts?

One account per IntelliJ project would be enough?

uwolfer avatar Mar 31 '15 19:03 uwolfer

As for me, this approch would be enough. But ability to add multiple gerrit repositories once might be even better.

ohhmm avatar Apr 02 '15 09:04 ohhmm

I think the user interface would need a massive refactoring in order to allow multiple Gerrit servers in one project. If you have any ideas how this could look like, please let me know.

uwolfer avatar Apr 02 '15 20:04 uwolfer

I'd added listbox for multiple Gerrit urls and '+', '-' buttons after 'Test' button. Select an item could fill text fields. Any project could be searched on all gerrits. Link to the gerrit could be specified in pachset details text field, but we still have open in gerrit though. When submitting to review, If more then one gerrits where the project hosted then we need to select.

ohhmm avatar Apr 03 '15 04:04 ohhmm

One server/account per IntelliJ project(or module) would be a great improvement and would probably satisfy most requirements. I would think that moving the gerrit configuration into the project settings or creating a gerrit facet at the module level would make this possible.

Please don't put off that level of integration for a redesign of the UI to support multiple accounts per project.

ymaraner avatar Feb 08 '16 14:02 ymaraner

I have thought a bit about this feature request. Would be nice if you could comment if my proposal makes sense for you.

At the moment, all Gerrit settings are application global (i.e. for all projects) used. This makes it impossible to use different Gerrit instances for different projects. I think it would make sense to move settings "Host", "Username" and "Password" (in current fieldset "Login") to project scope. All other settings (in current fieldset "Settings") could stay in application scope (UI should show a hint for that). Except that additional hint, the UI does not need any changes.

One disadvantage of this change is, that users with multiple clones of the same project need to enter login information for every (new) project.

Migration: I think it would make sense to transfer the current login settings to every project automatically when no project level settings are available. Then users can change it if they need to.

uwolfer avatar Feb 12 '16 15:02 uwolfer

This looks good

ohhmm avatar Feb 15 '16 10:02 ohhmm

I like the proposed implementation. Do you have any idea when this might be implemented?

ymaraner avatar Apr 14 '16 11:04 ymaraner

This is must have!

dburnazyan avatar Jun 29 '16 10:06 dburnazyan

Excellent proposal for the implementation. Any idea as to when this might be implemented?

gleasonp avatar Feb 16 '18 16:02 gleasonp

@uwolfer great proposal!!! That'll be very useful for us (5 gerrit accounts to manage). Any idea for the implementation date?

leialexisjiang avatar Aug 07 '18 06:08 leialexisjiang

@gleasonp & @leialexisjiang: Nope, not an idea when this will be implemented. I'd be happy to review any pull request which implements this feature.

uwolfer avatar Aug 07 '18 19:08 uwolfer

Any news about that issue? It would be great to have the ability to disable the plugin for arbitrary projects. https://stackoverflow.com/questions/54693239/how-to-make-plugin-enabled-only-at-specific-projects#comment96179120_54693239

ronindev avatar Feb 15 '19 12:02 ronindev

I have the need for the same feature. We have multiple Gerrit servers because of a company organization fusion.

I had a brief look into the setting persisting source part. As far as I can think of an implementation it seems to be a lot easier to make the URL, user, etc. settings simply on a per-project scope instead of overwriting global settings.

@uwolfer presented use case of cloning the same project multiple times (with Git I never do it because I have all the nice features of Git anyway) seems to be less common IMO than the following. A more standard use case, I can think of, may be a company (dev) with a couple of separate repos all going to the same Gerrit like the AOSP. Actually we have it. I need to configure a handful of them.

For the beginning I could easily live with the per-project setting instead of no option at all (like now, except manullay switching back and forth which is unfeasible).

I would propose doing the simple approach first and look over the time if there are enough people wanting the "advanced" settings feature.

What do you think @uwolfer @gleasonp @dratushnyy ?

ewaldbenes avatar Mar 12 '19 17:03 ewaldbenes

At the moment, all Gerrit settings are application global (i.e. for all projects) used. This makes it impossible to use different Gerrit instances for different projects. I think it would make sense to move settings "Host", "Username" and "Password" (in current fieldset "Login") to project scope. All other settings (in current fieldset "Settings") could stay in application scope (UI should show a hint for that). Except that additional hint, the UI does not need any changes.

Other Plugins save the server settings globally, but you can select which server to use for each project, e.g. SonarLint plugin. This avoids having to reconfigure the servers for each project. Furthermore, "push commits to gerrit by default" should be a project setting, currently it also affects non-gerrit projects this might be mitigated when no gerrit server is selected.

leonard84 avatar Jul 01 '20 17:07 leonard84

Proposal for an alternative, less intrusive approach to solve the "multiple accounts" part of this feature request: #401

leoluk avatar Mar 24 '21 16:03 leoluk

Transferring over the content of #421, which is quite similar in scope, so we can discuss everything in one place and not have quasi duplicates:

I work on dozens of IDEA projects and need Gerrit only for a single one, a forked Eclipse project. Even there, I only need it when contributing one of my bugfixes to the upstream project because Eclipse requires PRs in Gerrit. Nevertheless, the Gerrit plugin always tries to connect to the server when starting the IDE or re-opening unrelated projects. It also shows me notifications about pending reviews completely out of context in projects not using Gerrit. This becomes even more useless when I get curious, opening the Gerrit view, but seeing nothing of course, due to the fact that 99% of my projects do not use Gerrit and my pending reviews etc. are only displayed when I open the right project with the right Git connection.

I think that this is a design flaw. Gerrit server URLs and credentials should be per project, so that the plugin does not do anything when the corresponding project does not use Gerrit but e.g. GitHub or whatever SCM. And what if two different OSS or commercial projects use different Gerrit servers, for example one company server and one OSS one for Eclipse?


Other than that, I agree with @leonard84 in https://github.com/uwolfer/gerrit-intellij-plugin/issues/159#issuecomment-652547589: Maintain a set of Gerrit server settings in the global project settings, but assign one or more or them to projects, defaulting to none.

kriegaex avatar Aug 03 '21 01:08 kriegaex

Opened pull request #480 to address this issue. This does not allow multiple Gerrit servers per project, but does allow one Gerrit server per project which seems to be sufficient for most commenters in this thread.

videogameaholic avatar May 13 '23 02:05 videogameaholic

Thanks a lot @videogameaholic.

Is there somebody around who could test this pull request if migration with an existing setup works as expected, and also if it works as expected? Probably @videogameaholic could provide pre-built binaries if somebody is willing to test?

uwolfer avatar May 15 '23 17:05 uwolfer

For testing: gerrit-intellij-plugin-1.2.6-203.zip Keep in mind this is based on the intellij2020.3 branch

videogameaholic avatar May 18 '23 00:05 videogameaholic