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

Skip to content

Conversation

@wingkwong
Copy link
Contributor

Addressing #397

Gist is not available in GraphQL API v4 so it is built using V3 instead as @mislav suggested.

If it looks fine, I'll work on other parts for Gist and submit in separate PRs.

@wingkwong wingkwong requested a review from mislav February 25, 2020 05:19
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.

Thank you for the contribution!

As per our CONTRIBUTING doc, we currently don't accept PRs for new featuers, especially if it's something that is not on our roadmap at all (and gist isn't, at least not yet).

We might leave this open and revisit when we do choose to prioritize gist.

@mislav mislav closed this Feb 25, 2020
@mislav
Copy link
Contributor

mislav commented Feb 25, 2020

Closing for now, as we can reopen later if we still decide to use this. Thanks again!

@vilmibm
Copy link
Contributor

vilmibm commented May 13, 2020

During an issue audit we noticed this and decided gist support would be nice, especially given the work already done towards it in this PR.

I'm going to mark this as open and ready for review.

@vilmibm vilmibm reopened this May 13, 2020
@vilmibm vilmibm self-requested a review May 13, 2020 16:57
@vilmibm
Copy link
Contributor

vilmibm commented May 13, 2020

Before proceeding with a full review I wanted to clean up the conflict and use existing scope authorization code to have users re-authenticate for gist scope. I was able to make that work easily enough but then ran into the bug we have reported as #914 .

I don't want to ship a new "asks for reauth" PR until we have #914 fixed; I've stared at it and thought I had a fix but it's not working. I think it might be good for @mislav and I to pair on that this week.

vilmibm added 8 commits May 13, 2020 14:55
Our code had an unspoken assumption that only one apiClient is created
during the course of a command. Violating this assumption is fine in
almost all cases, but not when we need to do a re-auth to add a new
oauth scope to a user's token.

There is likely a more elegant solution to the problem but until then
this changes determineBaseRepo to use an existing apiClient.
This reverts commit 08e9cda.
@vilmibm
Copy link
Contributor

vilmibm commented May 15, 2020

@mislav 👋 I've added a first pass at ensureScopes, a function that can be used within a command to potentially reauthenticate based on the need for a specific, new scope. I can't say I'm thrilled with the code (there is a lot of copy and paste) so I'm interested in what you think about it on Monday.

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 feels like it's almost ready to ship! I feel the command/flag docs need more work, and I have some feature suggestions that could be addressed in this PR or follow-up:

  1. Should we consider allowing passing multiple files, i.e. -f <file1> -f <file2>?
  2. If so, would we consider passing files as arguments instead of -f flags, so we can allow usage like gh gist create *.log to upload all *.log files to a gist?
  3. Would we consider allowing uploading text that is not found in a file, e.g. text passed via standard input from clipboard or from another script? E.g. echo hello | gh gist create -

@vilmibm vilmibm self-assigned this May 19, 2020
@mislav mislav mentioned this pull request May 20, 2020
11 tasks
@vilmibm vilmibm mentioned this pull request May 20, 2020
@vilmibm
Copy link
Contributor

vilmibm commented May 20, 2020

closing this in favor of #981 (commit history preserved)

@vilmibm vilmibm closed this May 20, 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.

3 participants