Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 2f0fd0af63b..ea2f425c5f6 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -209,14 +209,26 @@ class CommitStatus < ApplicationRecord
end
def group_name
- # 'rspec:linux: 1/10' => 'rspec:linux'
- common_name = name.to_s.gsub(%r{\b\d+[\s:\/\\]+\d+\s*}, '')
+ simplified_commit_status_group_name_feature_flag = Gitlab::SafeRequestStore.fetch("project:#{project_id}:simplified_commit_status_group_name") do
+ Feature.enabled?(:simplified_commit_status_group_name, project, default_enabled: false)
+ end
+
+ if simplified_commit_status_group_name_feature_flag
+ # Only remove one or more [...] "X/Y" "X Y" from the end of build names.
+ # More about the regular expression logic: https://docs.gitlab.com/ee/ci/jobs/#group-jobs-in-a-pipeline
- # 'rspec:linux: [aws, max memory]' => 'rspec:linux', 'rspec:linux: [aws]' => 'rspec:linux'
- common_name.gsub!(%r{: \[.*\]\s*\z}, '')
+ name.to_s.sub(%r{([\b\s:]+((\[.*\])|(\d+[\s:\/\\]+\d+)))+\s*\z}, '').strip
+ else
+ # Prior implementation, remove [...] "X/Y" "X Y" from the beginning and middle of build names
+ # 'rspec:linux: 1/10' => 'rspec:linux'
+ common_name = name.to_s.gsub(%r{\b\d+[\s:\/\\]+\d+\s*}, '')
- common_name.strip!
- common_name
+ # 'rspec:linux: [aws, max memory]' => 'rspec:linux', 'rspec:linux: [aws]' => 'rspec:linux'
+ common_name.gsub!(%r{: \[.*\]\s*\z}, '')
+
+ common_name.strip!
+ common_name
+ end
end
def failed_but_allowed?