aws / aws/git-remote-codecommit

URL parser silently ignores the "path" portion

Aperta
#47 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
289
Fork
40
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The documented URL format is `codecommit://profile@repository`, where "profile" is effectively placed as the username and "repository" as the hostname when following typical URL rules.

The parsing code uses [`urlparse`](https://github.com/aws/git-remote-codecommit/blob/5ed175190c584bef20eceb84c1eb5aaafec22cf7/git_remote_codecommit/__init__.py#L95) and then inspects the various parts, but it totally ignores the path portion of the URL.

The tool will therefore accept a URL like `codecommit://profile@repository/any/other/nonsense`, but will silently discard the path and just treat it the same as `codecommit://profile@repository`, therefore still cloning the entire repository.

Since the path portion has no meaning, I'd suggest making it an error to specify a non-empty path, explicitly stating that a path is not allowed. Because Git repositories conceptually contain a filesystem subtree, it's tempting for someone to think that a path portion will clone a subdirectory of the repository, even though that's not technically possible due to how Git works. Returning an error would therefore give better feedback to someone who has made that mistake.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in git_remote_codecommit/__init__.py, nella gestione di urlparse intorno alla riga 95. Riproduci il parsing di codecommit://profile@repository e dello stesso URL con un percorso non vuoto, quindi verifica che quest'ultimo venga rifiutato con un errore esplicito path-not-allowed, mentre il formato documentato continui a essere accettato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
cli
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.