Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
90e9ef26
Commit
90e9ef26
authored
May 17, 2021
by
drew cimino
Committed by
Shinya Maeda
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use MergeRequest#merge_base_pipeline for comparing Metrics reports [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
155bf7e5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
app/models/merge_request.rb
app/models/merge_request.rb
+1
-0
config/feature_flags/development/merge_base_pipeline_for_metrics_comparison.yml
...evelopment/merge_base_pipeline_for_metrics_comparison.yml
+8
-0
lib/gitlab/ci/features.rb
lib/gitlab/ci/features.rb
+4
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+14
-0
No files found.
app/models/merge_request.rb
View file @
90e9ef26
...
...
@@ -37,6 +37,7 @@ class MergeRequest < ApplicationRecord
SORTING_PREFERENCE_FIELD
=
:merge_requests_sort
ALLOWED_TO_USE_MERGE_BASE_PIPELINE_FOR_COMPARISON
=
{
'Ci::CompareMetricsReportsService'
=>
->
(
project
)
{
::
Gitlab
::
Ci
::
Features
.
merge_base_pipeline_for_metrics_comparison?
(
project
)
},
'Ci::CompareCodequalityReportsService'
=>
->
(
project
)
{
true
}
}.
freeze
...
...
config/feature_flags/development/merge_base_pipeline_for_metrics_comparison.yml
0 → 100644
View file @
90e9ef26
---
name
:
merge_base_pipeline_for_metrics_comparison
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61282
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/330809
milestone
:
'
13.12'
type
:
development
group
:
group::testing
default_enabled
:
false
lib/gitlab/ci/features.rb
View file @
90e9ef26
...
...
@@ -18,6 +18,10 @@ module Gitlab
Feature
.
enabled?
(
:ci_pipeline_status_omit_commit_sha_in_cache_key
,
project
,
default_enabled:
true
)
end
def
self
.
merge_base_pipeline_for_metrics_comparison?
(
project
)
Feature
.
enabled?
(
:merge_base_pipeline_for_metrics_comparison
,
project
,
default_enabled: :yaml
)
end
# Remove in https://gitlab.com/gitlab-org/gitlab/-/issues/224199
def
self
.
store_pipeline_messages?
(
project
)
::
Feature
.
enabled?
(
:ci_store_pipeline_messages
,
project
,
default_enabled:
true
)
...
...
spec/models/merge_request_spec.rb
View file @
90e9ef26
...
...
@@ -3876,6 +3876,20 @@ RSpec.describe MergeRequest, factory_default: :keep do
subject
{
merge_request
.
use_merge_base_pipeline_for_comparison?
(
service_class
)
}
context
'when service class is Ci::CompareMetricsReportsService'
do
let
(
:service_class
)
{
'Ci::CompareMetricsReportsService'
}
it
{
is_expected
.
to
be_truthy
}
context
'with the metrics report flag disabled'
do
before
do
stub_feature_flags
(
merge_base_pipeline_for_metrics_comparison:
false
)
end
it
{
is_expected
.
to
be_falsey
}
end
end
context
'when service class is Ci::CompareCodequalityReportsService'
do
let
(
:service_class
)
{
'Ci::CompareCodequalityReportsService'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment