GoCD 22.3 does not appear to allow windows file paths for git urls

22 views
Skip to first unread message

Funkycybermonk

unread,
Nov 9, 2022, 4:15:12 PM11/9/22
to go-cd
Hello!

It appears that on start, 22.2/22.3 at least try to validate the git urls in my cruise xml. The issue is that it doesn't seem to allow windows file or unc paths like <git url="\\domain\path\somefolder\repo" />. I can change them to something else temporarily but it appears that the xml validation will always fail. Is there a way to add alternate git path formats without a new build of the server? Or, if there is just an alternate way of legitimately addressing a unc path in GoCD in a different format it accepts. We can't pull it from outside every time because these run frequently and its a cost overhead for data being pulled in so it gets expensive over time. 

It appears to be tested using class isValidURL in UrlArgumentTest.java but the error is being thrown from ScmMaterialConfig.java I think.

Thanks!

Funkycybermonk

unread,
Nov 9, 2022, 5:50:18 PM11/9/22
to go-cd
It appears that I am able to change it from a unc path to a file protocol path to get the slashes the other direction and it does work. I'm not sure there is a specific reason but it actually seems to shave about 5 seconds off the time to pull the resources in. 

If this isn't a concern for anything else, I think I'm ok, it just might be helpful to Windows installs if there is a note that UNC paths no longer work and to use file://path instead.

Thanks!

Chad Wilson

unread,
Nov 9, 2022, 10:01:18 PM11/9/22
to go...@googlegroups.com
I am curious, does a UNC path work with `git clone` on the command line?

It's possible this happened as a side effect of strengthening the validation in 21.3.0 (https://www.gocd.org/releases/#21-3-0) due to https://github.com/gocd/gocd/security/advisories/GHSA-xx28-8pr9-6xqh

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/862032f5-ba19-4d4b-8a2e-6ad542b96125n%40googlegroups.com.

chan...@gmail.com

unread,
Nov 10, 2022, 8:43:03 AM11/10/22
to go...@googlegroups.com

UNC path cloning does work on Windows but I don’t know if its been all versions or just after a certain point. Its at least been working since ~2009 I think which is the oldest point I could quickly find that it was noted as being used. I don’t know the original version of GoCD we used but we’ve had 20.1 running for quite some time while trying to get an upgrade window. It did work in 20.5 at the migration point for a quick test of the migration prior to going on to 22.3 so I suspect 21.3 is the point it was affected.

 

I can clone to/from and between UNC paths using “git clone \\domain\path\somefolder\repo” into the folder I’m in as well as between such as “git clone \\domain\path\somefolder\repo \\domain\path\otherfolder\repo”. I had a clean upgrade from 20.1 to 22.3 yesterday but 22.3 wouldn’t start unless I faked out the URL and after poking around in source I found that list of allow/disallow rules that gave me the idea of trying file instead of direct UNC.

 

Using a stopwatch ([System.Diagnostics.Stopwatch]) there are obviously fluctuations in the time to clone from any source but locally using UNC I got 27 seconds on my larger repo, using file:// was 22 and https from the repo source was 1 minute 50 seconds. I’m not sure either file:// or UNC are universally faster because on a smaller repo its about 5 seconds slower at times for file:// than UNC.

 

It might be worth a note in docs about UNC not working vs file:// although I’m not sure from looking at the isValidURL class whether windows file paths would work like d:\folder\repo. At this point I’m functional and able to proceed with finalizing our internal notes before going to production with 22.3 in ~3 weeks.

 

Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "go-cd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/go-cd/mR7oBDTPqtc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH-qm6uJa%3Dy-cQgm30BPfw7a1623NbWvNRWXrYJYWf7Ucw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages