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

Skip to content

Conversation

@gleich
Copy link
Contributor

@gleich gleich commented Sep 17, 2020

This PR resolves #1712.

@vilmibm vilmibm self-requested a review September 17, 2020 22:14
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 fantastic; thank you!

I think that the stubs in tests need to be updated to compensate for the switch to GraphQL

@gleich
Copy link
Contributor Author

gleich commented Sep 18, 2020

Yep. I was looking into it yesterday and I'll try to get it working. Haven't really worked with the testing side of things with graphql before so I might need a little help.

Signed-off-by: Matthew Gleich <[email protected]>
@gleich gleich requested a review from mislav October 4, 2020 06:03
gleich and others added 3 commits October 4, 2020 15:02
It's not sufficient to use `Changed("public")` to test if a boolean flag
was activated, since the user might have passed `--public=false`.
Instead, check the true value of the flag.

The `--public` and `--secret` flags should be mutually exclusive, so now
if both are activated, `--secret` takes precedence.
- Fetching more than 100 gists is now supported
- The GraphQL query name is now `GistList` instead of `ListGists` for
  consistency with other queries
- Avoid fetching unnecessary Files fields
- Gists are now rendered in the order that the API returned them in
- The gist timestamp for machine-readable output is now rendered in
  RFC3339 format instead of in `time.Time.String()` format which is only
  meant for debugging and is not considered stable
- Ensure newlines in gist description are rendered as spaces
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.

@Matt-Gleich Thanks for the updates!

@vilmibm I've added a number of changes to this branch:

  • Ported the GraphQL query to "githubv4" adapter
  • Fetching more than 100 gists is now supported
  • The GraphQL query name is now GistList instead of ListGists for consistency with other queries
  • Avoid fetching unnecessary Files fields
  • Gists are now rendered in the order that the API returned them in (CreatedAt desc) instead of reordered by UpdatedAt timestamp - should we consider displaying the CreatedAt timestamp instead of UpdatedAt?
  • The gist timestamp for machine-readable output is now rendered in RFC3339 format instead of in time.Time.String() format which is only meant for debugging and is not considered stable
  • Ensure newlines in gist description are rendered as spaces
  • It's not sufficient to use Changed("public") to test if a boolean flag was activated, since the user might have passed --public=false. Instead, check the true value of the flag.
  • The --public and --secret flags should be mutually exclusive, so now if both are activated, --secret takes precedence.

@vilmibm vilmibm merged commit d63b5a9 into cli:trunk Oct 5, 2020
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

Successfully merging this pull request may close these issues.

port gist list to use graphql

3 participants