allow to configure gitlab api retries
Proposal
This mr offers the possibility to configure the retries made to the gitlab API via environment variables.
Two environment variables have been added:
-
SETTINGS__GITLAB_API_MAX_RETRY
- it allows to configure the maximum number of retries
-
SETTINGS__GITLAB_API_MAX_RETRY_INTERVAL
- it controls the interval to wait between each retries
- the
GitlabWithRetries
monkey patch has been edited in order to add a new attribute to this class and use it
Issue the mr tries to solve
Sometimes, when dependabot-gitlab is configured to merge automatically the dependency updates, the automatic merge does not work.
Instead, gitlab returns a 405 method not allowed
(which stops dependabot-gitlab during the dependency update).
I guess it's because we are using our own gitlab-runner (on a private server), which might be slower at creating pipeline than the regular gitlab-runner. So when dependabot-gitlab edits the mr to be merged automatically, the pipeline it not yet created, and so gitlab returns a 405.