Skip to content

Snowplow admin settings should be required if Snowplow it's enabled

If an application has SnowPlow enabled through Admin > Settings > Integration, but it does not have any information on Collector URI, Site ID, Cookie Domain, Gitlab::SnowplowTracker will crash as it won't have any values to work with:

ParamContractError - Contract violation for argument 1 of 1:
        Expected: String,
        Actual: nil
        Value guarded in: SnowplowTracker::Emitter::initialize
        With Contract: String, And => Proc
        At: /Users/mayra_cabrera/.rvm/gems/ruby-2.6.3/gems/snowplow-tracker-0.6.1/lib/snowplow-tracker/emitters.rb:50 :
  ee/lib/gitlab/snowplow_tracker.rb:27:in `emitter'
  ee/lib/gitlab/snowplow_tracker.rb:19:in `tracker'
  ee/lib/gitlab/snowplow_tracker.rb:11:in `track_event'
  ee/app/services/epics/issue_promote_service.rb:27:in `track_event'
  ee/app/services/epics/issue_promote_service.rb:20:in `execute'
  ee/lib/ee/gitlab/quick_actions/issue_actions.rb:45:in `block (2 levels) in <module:IssueActions>'
  lib/gitlab/quick_actions/command_definition.rb:92:in `execute_block'
  lib/gitlab/quick_actions/command_definition.rb:55:in `execute'

Steps to reproduce

  1. Enable SnowPlow on Application Settings > Integrations, do not fill any other information:

Screen_Shot_2019-07-29_at_3.50.23_PM

  1. Promote an issue to an epic through a quick command /promote
  2. Error above is registered ^

Screen_Shot_2019-07-29_at_3.57.29_PM