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
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start with createLocalProject in apps/datatugapp/datatugui/dtproject/create_project_screen.go and compare its path handling with LoadProjectFile in pkg/storage/filestore/store_loader.go. Check project_creator_test.go for the expected root-level layout. Done means a locally created project can be opened and the writer and reader agree on the project file location.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 1
- Forks
- 0
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 141
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from datatug/datatug-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
datatug/datatug-cli#261 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
datatug/datatug-cli#256 ·
Maintainers usually reply within 1 day
-
Handle dal.IsNullCondition (isNull / isNotNull) in chat joins, access policies and compare-factsOpen
Difficulty 4/5 3-5 days Newbie friendliness 55/100
datatug/datatug-cli#316 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
datatug/datatug-cli#262 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
datatug/datatug-cli#247 ·
Maintainers usually reply within 1 day
All issues in datatug/datatug-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
txn2/mcp-data-platform#2030 ·
Maintainers usually reply within 1 day
-
area/tests theme/ci-dx
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
ai-inspected
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
[Bug]: e2e script flag parsing is brokenPossibly taken @ericcurtin claimed this today. Openarea/dev-infra area/tests kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
agent-substrate/substrate#2217 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: multi-arch `vgpu-device-manager` image digest not pinned in OLM bundlePossibly taken @MrBeldum claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NVIDIA/gpu-operator#3012 · 1 comment ·
Maintainers usually reply within 1 day