Skip to content

Fix failed job about "product_interaction"

路志远请求将fix-pipeline-1527085合并到main-jh

What does this MR do and why?

Fix failed job: https://jihulab.com/gitlab-cn/gitlab/-/jobs/9299736

Error log
Failures:
  1) TrialStatusWidgetHelper data attributes for mounting Vue components #trial_status_popover_data_attrs returns the needed data attributes for mounting the popover Vue component
     Failure/Error:
       expect(data_attrs).to match(
         expected_attrs.merge(
           namespace_id: group.id,
           user_name: user.username,
           first_name: user.first_name,
           last_name: user.last_name,
           company_name: user.organization,
           glm_content: 'trial-status-show-group',
           create_hand_raise_lead_path: '/-/subscriptions/hand_raise_leads',
           target_id: expected_attrs[:container_id],
       expected {:company_name=>"", :container_id=>"trial-status-sidebar-widget", :create_hand_raise_lead_path=>"/-/s..., :target_id=>"trial-status-sidebar-widget", :trial_end_date=>Thu, 21 Sep 2023, :user_name=>"user1"} to match {:container_id=>"trial-status-sidebar-widget", :plan_name=>"Ultimate", :plans_href=>"/groups/group1/-/billings", :days_remaining=>18, :namespace_id=>1441, :user_name=>"user1", :first_name=>"Sidney", :last_name=>"Jones1", :company_name=>"", :glm_content=>"trial-status-show-group", :create_hand_raise_lead_path=>"/-/subscriptions/hand_raise_leads", :target_id=>"trial-status-sidebar-widget", :trial_end_date=>Thu, 21 Sep 2023}
       Diff:
       @@ -8,6 +8,7 @@
        :namespace_id => 1441,
        :plan_name => "Ultimate",
        :plans_href => "/groups/group1/-/billings",
       +:product_interaction => "Hand Raise PQL",
        :target_id => "trial-status-sidebar-widget",
        :trial_end_date => Thu, 21 Sep 2023,
        :user_name => "user1",

Relate Upstream MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130351

Why

On the billing scenario, upstream adds a field to SubscriptionPortal form, causing jh spec to report an error.

< def hand_raise_props(namespace, glm_content:)
> def hand_raise_props(namespace, glm_content:, product_interaction: 'Hand Raise PQL')
  {
    namespace_id: namespace.id,
    user_name: current_user.username,
    first_name: current_user.first_name,
    last_name: current_user.last_name,
    company_name: current_user.organization,
    glm_content: glm_content,
>   product_interaction: product_interaction,
    create_hand_raise_lead_path: subscriptions_hand_raise_leads_path
  }
end

This new field will not affect other functions, and the final data structure sent to SubscriptionPortal remains unchanged. 😄

Before: When requesting SubscriptionPortal, the parameter product_interaction is hardcode.

After: When requesting SubscriptionPortal, the parameter product_interaction changes according to different scenarios.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

路志远 编辑于

合并请求报告

加载中