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
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
apps/datatugapp/datatugui/dtproject/create_project_screen.go の createLocalProject から始め、そのパス処理を pkg/storage/filestore/store_loader.go の LoadProjectFile と比較してください。ルートレベルで期待されるレイアウトについては project_creator_test.go を確認してください。ローカルで作成したプロジェクトを開くことができ、writer と reader がプロジェクトファイルの場所について一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 1
- フォーク
- 0
- 平均マージ
- 1時間 56分
- マージ済み PR(30日)
- 84
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
datatug/datatug-cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
datatug/datatug-cli#261 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
datatug/datatug-cli#256 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
datatug/datatug-cli#262 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
datatug/datatug-cli#260 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
datatug/datatug-cli#247 ·
メンテナーはふだん 1 日以内に返信
datatug/datatug-cli の issue をすべて見る
似ている issue
-
area/proxy kind/bug priority/backlog triage/accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
メンテナーはふだん 1 日以内に返信
-
area:chat bug sev:papercut
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Agent-Field/CodeAF#1592 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 7 日以内に返信
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug P2 reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
afreidah/s3-orchestrator#1564 ·
メンテナーはふだん 1 日以内に返信