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
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
Hướng nghiên cứu
Bắt đầu với createLocalProject trong apps/datatugapp/datatugui/dtproject/create_project_screen.go và so sánh cách xử lý đường dẫn của nó với LoadProjectFile trong pkg/storage/filestore/store_loader.go. Kiểm tra project_creator_test.go để xác nhận layout dự kiến ở cấp gốc. Công việc được xem là hoàn tất khi một project được tạo cục bộ có thể mở được và writer và reader thống nhất về vị trí của file project.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 1
- Fork
- 0
- Merge trung bình
- 16 giờ 2 phút
- Pull request đã merge (30 ngày)
- 120
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của datatug/datatug-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
datatug/datatug-cli#261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
datatug/datatug-cli#256 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Handle dal.IsNullCondition (isNull / isNotNull) in chat joins, access policies and compare-factsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
datatug/datatug-cli#316 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
datatug/datatug-cli#262 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
datatug/datatug-cli#247 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của datatug/datatug-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cloudflare/terraform-provider-cloudflare#7423 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
router-for-me/CLIProxyAPI#6746 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ViewData can pair the in-flight proposal with the prepared flag of another proposalCó thể đã có người làm @HagarMeir đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
hyperledger/SmartBFT#710 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100