Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(utils): expand parsable valid git remote url formats #771

Conversation

codejedi365
Copy link
Contributor

@codejedi365 codejedi365 commented Dec 14, 2023

Purpose

Expand the compatibility to as many variants of valid git remote urls as git allows

Rationale

In preparation to facilitate the request of #734, first we need to properly parse all valid git urls. I found a stackoverflow reference that listed many of the possible urls and I built a unit test to match a set of them. During implementation, I opted to coerce each input into an URL-parse compatible format which then could be easily broken up into the valid parts.

How I tested

Build a paramaterized unit test with all the expected valid tests.

How to verify

git fetch origin pull/771/head:pr-771

# checkout the PR as a detached HEAD state with only the unit tests
git checkout pr-771~1 --detach

# execute tests, 10 should fail with valid urls
pytest tests/unit/semantic_release/test_helpers.py

# update to the HEAD of the PR (with fixes)
git merge --ff-only pr-771

# run pytest again
pytest tests/unit/semantic_release/test_helpers.py

@codejedi365 codejedi365 force-pushed the fix/git-remote-url-parser branch 3 times, most recently from cc815f4 to 76658c1 Compare December 14, 2023 04:57
@codejedi365
Copy link
Contributor Author

@bernardcooke53, @relekang, would you mind doing a review?

Copy link
Contributor

@bernardcooke53 bernardcooke53 left a comment

Choose a reason for hiding this comment

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

In general looks good to me, just a couple of minor comments 🙂

tests/unit/semantic_release/test_helpers.py Outdated Show resolved Hide resolved
semantic_release/helpers.py Outdated Show resolved Hide resolved
@codejedi365 codejedi365 force-pushed the fix/git-remote-url-parser branch 2 times, most recently from 9b23f36 to c61a11f Compare December 20, 2023 01:56
@codejedi365
Copy link
Contributor Author

@bernardcooke53, thanks for the comments, fixed!

Copy link
Contributor

@bernardcooke53 bernardcooke53 left a comment

Choose a reason for hiding this comment

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

Looks good to me - thanks @codejedi365!

@bernardcooke53 bernardcooke53 changed the title fix(utils): expand parsable valid git remote url formats feat(utils): expand parsable valid git remote url formats Dec 22, 2023
@bernardcooke53 bernardcooke53 merged commit cf75f23 into python-semantic-release:master Dec 22, 2023
8 checks passed
@codejedi365 codejedi365 deleted the fix/git-remote-url-parser branch December 22, 2023 13:26
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.

None yet

2 participants