Skip to content

Update the doc/api/commits.md to change the time to a floating 3 decimal point

John Lyttle requested to merge jlyttle-master-patch-46485 into master

What does this MR do and why?

A customer contacted support to say that the commits "created, authored" times/dates are incorrect as they do not contain the floating three decimal point.

I created a sample test to verify that the customer is correct, the original commit API call was made in 2012 and the code has likely since been updated.

curl --header "PRIVATE-TOKEN: <xxxx>" "https://gitlab.com/api/v4/projects/24184230/repository/commits/761c3d81af0a18bd9aede94ca37134d6e410b27e" | jq

{
  "id": "761c3d81af0a18bd9aede94ca37134d6e410b27e",
  "short_id": "761c3d81",
  "created_at": "2022-04-05T08:30:19.000+00:00",
  "parent_ids": [
    "73fa975f5538bd61da0eade8bf46410f1367f55d",
    "585327a54572ee0decaaa6d61994e73684efb199"
  ],
  "title": "Merge branch 'main' into 'master'",
  "message": "Merge branch 'main' into 'master'\n\nMain into master\n\nSee merge request jlyttle/my-first-python!9",
  "author_name": "John Lyttle",
  "author_email": "jlyttle@gitlab.com",
  "authored_date": "2022-04-05T08:30:19.000+00:00",
  "committer_name": "John Lyttle",
  "committer_email": "jlyttle@gitlab.com",
  "committed_date": "2022-04-05T08:30:19.000+00:00",
  "trailers": {},
  "web_url": "https://gitlab.com/jlyttle/my-first-python/-/commit/761c3d81af0a18bd9aede94ca37134d6e410b27e",
  "stats": {
    "additions": 0,
    "deletions": 0,
    "total": 0
  },

How to set up and validate locally

Change the current 2012 commits date/times to include the float with three decimal points.

  1. Current "2012-09-20T11:50:22+03:00"

  2. New "2021-09-20T11:50:22.003+03:00"

MR acceptance checklist

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

Merge request reports