bug(tui): a locally created project is written to <path>/datatug/datatug-project.json but read from <path>/datatug-project.json, so it cannot be opened
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Inizia da createLocalProject in apps/datatugapp/datatugui/dtproject/create_project_screen.go e confronta la gestione dei percorsi con LoadProjectFile in pkg/storage/filestore/store_loader.go. Controlla project_creator_test.go per verificare la struttura prevista al livello radice. Il lavoro è completato quando un progetto creato localmente può essere aperto e writer e reader concordano sulla posizione del file di progetto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
A project created locally from the TUI cannot be opened afterwards: the create flow writes the project file one directory deeper than the reader looks for it, so opening the project it just created fails with ErrProjectDoesNotExist.
Trigger
Writer — createLocalProject in apps/datatugapp/datatugui/dtproject/create_project_screen.go puts the file inside a datatug subdirectory:
datatugDir := filepath.Join(projectPath, "datatug")
// ...
configFilePath := filepath.Join(datatugDir, storage.ProjectSummaryFileName)
giving <projectPath>/datatug/datatug-project.json.
Reader — the same flow then calls openProject, which builds a store on projectRef.Path (that same projectPath):
store := filestore.NewProjectStore(projectRef.ID, projectRef.Path)
and datatug-core's filestore.LoadProjectFile joins the file name straight onto that path, with no datatug segment (pkg/storage/filestore/store_loader.go):
func LoadProjectFile(projPath string) (v datatug.ProjectFile, err error) {
fileName := path.Join(projPath, storage.ProjectSummaryFileName)
So the reader opens <projectPath>/datatug-project.json and nothing is there.
Core is consistent with its reader, not with this writer: filestore's own saver writes saveJSONFile(s.projectPath, storage.ProjectSummaryFileName, projFile), and dtprojcreator.CreateProjectFiles writes it at the project root too — core's project_creator_test.go asserts expectedPath := path.Join(projPath, storage.ProjectSummaryFileName). The TUI's extra datatug directory is the odd one out.
Expected
createLocalProject should write datatug-project.json at the project root, the one place every reader in core looks — or, if the datatug subdirectory is deliberate, projectRef.Path should point at it so the two agree. They must not disagree silently.
Worth deciding at the same time whether the now-empty datatug directory should still be created at all.
Notes
Found in review of #259, which changed the directory this file is written into (it is now named after the project id rather than the title) but not the layout below it — the mismatch predates that PR and is not fixed there. Sibling pre-existing defects on the neighbouring GitHub create path: #260, #261, #262.
- Lingua principale
- Go
- Stelle
- 1
- Fork
- 0
- Merge medio
- 1h 56m
- PR unite (30g)
- 84
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di datatug/datatug-cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
datatug/datatug-cli#261 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
datatug/datatug-cli#256 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
datatug/datatug-cli#262 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
datatug/datatug-cli#260 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
datatug/datatug-cli#247 ·
Tutte le issue di datatug/datatug-cli
Issue simili
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
infiniflow/ragflow#20223 · 1 reazione ·
-
bug needs triage pkg/translator/faro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 commento ·