GitLab Customer Support Operations > GitLab
The GitLab Customer Support Operations > GitLab Gem is a custom wrapper written to interact with GitLab.
For more information (such as Usage), please see:
Installation
Rubygems
gem install gitlab-customer-support-operations_gitlab
Bundler
Add this to your Gemfile:
gem 'gitlab-customer-support-operations_gitlab', require 'support_ops_gitlab'
Then use bundler as usual.
Configuration
Configuration is done through a block that intializes a Client instance:
require 'support_ops_gitlab'
SupportOps::GitLab::Configuration.configure do |config|
config.url = 'https://gitlab.example.com/api/v4'
config.token = 'abc123'
end
There are several attributes that can be used in the block for your setup:
Attribute | Meaning |
---|---|
‘retry_backoff` | A multiplier applied to the retry_interval after each retry attempt, causing exponential backoff. Defaults to 2 |
‘retry_exceptions` | Specifies which types of exceptions or errors should trigger the retry mechanism. |
‘retry_interval` | The base time interval (typically in seconds or milliseconds) between retry attempts. Defaults to 1 |
‘retry_max` | The maximum number of retry attempts that will be made when an operation fails. Defaults to 5 |
‘retry_randomness` | Adds a random element to the retry interval to prevent “thundering herd” problems where many systems retry simultaneously. Defaults to 0.5 |
‘token` | The token to use for authentication |
‘url` | The API url to connect to, it should alwaus be in the format of ‘YOUR_DOMAIN/api/v4’ (note the lack of a trailing /) |
Removing a configuration
If during the use of the gem you need to remove a setup configuration (and client), you can call a reset!
on it:
SupportOps::GitLab::Configuration.reset!
Gem Information
-
Ruby version:
3.2.2
-
Dependencies
-
activesupport
-
cgi
-
concurrent-ruby
-
digest
-
erb
-
faraday
-
faraday-multipart
-
faraday-retry
-
json
-
oj
-
yaml
Localized testing
You can create a script that includes the local files (instead of requiring the gem itself) this at the top:
require_relative './lib/support_ops_gitlab'