requilence / integram

Integrate Telegram into your workflow – Trello, Gitlab, Bitbucket and other bots
https://integram.org
GNU General Public License v3.0
1.54k stars 151 forks source link

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

Open irvinlim opened 4 years ago

irvinlim commented 4 years ago

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:

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!