Commit 3e911713 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch '250659-allow-users-to-use-production-stage-end-event' into 'master'

Allow users to use IssueDeployedToProduction VSA event

See merge request gitlab-org/gitlab!51199
parents 07a25e27 3a2cce6d
---
title: Allow users to use IssueDeployedToProduction VSA event
merge_request: 51199
author:
type: added
...@@ -11,6 +11,7 @@ module Gitlab ...@@ -11,6 +11,7 @@ module Gitlab
ENUM_MAPPING = { ENUM_MAPPING = {
StageEvents::IssueCreated => 1, StageEvents::IssueCreated => 1,
StageEvents::IssueFirstMentionedInCommit => 2, StageEvents::IssueFirstMentionedInCommit => 2,
StageEvents::IssueDeployedToProduction => 3,
StageEvents::MergeRequestCreated => 100, StageEvents::MergeRequestCreated => 100,
StageEvents::MergeRequestFirstDeployedToProduction => 101, StageEvents::MergeRequestFirstDeployedToProduction => 101,
StageEvents::MergeRequestLastBuildFinished => 102, StageEvents::MergeRequestLastBuildFinished => 102,
...@@ -18,8 +19,7 @@ module Gitlab ...@@ -18,8 +19,7 @@ module Gitlab
StageEvents::MergeRequestMerged => 104, StageEvents::MergeRequestMerged => 104,
StageEvents::CodeStageStart => 1_000, StageEvents::CodeStageStart => 1_000,
StageEvents::IssueStageEnd => 1_001, StageEvents::IssueStageEnd => 1_001,
StageEvents::PlanStageStart => 1_002, StageEvents::PlanStageStart => 1_002
StageEvents::ProductionStageEnd => 1_003
}.freeze }.freeze
EVENTS = ENUM_MAPPING.keys.freeze EVENTS = ENUM_MAPPING.keys.freeze
...@@ -27,8 +27,7 @@ module Gitlab ...@@ -27,8 +27,7 @@ module Gitlab
INTERNAL_EVENTS = [ INTERNAL_EVENTS = [
StageEvents::CodeStageStart, StageEvents::CodeStageStart,
StageEvents::IssueStageEnd, StageEvents::IssueStageEnd,
StageEvents::PlanStageStart, StageEvents::PlanStageStart
StageEvents::ProductionStageEnd
].freeze ].freeze
# Defines which start_event and end_event pairs are allowed # Defines which start_event and end_event pairs are allowed
...@@ -41,7 +40,7 @@ module Gitlab ...@@ -41,7 +40,7 @@ module Gitlab
], ],
StageEvents::IssueCreated => [ StageEvents::IssueCreated => [
StageEvents::IssueStageEnd, StageEvents::IssueStageEnd,
StageEvents::ProductionStageEnd StageEvents::IssueDeployedToProduction
], ],
StageEvents::MergeRequestCreated => [ StageEvents::MergeRequestCreated => [
StageEvents::MergeRequestMerged StageEvents::MergeRequestMerged
......
...@@ -4,13 +4,13 @@ module Gitlab ...@@ -4,13 +4,13 @@ module Gitlab
module Analytics module Analytics
module CycleAnalytics module CycleAnalytics
module StageEvents module StageEvents
class ProductionStageEnd < StageEvent class IssueDeployedToProduction < StageEvent
def self.name def self.name
_("Issue first deployed to production") _("Issue first deployed to production")
end end
def self.identifier def self.identifier
:production_stage_end :issue_deployed_to_production
end end
def object_type 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