aws / aws/git-remote-codecommit

URL parser silently ignores the "path" portion

Abierto
#47 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
289
Forks
40
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en git_remote_codecommit/__init__.py, en el manejo de urlparse alrededor de la línea 95. Reproduce el análisis de codecommit://profile@repository y de la misma URL con una ruta no vacía, y luego verifica que esta última se rechace con un error explícito de path-not-allowed, mientras que el formato documentado siga aceptándose.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
cli
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.