Missing information on Releases

schema-request

#1

Hi again :grinning:,

Using releases on this new API, I noticed that some data are missing (compared to v3).
For example, on V3 we have the fields draft, prerelease, created_at, and author that are not on V4.
Why these data are not available on V4? Are they going to be available in a near future?

Moreover, the same is valid for assets (fields uploader, size, download_count, created_at, etc)


#2

:wave: @hsborges,

The lack of these fields wasn’t intentional, it’s just something we haven’t gotten around to yet :smile:.

I’ve marked this post as a schema request and added it to our internal tracker. We’ll update you here when we have something to share.


#3

Hi @bswinnerton, just wanted to +1 this request. I’m going to migrate my release notes integration from v3 as soon as there is a GitActor type field on the Release object.


#4

:wave: @hsborges & @thorsenty-lp,

We’ve added a few new fields to the Release object:

  • createdAt
  • updatedAt
  • author
  • isDraft
  • isPrerelease

Updates to the ReleaseAsset object are still on our todo list.


#5

Thanks @bswinnerton, awesome stuff.


#6

Thanks @bswinnerton :+1:


#7

@bswinnerton, I’m not sure if this is new, but I just noticed that I’m getting incorrect data back for the Release > Tag > Target. The first screenshot below is from my app, and the second screenshot is from github.com. You can see that the commits don’t match. And in fact the commit I’m getting back from the v4 api doesn’t seem to exist in my repo at all.


#8

:wave: @thorsenty-lp,

Could you please paste in the query you’re using? I just gave this a shot with:

query($owner:String!,$name:String!) {
  repository(owner:$owner,name:$name) {
    releases(last:100) {
      edges {
        node {
          tag {
            target {
              oid
              ... on Commit {
                message
                url
              }
            }
          }
        }
      }
    }
  }
}

And seem to be getting sane results.


#9
query($owner:String!,$name:String!) {
  repository(owner:$owner,name:$name) {
    releases(last:100) {
      nodes {
        name
        description
        createdAt
        author {
          login
          avatarUrl
        }
        tag {
          name
          target {
            abbreviatedOid
            commitUrl
          }
        }
      }
    }
  }
}

#10
{
    "data": {
        "repository": {
            "name": "leadpages-home-wcm",
            "releases": {
                "nodes": [
                    {
                        "name": "Release Notes Integration",
                        "description": "The WCM application is now integrated with GitHub, and can pull in release notes for the leadpages-home-wcm repository. The latest release is displayed in a dashboard widget, with details on all releases available at [www.leadpages/net/wcm/admin/release-notes](https://www.leadpages/net/wcm/admin/release-notes).\r\n\r\n[![image](https://user-images.githubusercontent.com/24830958/28788521-b324150a-75e6-11e7-9732-83ccd79e4713.png)](https://user-images.githubusercontent.com/24830958/28788521-b324150a-75e6-11e7-9732-83ccd79e4713.png)\r\n",
                        "createdAt": "2017-07-31T16:03:50Z",
                        "author": {
                            "login": "thorsenty-lp",
                            "avatarUrl": "https://avatars1.githubusercontent.com/u/24830958?v=4"
                        },
                        "tag": {
                            "name": "20170731-32",
                            "target": {
                                "abbreviatedOid": "0c66dc1",
                                "commitUrl": "https://github.com/LeadPages/leadpages-home-wcm/commit/0c66dc1744100f5f07daa0aa06f962a91657b452"
                            }
                        }
                    }
                ],
                "pageInfo": {
                    "hasNextPage": false,
                    "endCursor": "Y3Vyc29yOnYyOpHOAG5aSA==",
                    "hasPreviousPage": true,
                    "startCursor": "Y3Vyc29yOnYyOpHOAG5aSA=="
                }
            }
        }
    }
}

@bswinnerton This is the response for the last:1 using the query above. Everything looks fine except for what comes back for target. That Oid does not exist in LeadPages/leadpages-home-wcm.


Https://developer.github.com/v4/
#11

@thorsenty-lp, would you mind reaching out on https://github.com/contact? We can discuss further over there :bowing_man:.


#12

I just added

  • contentType: String!
  • createdAt: DateTime!
  • downloadCount: Int!
  • size: Int!
  • uploadedBy: User!

to release assets.


#13

Could we also add the v4 equivalent for v3’s “browser_download_url” for a release asset?


#14

Good catch @quantumpacket!

This has been added :grinning:! downloadUrl is now present on the ReleaseAsset object.


#15

Thanks

Is there a way to sort the releases?


#16

I’ve added this to our backlog to track.


#17

@yakov116 You can now sort releases by name or created_at date. :slight_smile:

https://developer.github.com/v4/reference/object/repository/


#18

Thank you!