Multiple accounts / Settings per project
Opened this issue ยท 20 comments
Allow adding multiple gerrit accounts: for example
account for review.openstack.org and separate account for review.gerrithub.io
How would you like to configure multiple accounts?
One account per IntelliJ project would be enough?
As for me, this approch would be enough. But ability to add multiple gerrit repositories once might be even better.
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.
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.
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.
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.
This looks good
I like the proposed implementation. Do you have any idea when this might be implemented?
This is must have!
Excellent proposal for the implementation. Any idea as to when this might be implemented?
@uwolfer great proposal!!! That'll be very useful for us (5 gerrit accounts to manage). Any idea for the implementation date?
@gleasonp & @leialexisjiang: Nope, not an idea when this will be implemented. I'd be happy to review any pull request which implements this feature.
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
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 ?
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.
Proposal for an alternative, less intrusive approach to solve the "multiple accounts" part of this feature request: #401
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 #159 (comment): Maintain a set of Gerrit server settings in the global project settings, but assign one or more or them to projects, defaulting to none.
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.
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?
For testing:
gerrit-intellij-plugin-1.2.6-203.zip
Keep in mind this is based on the intellij2020.3 branch