Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@graphaelli
Copy link
Contributor

@graphaelli graphaelli commented Dec 16, 2021

Based on the history for this utility IsLatest didn't exist when it was written as it was added in https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2021-01-19.

Fixes #4922

image

to match what is displayed on https://github.com/elastic/elasticsearch/releases
image

@graphaelli graphaelli requested a review from a team as a code owner December 16, 2021 20:58
@graphaelli graphaelli requested review from vilmibm and removed request for a team December 16, 2021 20:58
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Dec 16, 2021
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great for GitHub.com. Unfortunately, we cannot merge it as-is because it would break gh release list for GitHub Enterprise < 3.1, as they didn't yet have the isLatest field in their GraphQL schema, so for them this updated query would result in an error.

The way we work around this in other parts of gh is that we query the schema for whether a certain field is available. For example, for pull requests:

func determinePullRequestFeatures(httpClient *http.Client, hostname string) (prFeatures pullRequestFeature, err error) {

Unfortunately, this complicates the whole query approach, since now we need dynamic instead of static queries, so we cannot anymore use graphql.NewClient since that library only supports static queries. I don't expect you to update this PR for a different query approach because we don't have any documentation on how to do it. If you give us some time, someone from our team will get around to pushing updates to this PR to make it compatible with GHE 👍

@graphaelli
Copy link
Contributor Author

Thanks for the explanation, I didn't realize that was a consideration. Feel free to push to this or close and create a fresh pr as you see fit, thanks.

@mislav mislav self-assigned this Dec 20, 2021
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a test fix for this and approved the change since GitHub Enterprise 3.0 is no longer supported by GitHub and thus I feel we can break it from gh as well. I've considered adding conditional GraphQL queries here, but it would be a lot of work for little payoff.

@mislav mislav enabled auto-merge March 30, 2022 17:02
@mislav mislav disabled auto-merge March 30, 2022 17:02
@mislav mislav enabled auto-merge (squash) March 30, 2022 17:03
@mislav mislav merged commit a6f6ad7 into cli:trunk Mar 30, 2022
@graphaelli graphaelli deleted the release-list-latest branch March 30, 2022 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Latest release cli doesn't match site

3 participants