-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
nextercism: implement submit command #419
Comments
I have an incredibly janky implementation of this locally that I will improve before letting anyone else see it. |
Hi -- why was this closed? I'd like an "exercism submit" feature that just submits the current directory without needing to specify the files, and chasing through the GitHub issues brought me to the "Nextercism" branch, and then this issue. As far as I can tell, this feature isn't supported yet (CLI 3.0.11 at least). Is this still on the roadmap? Is there another issue I can follow to see the progress (I wasn't able to find one)? |
If at all it is a long term goal, as during a transition phase we actually had this feature and it caused a lot of bugs and superflously submitted files (eg binaries or other artifacts). Also, this configuration needs to be available to the CLI without it needing to rely on the server to filter out the superflous files, while we do not want to have to bundle a new release of the CLI each time some naming schemes in a track change or we get a new track. |
Is there another open issue for that long term goal? I couldn't find one. A rough fix would be:
If this section isn't present then keep the current behaviour -- require the user to specify the files to upload each time. Possibly separate step -- if people are uploading random binaries, impose a size / type check on the server to reject them. |
We have a submit command. I implemented the "submit a directory" idea, and decided I didn't like it, so I removed it. I don't have a long-term goal of supporting it. Identifying which files are necessary to submit for any given language track or exercise is not trivial, as this is not explicitly encoded anywhere.
Most of the time we don't want people to submit the test file, unless they've written custom tests and want to discuss them with their mentor.
Yeah, we have checks against binaries, but not against everything else. |
Thinking out loud... For most tracks, we typically only want to submit one file, and it is almost always named as either the It will sometimes be in a subdirectory, sometimes in the exercise directory itself. What about this:
That would cover most of the cases, and for those it doesn't cover, we could later decide whether it's worth implementing logic for them. |
Is there a reason why this information can't be included in the data that the CLI downloads and saves in metadata.json, and treat that as the source of truth? I can see (in the CLI tool) where that information is fetched, but I can't see which Github repository contains the source of that data on a per-exercise basis. The track I'm most interested in at the moment is the Javascript track, and there, most of the tests have one initial So it's important that the student remembers to upload both files. I've been running a programming course for refugees, and when I had them using the Exercism exercises, having them remember to upload the modified test files along with the code was a source of confusion. |
They do not need to upload the tests. Mentors usually know that they need to unskip the tests if they download the solution for reviewing and usually do so before running the tests, most have actually helpers that do the changes for them. |
I'm not sure I understand what you mean by "this information". The information about what the name of the source file is currently isn't stored anywhere at all. If we had it we could certainly add it to the metadata file. However, the only place that it exists right now is as an implicit assumption via the test suite. The file could be named anything, so there's no way to know what would have to be returned. We could make some guesses, but that's all. |
Yeah, they probably should not be uploading the tests. Only in the rarest cases would that be necessary. |
@nikclayton Would you mind opening an issue in http://github.com/exercism/exercism/issues about what you're trying to achieve? That way we could have a conversation about that, separate from this old (closed) issue about the original submit command. |
Can be achieved with an alias |
To be merged into the nextercism branch in #410
Command name:
submit
(aliass
).File:
cmd/submit.go
.Calling
submit
with no arguments will try to submit the current directory. If the current directory is not an identifiable exercise, we can either ask interactively what track (if multiple) and what exercise. Or we can error out and ask them to specify the path to the directory to submit.The files are submitted as a multipart form upload as a
PATCH
request to the/solutions/:uuid
endpoint.The form field for the files is called
files[]
.Given the following directory structure:
The contents of the files are:
And the following sinatra app:
Run the app with:
Then use this curl command to generate a multipart post:
Note that curl strips off the subdirectory and only sends the file's basename, which is wrong.
The text was updated successfully, but these errors were encountered: