nextcloud/integration_gitlab

Support multiple gitlab instances?

jas4711 opened this issue ยท 12 comments

Hi! I have an account on gitlab.com and salsa.debian.org, both running gitlab. I can't seem to add more than one account to the nextcloud gitlab integration. Could this functionality be added?

Hello !

I have 2 differents gitlab servers (for 2 companies) and I would like to see both with your app.
I can only add one server in the settings. Is it possible to add a 2 one ? Or more ?

Any news on this?

Any updates? Would be great to see 2 or more servers at once.

Hmm.. This should be quite easy to implement in itself but having only a single dashboard widget for multiple accounts could be somewhat confusing.

Unfortunately, AFAIK, there's no way to currently dynamically spawn dashboard widgets without implementing a separate php class for each one. The related issue at the server repo was closed as stale, unfortunately: nextcloud/server#24658

Maybe there could be a selector for the gitlab instance that is shown? And always show the account with most recent notifications as default? Would this be satisfactory, until we get support for multiple dashboard widgets?

Yes I think some UX stuff in the dashboard widget would be acceptable meanwhile.

I think it should be possible to spawn multiple widgets dynamically -- in my use-case, the work focus mostly overlap so I don't care if I see gitlab.com and salsa.debian.org gitlab issues on the same widget, but in some use-cases you really don't want that overlap.

Another ugly workaround would be to actually add a couple of numbered classes, so you add a PHP class gitlab-widget-1, gitlab-widget-2, gitlab-widget-3, etc... and then disable the unused classes for display. I reckon supporting five instance through this mechanism would be sufficient for most use-cases.

This would be much better than nothing/now.
Some remarks I have:

  1. Is it worth to code that, if there will be support for multiple instances per widget class in the future?
  2. If there are plans to integrate #68 it must be ensured, that no hidden notifications will be deleted there.
  3. When will the selector be triggered?
  • During cron?
  • Each removing off a notification?
  • Just on page (re-)loading?
  • On a separate reload button on the widget?

Oh, with the selector, I just meant a UX switch/buttons to switch the visible account. In this case, mark all visible as read would only apply to those notifications that are shown at the time. At each reload of the page the shown account would default to the one with the most recent notification.

Regarding defining a finite amount of widget classes, we actually had a discussion about using anonymous classes, as well, as that would avoid quite a bit of duplicate code. But anon classes also cannot be spun up dynamically so it's still "hacky". Aliases would be an even more risky solution but even that creates its own trouble with session handling. Enabling this by design at the server repo side is just the right way to go, IMHO.

I'll try and find some time to implement multiple accounts/instances some time soon -- I'll keep you updated.

Oh, with the selector, I just meant a UX switch/buttons to switch the visible account...

Thanks for clarification!

Enabling this by design at the server repo side is just the right way to go, IMHO.

Then I hope, that it will be implemented rather sooner then later. :-)

@kyteinsky could you please look into a rough effort estimate for this feature request?

hey, the search provider functionality can be easily extended but Nextcloud does not support adding multiple dashboard widgets dynamically. If that is acceptable, it is a 2-day work tops.

Or as Sami said above, hacky solutions could make that possible, or with an account selector. Then maybe 3 days of work should do.

Thanks for giving a pragmatic plan with different scopes to chose from, really appreciated. We will schedule this for the development cycle of Nextcloud 30