Skip to content

Expand Git repo URL normalization#162

Merged
merenbach merged 13 commits intoargoproj:masterfrom
merenbach:normalize-git-repos
May 5, 2018
Merged

Expand Git repo URL normalization#162
merenbach merged 13 commits intoargoproj:masterfrom
merenbach:normalize-git-repos

Conversation

@merenbach
Copy link
Contributor

@merenbach merenbach commented May 4, 2018

To resolve #138:

  1. Lowercase repo URLs before they are hashed for purposes of secret creation. This will break all existing repos that have ANY uppercase characters, thanks to hashing differences.
  2. Ensure that all added repos have a .git suffix during normalization. This will break all existing repos that were added without a .git suffix, thanks to hashing differences.
  3. Consider repo URLs to be SSH repos if they start with git@ (existing behavior) or if they begin with ssh:// (new behavior). All SSH prefixes will be stripped at the end of the normalization process.
  4. Normalization will now return an empty string if the URL does not parse. Since rootless GitHub URLs won't parse as-is, an SSH scheme is added to these, then stripped at the end.
  5. Refactor and add additional tests for Git- and Git-repo-related functionality in the util/git module.

Copy link
Member

@jessesuen jessesuen May 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some tests where the input is missing the .git suffix, and added after normalization?

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough job and tests!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add one where "https://github.com/argoproj/argo-cd.git" also maps to "repo-argo-cd-821842295"

@merenbach merenbach merged commit 3f4ec0a into argoproj:master May 5, 2018
@merenbach merenbach deleted the normalize-git-repos branch May 7, 2018 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize git repo URLs

2 participants