The amount of precision times have in databases is variable, so we need
tolerances when comparing in specs. It's better to have the tolerance defined
in one place than several.
1. The spec tests that if:
- The merge request is merged
- The target branch is deployed to production
- The `first_deployed_to_production_at` metric is `nil` (for some reason)
- The target branch is deployed to production again
- The `first_deployed_to_production_at` metric stays as `nil` (and is
not overwritten).
2. Failure only on MySQL due to some datetime weirdness.
All the code that pre-calculates metrics for use in the cycle analytics
page.
- Ci::Pipeline -> build start/finish
- Ci::Pipeline#merge_requests
- Issue -> record default metrics after save
- MergeRequest -> record default metrics after save
- Deployment -> Update "first_deployed_to_production_at" for MR metrics
- Git Push -> Update "first commit mention" for issue metrics
- Merge request create/update/refresh -> Update "merge requests closing issues"