Commit 3a2cce6d authored by Pavel Shutsin's avatar Pavel Shutsin

Allow users to use IssueDeployedToProduction VSA event

Can be used while creating custom VSA stages
parent aaeddaa7
---
title: Allow users to use IssueDeployedToProduction VSA event
merge_request: 51199
author:
type: added
......@@ -11,6 +11,7 @@ module Gitlab
ENUM_MAPPING = {
StageEvents::IssueCreated => 1,
StageEvents::IssueFirstMentionedInCommit => 2,
StageEvents::IssueDeployedToProduction => 3,
StageEvents::MergeRequestCreated => 100,
StageEvents::MergeRequestFirstDeployedToProduction => 101,
StageEvents::MergeRequestLastBuildFinished => 102,
......@@ -18,8 +19,7 @@ module Gitlab
StageEvents::MergeRequestMerged => 104,
StageEvents::CodeStageStart => 1_000,
StageEvents::IssueStageEnd => 1_001,
StageEvents::PlanStageStart => 1_002,
StageEvents::ProductionStageEnd => 1_003
StageEvents::PlanStageStart => 1_002
}.freeze
EVENTS = ENUM_MAPPING.keys.freeze
......@@ -27,8 +27,7 @@ module Gitlab
INTERNAL_EVENTS = [
StageEvents::CodeStageStart,
StageEvents::IssueStageEnd,
StageEvents::PlanStageStart,
StageEvents::ProductionStageEnd
StageEvents::PlanStageStart
].freeze
# Defines which start_event and end_event pairs are allowed
......@@ -41,7 +40,7 @@ module Gitlab
],
StageEvents::IssueCreated => [
StageEvents::IssueStageEnd,
StageEvents::ProductionStageEnd
StageEvents::IssueDeployedToProduction
],
StageEvents::MergeRequestCreated => [
StageEvents::MergeRequestMerged
......
......@@ -4,13 +4,13 @@ module Gitlab
module Analytics
module CycleAnalytics
module StageEvents
class ProductionStageEnd < StageEvent
class IssueDeployedToProduction < StageEvent
def self.name
_("Issue first deployed to production")
end
def self.identifier
:production_stage_end
:issue_deployed_to_production
end
def object_type
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueDeployedToProduction do
it_behaves_like 'value stream analytics event'
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment