Commit 2291244b authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '202094-enable-ff-by-default' into 'master'

Enable VSM feature flag for code stage by default

Closes #202094

See merge request gitlab-org/gitlab!26885
parents 180ac475 58426e44
...@@ -52,12 +52,12 @@ module Issues ...@@ -52,12 +52,12 @@ module Issues
end end
def store_first_mentioned_in_commit_at(issue, merge_request) def store_first_mentioned_in_commit_at(issue, merge_request)
return unless Feature.enabled?(:store_first_mentioned_in_commit_on_issue_close, issue.project) return unless Feature.enabled?(:store_first_mentioned_in_commit_on_issue_close, issue.project, default_enabled: true)
metrics = issue.metrics metrics = issue.metrics
return if metrics.nil? || metrics.first_mentioned_in_commit_at return if metrics.nil? || metrics.first_mentioned_in_commit_at
first_commit_timestamp = merge_request.commits(limit: 1).first&.date first_commit_timestamp = merge_request.commits(limit: 1).first.try(:authored_date)
return unless first_commit_timestamp return unless first_commit_timestamp
metrics.update!(first_mentioned_in_commit_at: first_commit_timestamp) metrics.update!(first_mentioned_in_commit_at: first_commit_timestamp)
......
---
title: Store first commit's authored_date for value stream calculation on merge
merge_request: 26885
author:
type: changed
...@@ -103,8 +103,8 @@ describe Issues::CloseService do ...@@ -103,8 +103,8 @@ describe Issues::CloseService do
subject { described_class.new(project, user).close_issue(issue, closed_via: closing_merge_request) } subject { described_class.new(project, user).close_issue(issue, closed_via: closing_merge_request) }
context 'when `metrics.first_mentioned_in_commit_at` is not set' do context 'when `metrics.first_mentioned_in_commit_at` is not set' do
it 'uses the first commit timestamp' do it 'uses the first commit authored timestamp' do
expected = closing_merge_request.commits.first.date expected = closing_merge_request.commits.first.authored_date
subject subject
......
...@@ -118,7 +118,7 @@ describe MergeRequests::MergeService do ...@@ -118,7 +118,7 @@ describe MergeRequests::MergeService do
it 'closes GitLab issue tracker issues' do it 'closes GitLab issue tracker issues' do
issue = create :issue, project: project issue = create :issue, project: project
commit = double('commit', safe_message: "Fixes #{issue.to_reference}", date: Time.now) commit = instance_double('commit', safe_message: "Fixes #{issue.to_reference}", date: Time.now, authored_date: Time.now)
allow(merge_request).to receive(:commits).and_return([commit]) allow(merge_request).to receive(:commits).and_return([commit])
merge_request.cache_merge_request_closes_issues! merge_request.cache_merge_request_closes_issues!
......
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