aws / aws/git-remote-codecommit
URL parser silently ignores the "path" portion
- 主要言語
- Python
- スター
- 289
- フォーク
- 40
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
調査の方向性
git_remote_codecommit/__init__.py の95行目付近にある urlparse の処理から始めます。codecommit://profile@repository と、空でないパスを持つ同じURLのパースを再現し、後者が明示的な path-not-allowed エラーで拒否される一方、ドキュメントに記載された形式は引き続き受け入れられることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100