Skip to content

Fix legacy git version format parsing

Niko Belokolodov requested to merge fix_legacy_git_format into main

From older instances we receive git version formed as

{
  git: {
    version: "2.35.1"
  }
}

however, our app expects it to be a hash as

{ 
  "git": {
    "version": {
      "major": 2,
      "minor": 35,
      "patch": 1,
    }
  }
}

This MR adds this backward compatibility

Testing

  1. Upload a payload from older instance (can use the one from the original issue)
  2. Verify no exception raised.
  3. Can optionally verify DB record
[12] pry(main)> RawUsageData.last.payload['git']
=> {"version"=>{"major"=>2, "minor"=>35, "patch"=>1}}

Related to #9 (closed)

See the initial problem description https://gitlab.com/gitlab-org/gitlab-services/version.gitlab.com/-/issues/6

Edited by Niko Belokolodov

Merge request reports