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

Repository rename check is case sensitive #901

Closed
kc1r74p opened this issue Aug 19, 2024 · 12 comments · Fixed by #903
Closed

Repository rename check is case sensitive #901

kc1r74p opened this issue Aug 19, 2024 · 12 comments · Fixed by #903
Labels

Comments

@kc1r74p
Copy link

kc1r74p commented Aug 19, 2024

Since the introduction of #886 in v10.1.5 the repositoryUrl vs clone_url check seems to have false positives.
We use the release as part of a monorepo, so it probably fetches the repo URL from the .git as the multiple package.json do not have the repo url in it in our case.

Details below, just adjusted host + repo. The https://[secure]@ part is 1:1 from the log and probably the reason why it detects the false positive.

[11:28:36 AM] [semantic-release] › ✘  EMISMATCHGITHUBURL The git repository URL mismatches the GitHub URL.

The semantic-release repositoryUrl option must have the same repository name and owner as the GitHub repo.

Your configuration for the repositoryUrl option is https://[secure]@github.example.com/org/repo.git and the clone_url of your GitHub repo is https://github.example.com/org/repo.git.

By default the repositoryUrl option is retrieved from the repository property of your package.json or the git origin url (https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.

Note: If you have recently changed your GitHub repository name or owner, update the value in semantic-release repositoryUrl option and the repository property of your package.json respectively to match the new GitHub URL.

AggregateError: 

    SemanticReleaseError: The git repository URL mismatches the GitHub URL.
....

The plugin loading does not seem to allow to enforce an older version ?
Had to manually adjust the packages after install to workaround the issue for now.

Would be nice to ignore the user section before the host in some fix.
Thanks

@kc1r74p
Copy link
Author

kc1r74p commented Aug 19, 2024

@jedwards1211 fyi

@jedwards1211
Copy link
Contributor

jedwards1211 commented Aug 19, 2024

@kc1r74p Okay sorry for the trouble, at first I thought parseGithubUrl must be erroring out on your URL, but I tried adding [secure]@ to a clone_url in a test and it didn't break the test. Were the org/repo.git portions of the URLs in the error message the same? Does git config --get remote.origin.url have a different org/repo than the clone_url from GitHub? git config --get remote.origin.url should be what repositoryUrl is defaulting to in your case.

@gr2m @babblebey I think we should add an option to disable this check...it seems hard to exhaustively determine what all the possible cases in the wild would be.

@kc1r74p
Copy link
Author

kc1r74p commented Aug 19, 2024

@jedwards1211 actually thanks for the hint, looking at it again the org is in the repositoryUrl lowercase, while in the clone_url it is uppercase.
Might the issue be with case sensitive checks ?
i.e. org vs ORG

Besides that the string should be equal.

@babblebey
Copy link
Member

I think we should add an option to disable this check...it seems hard to exhaustively determine what all the possible cases in the wild would be.

I agree @jedwards1211 that it can be very exhaustive to determine possible case 😭

But, add option to skip a check in the verifyCondition lifecycle 🫣!? That beats the idea being the lifecycle entirely

@jedwards1211
Copy link
Contributor

jedwards1211 commented Aug 19, 2024

@babblebey I mean to disable the repo rename check only, not all of the other verify checks.
It feels hard to predict when we will have caught all the edge cases on this, so I just want to give people a way to quickly work around issues with this without having to downgrade.

@jedwards1211
Copy link
Contributor

@kc1r74p okay, I didn't think about case sensitivity, btw are you using a private GitHub enterprise deployment?

@kc1r74p
Copy link
Author

kc1r74p commented Aug 20, 2024

@kc1r74p okay, I didn't think about case sensitivity, btw are you using a private GitHub enterprise deployment?

Yes, we are using GHES 3.11.13.

@gr2m
Copy link
Member

gr2m commented Aug 20, 2024

I'd avoid adding new options if at all possible

@gr2m gr2m closed this as completed in #903 Aug 20, 2024
@gr2m gr2m closed this as completed in 2b1b9b6 Aug 20, 2024
Copy link

🎉 This issue has been resolved in version 10.1.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jedwards1211
Copy link
Contributor

If anyone with permission could update the title to indicate the issue was about case sensitivity, it might help other people who run into this see that it's been fixed.

Thanks for bringing this to my attention @kc1r74p!

@gr2m gr2m changed the title New rename check breaks when repo url contains [secure] Repository rename check is case sensitive Aug 21, 2024
@gr2m
Copy link
Member

gr2m commented Aug 21, 2024

done! Happy to rename it to something else for more clarity, let me know what you'd prefer

@jedwards1211
Copy link
Contributor

Thanks, I think it's good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants