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

Transfer Issues to Other Repositories #2363

Merged
merged 21 commits into from
Dec 15, 2019
Merged

Conversation

srafi1
Copy link
Contributor

@srafi1 srafi1 commented Nov 17, 2019

Implements transferring issues to other repositories as requested in issue #2252. This feature differs from the feature request in one way: the user only specifies TARGET_REPO rather than USER/TARGET_REPO. This is because users cannot move issues between different users or organizations according to this guide.

Format:

hub issue transfer <ISSUE_NUMBER> <TARGET_REPO>

Example:

hub issue transfer 2252 hub-fork

Copy link
Owner

@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! Left a couple of notes. The primary item I would like to see addressed is parsing response JSON intro structs instead to an interface{} and having to do type assertions to read data. Let me know if that makes sense

commands/issue.go Outdated Show resolved Hide resolved
commands/issue.go Outdated Show resolved Hide resolved
commands/issue.go Outdated Show resolved Hide resolved
commands/issue.go Outdated Show resolved Hide resolved
@mislav
Copy link
Owner

mislav commented Nov 18, 2019

This also needs tests in order to have CI passing again. You can find existing tests in features/issue.feature and run them with bin/cucumber features/issue.feature, but we don't have any examples of tests that handle GraphQL API calls since we didn't use GraphQL before this. If this proves to hard for you to write, just holler and I will take over. 🙇

@srafi1
Copy link
Contributor Author

srafi1 commented Nov 21, 2019

Thanks for the feedback! I implemented the method for unmarshalling that you suggested and the code looks much cleaner now without type assertions. I haven't tried writing any tests yet, so I will try that (hopefully during the weekend).

commands/issue.go Outdated Show resolved Hide resolved
@srafi1
Copy link
Contributor Author

srafi1 commented Dec 2, 2019

I put variables in their own parameter, but I haven't written any tests. I looked at steps.rb and issue.feature, but I'm not familiar with Ruby or Cucumber, so I don't know how to write them. Can you help me out with this?

@mislav mislav merged commit 4c2e441 into mislav:master Dec 15, 2019
@mislav
Copy link
Owner

mislav commented Dec 15, 2019

@srafi1 Great work; thank you! I've also added some cleanups and tests.

One thing that only ocurred to me after I took over your branch was that the first 2 GraphQL queries can be performed in a single request (rather than over 2 requests), so I've implemented that.

I've also added a specialized Client.GraphQL function to move us away from GenericAPIRequest since the latter was only intended for the hub api command.

@srafi1 srafi1 deleted the transfer-issue branch December 15, 2019 20:04
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.

None yet

2 participants