-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Notify Commit: Ignore ssh subdomain to allow matching azure devops git ssh urls for notify #1758
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
base: master
Are you sure you want to change the base?
Conversation
…ok work with azure devops
https://github.com/jenkinsci/git-plugin/blob/master/CONTRIBUTING.adoc says: > Code formatting in the git plugin varies between files. Try to maintain > reasonable consistency with the existing files where feasible. Please > don’t perform wholesale reformatting of a file without discussing > with the current maintainers. New code should follow the SCM API code > style guidelines. The SCM API code style guidelines say: https://github.com/jenkinsci/scm-api-plugin/blob/master/CONTRIBUTING.md#imports For code in src/test: > * imports of anything other than JUnit classes and Hamcrest matchers are banned. > * static imports of anything other than JUnit classes and Hamcrest > matchers are strongly discouraged. > * import static org.hamcrest.Matchers.*, import static org.junit.Assert.* > are expressly permitted. Any other static * imports are discouraged > unless code readability is significantly enhanced and the import is > restricted to a single class.
My account on visualstudio.com uses:
Where can I find an Azure DevOps location that matches the URL's that are being changed here? As far as I can tell, my URL's don't fit the pattern that you're describing. I removed the import reformatting in e500fa1 because import reformatting causes merge conflicts in other pull requests. |
Hello @MarkEWaite Our https url looks like this While our ssh url looks like this: It's the general pattern for azure devops. visualstudio.com has been moved to dev.azure.com as also mentioned in the link above. A nice side effect with the new urls is that the path is actually the same for ssh and https - allowing the matching to work. |
I assume that must be the pattern for paying customers of Azure DevOps. I test with a free account and it remains https://markewaite.visualstudio.com/ with the repository hosted at I can't afford to purchase Azure DevOps in order to test the changes. Is there another way that I can be granted access to Azure DevOps at the dev.azure.com URL? |
According to azure devops website you can get unlimited free private repos. Also in your organization settings there should be an option to migrate the url from visualstudio.com to dev.azure.com See also here https://stackoverflow.com/questions/60279119/migrating-from-myorg-visualstudio-com-to-dev-azure-com-myorg I also checked the paths for cloning in azure devops again for https it looks like this: https://[email protected]/myorg/PROJECT/_git/repositoryname and for ssh like this: [email protected]:v3/myorg/PROJECT/repositoryname I assume it would also be required to replace /_git/ with / for the matching to work. I actually missed that part. I have added that change to the PR. |
I actually added the urls as they are used in azure devops to the unit test. There is also a version part in the ssh url (:v3/) which would need to be ignored. |
Thanks for the pointer. I found it in the organization settings and have moved my organization to https://dev.azure.com/MarkEWaite/ . Now I need to find all the locations that reference the old URL and replacement them with the new URL. |
Notify commit does not work with ssh and Azure DevOps.
Azure devops adds a "ssh." in front of the subdomain for git urls (ssh.dev.azure.com vs dev.azure.com). Hence the loose match for the host fails.
This is especially painful since azure devops jenkins plugin does not allow to send the ssh based url in the commit hook, but always sends the https based one.
I have updated the looselyMatches in GitStatus to ignore the prepended ssh. subdomain in the host.
Testing done
Added a unit test to check matching works and project is triggered.
Submitter checklist