Tags API should provide creation date
Description
I'd like to be able to script using the Gitlab API to find "recent releases" based on tags. Effectively I'd like to iterate over a group, identify any new tags via a cron job and if they match some requirements for tags (e.g. tag format or content of release notes), download the artefacts or binaries mentioned under release notes.
At present while I can get the date of the commit, I can't get the date of the tag from the Tag API (at least as far as I can tell, possibly there is a "lower-level way?").
But using git, I can easily do, for instance:
git show refs/tags/01Apr2017
tag 01Apr2017
Tagger: Daniel Mulholland <daniel.mulholland@somewhere.com>
Date: Thu Apr 6 14:27:19 2017 +1200
commit a2c44c6f1938ebc04524bb4aa9e7b5f660c5e3e8
Author: Daniel Mulholland <dan.mulholland@somewhere.com>
Date: Thu Apr 6 13:48:27 2017 +1200
Ensuring render of check marks functions correctly
I am wanting to retrieve via the API the timestamp, Thu Apr 6 14:27:19 2017 +1200
Proposal
- The tag in the gitlab screen should show it's timestamp on hover because for an annotated tag it is an independent object. The user might be interested in that if they think the sin of a forced change had been committed for instance.
- The API should allow information about the date to be brought back. This is not obviously an option under the tags API (https://docs.gitlab.com/ce/api/tags.html) although it might be possible another way?
Documentation blurb
(Write the start of the documentation of this feature here, include:
-
Tags have dates associated with them in the GUI, this is important release information and should appear when the user hovers over the tag under Repository > Tags.
-
The Gitlab API should expose the date, committer, committer email etc. in similar fashion to the commit for the tag. For instance:
GET /projects/:id/repository/tags
could return an additional parameter, tag_date
(or perhaps better would be commmitted_date
) with other similar parameters also (committer_name
and committer_email
):
[
{
"commit": {
"author_name": "John Smith",
"author_email": "john@example.com",
"authored_date": "2012-05-28T04:42:42-07:00",
"committed_date": "2012-05-28T04:42:42-07:00",
"committer_name": "Jack Smith",
"committer_email": "jack@example.com",
"id": "2695effb5807a22ff3d138d593fd856244e155e7",
"message": "Initial commit",
"parent_ids": [
"2a4b78934375d7f53875269ffd4f45fd83a84ebe"
]
},
"release": {
"tag_name": "1.0.0",
"description": "Amazing release. Wow"
},
"name": "v1.0.0",
"message": null,
*"tag_date": "2017-04-06T14:27:19-07:00"*
}
]
Not to reinvent the wheel (sorry if this is annoying), something similar to what is done by Github would be fine.
Happy to be corrected if I have failed to read the docs correctly.