requilence/integram

GitLab notification settings cannot be loaded on self-hosted GitLab instances

irvinlim opened this issue · 0 comments

I'm running a self-hosted GitLab instance and a self-hosted Integram bot.

When I use the /settings command on a GitLab bot and make some changes (e.g. CI.Success = true), this setting is not loaded correctly when the webhook handler is fired.

I narrowed down the cause to a bug in getServiceID() for this particular case:

  • In webhookHandler
    • getServiceID() returns gitlab_mydomain_com
  • In settingsKeyboardPressed
    • getServiceID() returns gitlab

Because of this, c.Chat.Settings(&s) returns different values depending on whether a webhook is received or the keyboard button is pressed for tuning the settings.

The underlying cause is because SetServiceBaseURL() is not called in settingsKeyboardPressed because there is no webhook base URL to set.

I'm not too familiar with the rationale behind a dynamic ServiceBaseURL that changes with each request. Does it make sense to pass an environment variable allows me to define the default base URL for the particular bot instance? Or when tuning the settings, I should be able to pass in a base URL?

Thanks!