-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add '--all' flag to 'fetch' command #336
Conversation
Fetch all exercises for a given track
Hey @kytrinyx! I was looking through the issues and thought I would take a quick stab at this. I'll be offline until Tuesday, but let me know what you think! |
@@ -18,7 +18,18 @@ func Fetch(ctx *cli.Context) error { | |||
} | |||
client := api.NewClient(c) | |||
|
|||
problems, err := client.Fetch(ctx.Args()) | |||
args := ctx.Args() | |||
problems, err := client.Fetch(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't perform this fetch if the all
flag is set to true. What if we moved it to the else
of the following if
?
Sounds good, @Tonkpils. I'm out of town for the holiday weekend, but will follow up on this when I get back Monday or Tuesday. |
a2ebe3b
to
c801e2b
Compare
Hey @Tonkpils, I updated the PR with your suggestions. I started to add a test for |
@neslom I think having tests would be great but if it's too difficult then it's ok for now. The code seems fine. Once we iterate over this and have an actual API then we can add the fixture and simulate that request for the test. |
Ensure client.List is called and that client.Fetch is called for each problem returned by List
hey @Tonkpils, I ended up coming up with a test for this! let me know if I did something weird (I'm quite new to Go). I might have gone overboard with the assertions, but I explained my reasoning in the commit message |
That looks great! Thank you so much for your contribution! |
When does this become available on the client (via |
@kotp we'd need to cut a release out. I'll get to that tonight |
@Tonkpils if you run into any trouble holler—I've tried my best to document the release process, but if I've missed anything let me know and we'll improve the documentation along the way. |
Fetch all exercises for a given track
As mentioned in issue #335