canonical / canonical/workshop
Bug: "Ghost" workshops after copying / deleting directory
- Dominant language
- Go
- Stars
- 108
- Forks
- 17
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 40
Description
This report covers a behavior considered to be a "bug" by the author because they describe behavior that is not expected, or difficult to accept: orphaned workshops are not mended, and they can only be removed by recreating the directory they were initially created in, without that directory serving any obvious function or purpose.
## "ghosts" after deleting/moving a working directory
### Steps to reproduce:
* create a new working directory
* create a workshop.yaml
* launch a workshop
* remove or rename/move the directory
* run `workshop list --global`
```
$ workshop list --global
PROJECT WORKSHOP STATUS NOTES
~/workspace/ai/design-workshop design Stopped -
~/workspace/ai/test-delete-workshop design Error missing-project
WARNING: There is 1 new warning. See "workshop warnings".
$ workshop warnings
last-occurrence: today at 12:05 CEST
warning: |
cannot find project directory
"/home/hartmut.obendorf@canonical.com/workspace/ai/test-delete-workshop" for workshop "design"
$ workshop remove -p test-delete-workshop
error: cannot create or load project at "/home/hartmut.obendorf@canonical.com/workspace/ai/test-delete-workshop": lstat /home/hartmut.obendorf@canonical.com/workspace/ai/test-delete-workshop: no such file or directory
$ mkdir test-delete-workshop
mkdir: created directory 'test-delete-workshop'
$ workshop remove -p test-delete-workshop
"design" removed
```
### Expected behaviour:
* ideally, there would be no orphaned workshop on move, at least after the newly named directory has been used
* it should be possible to remove a workshop without having to create a dummy, empty directory
Contributor guide
Research direction
Start by reproducing the scenario with `workshop list --global`, `workshop warnings`, and `workshop remove -p` after moving or deleting the project directory. Trace the project-loading and removal entry points used by these commands; done means orphaned workshops can be removed without recreating the missing directory and moved or renamed projects no longer remain as unusable entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100