Skip to content

[Bug] Compliance violations merged_before/merged_after filters excluding the filter dates

Problem to solve

The current implementation of the compliance violations GraphQL endpoint has filters to filter before or after a specific merged date. This should include the date being filtered but does not.

Solution

The finder is doing a <= or >= comparison but it is comparing a date string against a datetime column merged_at. This means that the date string is converted to YYYY-MM-DD 00:00:00 which will exclude most of the same-date violations. We should update the queries so they compare the date string against a true date.

Implementation plan

  1. Update http://gitlab.com/gitlab-org/gitlab/blob/master/ee/app/models/merge_requests/compliance_violation.rb#L21-22 to use DATE()
  2. Update specs
Edited by Robert Hunt