bug(dtgithub): cloneRepo expands the literal string "projectPath" as its target directory and reports success without cloning
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
Direzione di ricerca
Start in pkg/dtgithub/github_repo_projects_store.go, reading projectCreator.cloneRepo and its CreateProject caller. Compare the intended local path with the path computed by addProjectToDataTugConfig, then confirm the desired clone-or-error behavior with the maintainer. Done means CreateProject no longer reports a successful clone when no clone occurred.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
projectCreator.cloneRepo resolves its local directory from the literal string "projectPath", not from any project path, and then clones nothing anyway. It returns nil regardless, so CreateProject reports the clone as successful.
Trigger
pkg/dtgithub/github_repo_projects_store.go:
func (c *projectCreator) cloneRepo() (err error) {
localDir := fsutils.ExpandHome("projectPath")
dirExists, _ := fsutils.DirExists(localDir)
if !dirExists {
parent := filepath.Dir(localDir)
_ = os.MkdirAll(parent, 0o755)
cloneUrl := c.repo.GetCloneURL()
if cloneUrl == "" {
cloneUrl = fmt.Sprintf("https://github.com/%s/%s.git", c.repoOwner, c.repoName)
_ = cloneUrl
}
//_, err = git.PlainClone(localDir, false, &git.CloneOptions{
// ...
}
return nil
}
"projectPath" has no ~ prefix, so ExpandHome returns it unchanged and the path is resolved relative to the process's working directory. The git.PlainClone call that would use it is commented out, and cloneUrl is computed and then discarded into _. The net effect is an os.MkdirAll on the current directory and nothing else.
CreateProject calls this between creating the repo and writing the project files, and treats the nil as "cloned":
if err = c.cloneRepo(); err != nil {
return fmt.Errorf("failed to clone GitHub repository '%s/%s': %w", c.repoOwner, c.repoName, err)
}
Expected
Either clone into the project's real local directory (~/datatug/github.com/{owner}/{repo}, as addProjectToDataTugConfig already computes), or return a "not implemented" error so the caller does not report success for work that never happened. A placeholder string should not be silently treated as a path.
Notes
Found while adapting the CLI to datatug-core v0.39.0's caller-supplied project id (#259); deliberately not fixed there, since finishing the clone is a feature decision rather than part of the id change. Third of three pre-existing defects on this code path — see the sibling issues on the panicking projectID split and on projectCreator's unset fields.
- Lingua principale
- Go
- Stelle
- 1
- Fork
- 0
- Merge medio
- 1h 50m
- PR unite (30g)
- 119
Preparare l'ambiente
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 85/100
datatug/datatug-cli#263 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
datatug/datatug-cli#261 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
datatug/datatug-cli#256 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
datatug/datatug-cli#260 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
datatug/datatug-cli#247 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di datatug/datatug-cli
Issue simili
-
Remove CAAPFApertakind/chore kind/cleanup needs-area
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
rancher/turtles#2848 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
priority: low 🌱 type: enhancement 💅🏼
Difficoltà 2/5 Mezza giornata Idoneità per principianti 84/100
nebari-dev/llm-serving-pack#199 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
kedacore/keda#8225 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno