Client should not overwrite exercise folders it does not "own"

Open
#872 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
cli

Research direction

Start with the exercism download --exercise=pangram --track=javascript flow and reproduce the case where an existing folder lacks .exercism. Trace how the client decides whether to overwrite files, then determine the expected behavior for unowned folders and any explicit force option. Done means an unowned solution is preserved while owned or newly created exercise folders still work as intended.

Written by the indexing model from the issue text.

Description

Ref: https://exercism-team.slack.com/archives/CARRG4MNC/p1565821395212500

What I did / How to reproduce

I wanted to complete Pangram (on the mentored track) but I hadn't progressed that far yet in JS mentored mode. So I:

  • downloaded a students Pangram exercise
  • copied the files into my ~/Exercism/javascript/pangram
  • removed their solution (so I could solve it)
  • removed the .exercism folder (removed the association with the student)

Later when the pangram opened up to me I:

  • exercism download --exercise=pangram --track=javascript
  • the client proceeded to delete my completed pangram.js
  • and replace it with the empty template from the exercise

What I was expecting to happen:

  • The .exercism metadata to be created and my already solved solution to be IGNORED and left in place.

What we've discussed on the Slack:

  • Perhaps if Exercism sees a folder that does not belong to it (has no .exercism file) it raises a hard error and refuses to touch the folder, requiring manual intervention.
  • Someone suggested a --force option to tell the client to be forceful and proceed regardless

Then it would follow that the two cases that the Exercism client can muck with your filesystem:

  • The exercise folder does not already exist
  • The exercise folder does exist, but has an .exercism directory flagging it as "owned" by Exercism.
Dominant language
Go
Stars
1.4k
Forks
363
Avg merge
6d 13h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/cli

All issues in exercism/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.