Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check failing against GH Enterprise with "error running command: Field 'databaseId' doesn't exist on type 'Release'" #109

Open
OddBloke opened this issue Sep 9, 2021 · 8 comments

Comments

@OddBloke
Copy link

OddBloke commented Sep 9, 2021

We started seeing this today, presumably as a result of

if r.Node.DatabaseId == 0 {
which was introduced in #107.

As even the latest pre-release of GHE doesn't include databaseId in its release GraphQL (per https://docs.github.com/en/[email protected]/graphql/reference/objects#release), I expect that everyone else using this resource against GHE will also experience this issue.

@OddBloke
Copy link
Author

OddBloke commented Sep 9, 2021

(We've worked around this for now by pinning at the 1.6.3-alpine tag.)

@kirillbilchenko
Copy link
Contributor

@OddBloke that's strange because I have a test which is not having databaseId in response from graphql, and it's not causing any issues there

@OddBloke
Copy link
Author

That is strange! Let me know if there's any testing/debugging I can help you out with to try and figure it out.

@kirillbilchenko
Copy link
Contributor

@OddBloke Maybe if you can share the response payload, it can help

@OddBloke
Copy link
Author

I've just spent a bit of time putting together a Python script to do this, as the Go library doesn't appear to have a way to log the raw response. This is the query I'm running:

{
    repository(owner:"<REDACTED>",name:"<REDACTED>") {
        releases(first:10,after:null) {
            edges {
                node {
                    createdAt
                    publishedAt
                    id
                    isDraft
                    isPrerelease
                    name
                    tagName
                    url
                    databaseId
                }
            }
        }
    }
}

and this is the response I get:

{'errors': [{'extensions': {'code': 'undefinedField',
                            'fieldName': 'databaseId',
                            'typeName': 'Release'},
             'locations': [{'column': 21, 'line': 15}],
             'message': "Field 'databaseId' doesn't exist on type 'Release'",
             'path': ['query',
                      'repository',
                      'releases',
                      'edges',
                      'node',
                      'databaseId']}]}

If I remove databaseId from the query then I get a series of objects which look like this:

{
    "createdAt": "2021-08-05T15:17:37Z",
    "id": "MDc6UmVsZWFzZTExNTg=",
    "isDraft": false,
    "isPrerelease": false,
    "name": "v0.4.23",
    "publishedAt": "2021-08-05T16:03:30Z",
    "tagName": "v0.4.23",
    "url": "https://<REDACTED>/releases/tag/v0.4.23"
}

@kirillbilchenko
Copy link
Contributor

I've just spent a bit of time putting together a Python script to do this, as the Go library doesn't appear to have a way to log the raw response. This is the query I'm running:

{
    repository(owner:"<REDACTED>",name:"<REDACTED>") {
        releases(first:10,after:null) {
            edges {
                node {
                    createdAt
                    publishedAt
                    id
                    isDraft
                    isPrerelease
                    name
                    tagName
                    url
                    databaseId
                }
            }
        }
    }
}

and this is the response I get:

{'errors': [{'extensions': {'code': 'undefinedField',
                            'fieldName': 'databaseId',
                            'typeName': 'Release'},
             'locations': [{'column': 21, 'line': 15}],
             'message': "Field 'databaseId' doesn't exist on type 'Release'",
             'path': ['query',
                      'repository',
                      'releases',
                      'edges',
                      'node',
                      'databaseId']}]}

If I remove databaseId from the query then I get a series of objects which look like this:

{
    "createdAt": "2021-08-05T15:17:37Z",
    "id": "MDc6UmVsZWFzZTExNTg=",
    "isDraft": false,
    "isPrerelease": false,
    "name": "v0.4.23",
    "publishedAt": "2021-08-05T16:03:30Z",
    "tagName": "v0.4.23",
    "url": "https://<REDACTED>/releases/tag/v0.4.23"
}

Thanks for provided the info, in this case, yes I see the reason, but maybe it makes sense to ask GitHub why it's so different in scope of mode, maybe they will answer something useful. In case if not, we will need to have two different models there for enterprise GitHub and for a public one.

@OddBloke
Copy link
Author

Thanks for provided the info, in this case, yes I see the reason, but maybe it makes sense to ask GitHub why it's so different in scope of mode, maybe they will answer something useful. In case if not, we will need to have two different models there for enterprise GitHub and for a public one.

Unless GitHub revert the public API change, I think there will be supported GHE systems affected until at least June 2022 (3.1 EOL), and if they don't fix it in GHE before 3.2 goes out (and its already at the RC stage), at least a year from its release date. So I suspect, unfortunately, GitHub has stuck us with the need for two different models, at least in the interim.

@OddBloke
Copy link
Author

The good news is that GHE 3.2 does now appear to have databaseId: https://docs.github.com/en/[email protected]/graphql/reference/objects#release

So there will still be systems affected until June 2022, but that should be the point at which all supported GitHubs have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants