Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#263 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli

調査の方向性

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

datatug/datatug-cli のほかの issue

datatug/datatug-cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。