Skip to content

Flaky spec: ./spec/features/cycle_analytics_spec.rb:70

Flaky spec: ./spec/features/cycle_analytics_spec.rb:70 Value Stream Analytics as an allowed user when there's value stream analytics data shows data on each stage

What does this MR do?

The created_before param is set to before the MR is created, thus it gets filtered out

From: /Users/bwalker/dev/gitlab/ee/gitlab/app/finders/concerns/created_at_filter.rb:6 CreatedAtFilter#by_created_at:

     4: def by_created_at(items)
     5:   binding.pry
 =>  6:   items = items.created_before(params[:created_before]) if params[:created_before].present?
     7:   items = items.created_after(params[:created_after]) if params[:created_after].present?
     8:
     9:   items
    10: end

[1] pry(#<MergeRequestsFinder>)> params
=> {"current_user"=>#<User id:91 @user1>,
 "end_event_filter"=>:finished,
 "project_id"=>31,
 "created_after"=>2021-07-19 00:00:00 UTC,
 "created_before"=>2021-08-18 23:59:59.999999999 UTC,
 "assignee_username"=>nil,
 "author_username"=>nil,
 "milestone_title"=>nil,
 "label_name"=>nil,
 "project_ids"=>[]}
[2] pry(#<MergeRequestsFinder>)> items.first.created_at
=> Thu, 19 Aug 2021 21:16:08.939290000 UTC +00:00

[5] pry(#<MergeRequestsFinder>)> items.first.created_at.to_time
=> 2021-08-19 16:16:08.93929 -0500
[6] pry(#<MergeRequestsFinder>)> params[:created_before].to_time
=> 2021-08-18 18:59:59.999999999 -0500
[8] pry(#<MergeRequestsFinder>)> params[:created_after].to_time
=> 2021-07-18 19:00:00 -0500

Since created_after and created_before span the last 30 days, let's make sure the MR is created within those 30 days by freezing time 5 days before the current time.

Screenshots or Screencasts (strongly suggested)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #338011 (closed)

Edited by Brett Walker

Merge request reports