devops_labels_spec failure due to change to the global_search group category
Job failed today after gitlab-com/www-gitlab-com!116145 (merged) was introduced and the EP team was not aware:
Failures:
1) DevopsLabels DevopsLabels::Context#comment_for_intelligent_stage_and_group_labels_inference stage: yes, group: yes, category: no, single_category: yes => Apply Category label based on group returns a comment with a /label quick action
Failure/Error: expect(resource.comment_for_intelligent_stage_and_group_labels_inference).to eq %(#{explanation}\n#{label_action})
expected: "Setting label(s) ~\"Category:Global Search\" ~\"section::enablement\" based on ~\"group::global search\".\n/label ~\"Category:Global Search\" ~\"section::enablement\""
got: "/label ~\"section::enablement\""
(compared using ==)
Diff:
@@ -1,3 +1,2 @@
-Setting label(s) ~"Category:Global Search" ~"section::enablement" based on ~"group::global search".
-/label ~"Category:Global Search" ~"section::enablement"
+/label ~"section::enablement"
# ./spec/lib/devops_labels_spec.rb:818:in `block (5 levels) in <top (required)>'
# ./spec/spec_helper.rb:211:in `block (2 levels) in <top (required)>'
# ./vendor/ruby/2.7.0/gems/webmock-3.10.0/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'
2) DevopsLabels DevopsLabels::Context#comment_for_intelligent_stage_and_group_labels_inference stage: no, group: yes, category: no, single_category: yes => Apply Stage and Category label based on group returns a comment with a /label quick action
Failure/Error: expect(resource.comment_for_intelligent_stage_and_group_labels_inference).to eq %(#{explanation}\n#{label_action})
expected: "Setting label(s) ~\"Category:Global Search\" ~\"devops::data_stores\" ~\"section::enablement\" based...bal search\".\n/label ~\"Category:Global Search\" ~\"devops::data_stores\" ~\"section::enablement\""
got: "Setting label(s) ~\"devops::data_stores\" ~\"section::enablement\" based on ~\"group::global search\".\n/label ~\"devops::data_stores\" ~\"section::enablement\""
(compared using ==)
Diff:
@@ -1,3 +1,3 @@
-Setting label(s) ~"Category:Global Search" ~"devops::data_stores" ~"section::enablement" based on ~"group::global search".
-/label ~"Category:Global Search" ~"devops::data_stores" ~"section::enablement"
+Setting label(s) ~"devops::data_stores" ~"section::enablement" based on ~"group::global search".
+/label ~"devops::data_stores" ~"section::enablement"
# ./spec/lib/devops_labels_spec.rb:818:in `block (5 levels) in <top (required)>'
related to gitlab-com/www-gitlab-com!116145 (merged)
before
groupglobal search is mapped only to Category:Global Search
after
groupglobal search is mapped to
The change resulted in groupglobal search having 2 categories. This will prevent the label inference from applying a category label because it will not know which one of the 2 categories to choose, which is expected.
Fix
The behavior of the automation is expected, we just need to update the test assertion to stop looking for a category label in the output.
Edited by Jennifer Li