Skip to content
Snippets Groups Projects
Commit 59a796ba authored by Shinya Maeda's avatar Shinya Maeda :two:
Browse files

Merge branch '356197-continuous-verification-cmau-instrumentation-mvc-2' into 'master'

Resolve "Continuous Verification CMAU Instrumentation MVC"

See merge request !91925
parents dc1cb0d1 0857a78e
No related branches found
No related tags found
1 merge request!91925Resolve "Continuous Verification CMAU Instrumentation MVC"
Pipeline #583964320 failed
Pipeline: GitLab

#583965375

    ......@@ -1135,6 +1135,14 @@ def track_deployment_usage
    Gitlab::Utils::UsageData.track_usage_event('ci_users_executing_deployment_job', user_id) if user_id.present? && count_user_deployment?
    end
    def track_verify_usage
    Gitlab::Utils::UsageData.track_usage_event('ci_users_executing_verify_environment_job', user_id) if user_id.present? && count_user_verification?
    end
    def count_user_verification?
    has_environment? && environment_action == 'verify'
    end
    def each_report(report_types)
    job_artifacts_for_types(report_types).each do |report_artifact|
    report_artifact.each_blob do |blob|
    ......
    ......@@ -40,6 +40,7 @@ def process_build(build)
    BuildHooksWorker.perform_async(build)
    ChatNotificationWorker.perform_async(build.id) if build.pipeline.chat?
    build.track_deployment_usage
    build.track_verify_usage
    if build.failed? && !build.auto_retry_expected?
    ::Ci::MergeRequests::AddTodoWhenBuildFailsWorker.perform_async(build.id)
    ......
    ---
    key_path: redis_hll_counters.ci_users.ci_users_executing_verify_environment_job_monthly
    description: Monthly counts of times users have executed verify jobs
    product_section: ops
    product_stage: release
    product_group: release
    product_category: continuous_delivery
    value_type: number
    status: active
    milestone: "15.2"
    introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91925
    time_frame: 28d
    data_source: redis_hll
    data_category: optional
    instrumentation_class: RedisHLLMetric
    performance_indicator_type: []
    options:
    events:
    - ci_users_executing_verify_environment_job
    distribution:
    - ce
    - ee
    tier:
    - free
    - premium
    - ultimate
    ---
    key_path: redis_hll_counters.ci_users.ci_users_executing_verify_environment_job_weekly
    description: Weekly counts of times users have executed verify jobs
    product_section: ops
    product_stage: release
    product_group: release
    product_category: continuous_delivery
    value_type: number
    status: active
    milestone: "15.2"
    introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91925
    time_frame: 7d
    data_source: redis_hll
    data_category: optional
    instrumentation_class: RedisHLLMetric
    performance_indicator_type: []
    options:
    events:
    - ci_users_executing_verify_environment_job
    distribution:
    - ce
    - ee
    tier:
    - free
    - premium
    - ultimate
    ......@@ -3,3 +3,8 @@
    redis_slot: ci_users
    aggregation: weekly
    feature_flag:
    - name: ci_users_executing_verify_environment_job
    category: ci_users
    redis_slot: ci_users
    aggregation: weekly
    feature_flag:
    ......@@ -1554,6 +1554,32 @@
    end
    end
    describe '#count_user_verification?' do
    subject { build.count_user_verification? }
    context 'when build is the verify action for the environment' do
    let(:build) do
    create(:ci_build,
    ref: 'master',
    environment: 'staging',
    options: { environment: { action: 'verify' } })
    end
    it { is_expected.to be_truthy }
    end
    context 'when build is not the verify action for the environment' do
    let(:build) do
    create(:ci_build,
    ref: 'master',
    environment: 'staging',
    options: { environment: { action: 'start' } })
    end
    it { is_expected.to be_falsey }
    end
    end
    describe '#expanded_environment_name' do
    subject { build.expanded_environment_name }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment