Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple accounts / Settings per project #159

Open
dratushnyy opened this issue Mar 31, 2015 · 20 comments
Open

Multiple accounts / Settings per project #159

dratushnyy opened this issue Mar 31, 2015 · 20 comments

Comments

@dratushnyy
Copy link

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

@uwolfer
Copy link
Owner

uwolfer commented Mar 31, 2015

How would you like to configure multiple accounts?

One account per IntelliJ project would be enough?

@ohhmm
Copy link

ohhmm commented Apr 2, 2015

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

@uwolfer
Copy link
Owner

uwolfer commented Apr 2, 2015

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.

@ohhmm
Copy link

ohhmm commented Apr 3, 2015

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.

@ymaraner
Copy link

ymaraner commented Feb 8, 2016

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.

@uwolfer
Copy link
Owner

uwolfer commented Feb 12, 2016

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.

@ohhmm
Copy link

ohhmm commented Feb 15, 2016

This looks good

@ymaraner
Copy link

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

@dburnazyan
Copy link

This is must have!

@gleasonp
Copy link

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

@leialexisjiang
Copy link

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

@uwolfer
Copy link
Owner

uwolfer commented Aug 7, 2018

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

@ronindev
Copy link

ronindev commented Feb 15, 2019

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

@ewaldbenes
Copy link

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 ?

@leonard84
Copy link
Contributor

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.

@leoluk
Copy link

leoluk commented Mar 24, 2021

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

@kriegaex
Copy link

kriegaex commented Aug 3, 2021

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.

@videogameaholic
Copy link

videogameaholic commented May 13, 2023

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.

@uwolfer
Copy link
Owner

uwolfer commented May 15, 2023

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?

@videogameaholic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.