Display problems that have not yet been submitted#155
Display problems that have not yet been submitted#155Tonkpils merged 1 commit intoexercism:masterfrom
Conversation
|
I ended up using the same report format for this PR. I found it a bit more intuitive but if needed we can change it to explicitly state that problems not yet submitted will not allow continuing on the track. This is a sample of the output. % out/exercism fetch go
Not Submitted: 1 problem
Gigasecond (go) /Users/tonkpils/exercism/go/gigasecond
unchanged: 3, updated: 0, new: 0 |
cmd/fetch.go
Outdated
There was a problem hiding this comment.
This PR looks great! What do you think about passing the map[string][]SubmissionInfo in to this function ? I think that would make it easier to test.
There was a problem hiding this comment.
That would probably be nice. Another thing we could do is have an alias type for []*api.Problem that has a function to update the state. It could both make the call and do the loop. Not sure what that would look like in terms of testing, though.
Yeah, I think that would be good. Another thing that people can do is to call |
|
One side effect that I just found is that if we call |
|
I had the same thought - to have Only a call to The other idea I had was to extend the xapi response to also include this information in a single call when appropriate. I have no idea how much work is involved in that. |
|
Yeah, I think you're right that |
|
Yeah, I was thinking about that yesterday. Ideally the Update Would you mind if I take a stab at modifying the api package to use a Client struct that contains the config and reuses the |
Not at all, I was just thinking about this the other day. I think it's the right choice. |
|
There are a couple of places we don't set the user agent constantly. It would be amazing if introducing our own client hid that detail. |
Totally! |
d7f6712 to
79ec879
Compare
|
@Tonkpils is this one ready? |
cmd/restore.go
Outdated
There was a problem hiding this comment.
Could we use a custom type and a constant flag to make this more readable?
There was a problem hiding this comment.
I was thinking of making a struct to take options on what to summarize but decided it wasn't worth the complexity if we didn't need the functionality.
Can you give me an example of what you mean? I definitely do agree that it could be more readable.
|
Once I address the readability comment it'll be ready :) |
|
Cool, ping me when you're done. I sometimes lose track of things without new notifications. |
79ec879 to
237ce3f
Compare
|
@kytrinyx What do you think of the last commit? If that is ok with you then I'll go ahead and squash the commits and merge. |
|
I don't think that a struct is the best choice here, since we will only ever use one of the three fields at any one time. Take a look at the |
|
Got it, I think that should do it. Wasn't too sure on the naming though. |
|
Yeah I think this works. When you say that you're not so sure about the naming, do you mean the Either way, I think this is ready for squashing and merging. |
|
Nah, I meant more the |
69ed8da to
7d28961
Compare
7d28961 to
31521c8
Compare
Display problems that have not yet been submitted
|
Yeah, I think it's good. Thanks for this! |
We're pretty much querying the exercises API from exercism.io to get a list of submitted problems. Since we only want to check for problems that are stopping the user from fetching the next exercise we'll display the ones that have not been submitted.