GitLab Customer Support Operations > Slack

The GitLab Customer Support Operations > Slack Gem is a custom wrapper written to interact with Slack.

For more information (such as Usage), please see:

Installation

Rubygems

gem install gitlab-customer-support-operations_slack

Bundler

Add this to your Gemfile:

gem 'gitlab-customer-support-operations_slack', require 'support_ops_slack'

Then use bundler as usual.

Configuration

Configuration is done through a block that intializes a Client instance:

require 'support_ops_slack'

SupportOps::Slack::Configuration.configure do |config|
  config.url = ENV.fetch('SLACK_URL')
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
‘url` The hook URL to use

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::Slack::Configuration.reset!

Gem Information

  • Ruby version: 3.2.2

  • Dependencies

  • faraday

  • faraday-multipart

  • faraday-retry

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_slack'