Git-Path Plugin and URLs with Special Characters

4 views
Skip to first unread message

Jason Smyth

unread,
May 6, 2025, 12:01:36 PMMay 6
to GoCD Users
Hi all,

We seem to be encountering an issue with the git-path plugin related to URLs with spaces in them.

Sample error when passing url-encoded spaces:
jvm 1    | 2025-05-06 15:37:40,506 INFO  [151@MessageListener for MaterialUpdateListener] MaterialDatabaseUpdater:124 - [Material Update] Modification check failed for material: [url=https://dev.azure.com/MyOrg/ProjectName%20Has%20Spaces/_git/some_repo, username=myUser, password={{SECRET:[logins][myUser.PAT]}}, auto_update=true, branch=main, path=path/to/folder/] cause: java.lang.RuntimeException: The plugin sent a response that could not be understood by Go. Plugin returned with code '500' and the following response: '"Invalid URL format"'

Sample error when passing raw spaces:
2025-05-06 11:25:36.547 | jvm 1    | 2025-05-06 15:25:36,542 INFO  [159@MessageListener for MaterialUpdateListener] MaterialDatabaseUpdater:124 - [Material Update] Modification check failed for material: [ url=https://dev.azure.com/MyOrg/ProjectName Has Spaces/_git/some_repo, username=myUser, password={{SECRET:[logins][myUser.PAT]}}, auto_update=true, branch=main, path=path/to/folder/  ] cause: java.lang.RuntimeException: The plugin sent a response that could not be understood by Go. Plugin returned with code '500' and the following response: '"Invalid URL format"'

These same repositories work fine with the main Git material, but we want to use the git-path plugin for its filtering abilities.

Is there a way to get the plugin working with spaces (or other special characters) in the repository URL?

Is this a bug that we should open a GitHub issue for?

Any help or advice is appreciated.

Regards,
Jason Smyth

Chad Wilson

unread,
May 6, 2025, 12:17:34 PMMay 6
to go...@googlegroups.com
Generally speaking, yes it is better to raise issues in the right place since other people will find it there, and that plugin is not even under the main two Gocd GitHub orgs (I happen to also be a maintainer on it, but that's just due to history).

The URLs are validated against some "simple" regex for some reason, which doesn't allow spaces. I don't know where that logic came from. Possibly copy+pasted from some sample plugin or some old code within the GoCD server originally.

https://github.com/TWChennai/gocd-git-path-material-plugin/blob/0d6f256e2d07831c022d97d21b50c778331b4249/src/main/java/com/thoughtworks/go/scm/plugin/util/Validator.java#L12
https://github.com/TWChennai/gocd-git-path-material-plugin/blob/0d6f256e2d07831c022d97d21b50c778331b4249/src/test/java/com/thoughtworks/go/scm/plugin/util/ValidatorTest.java

--
You received this message because you are subscribed to the Google Groups "GoCD Users" 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 visit https://groups.google.com/d/msgid/go-cd/370d580d-2f2b-479d-a16e-9804842badf0n%40googlegroups.com.
Message has been deleted

Jason Smyth

unread,
May 7, 2025, 10:59:47 AMMay 7
to GoCD Users
Thank you for the feedback, as always, Chad.

Since you were able to confirm that this is an issue within the plugin, I opened an issue on GitHub.

Regards,
Jason Smyth
Reply all
Reply to author
Forward
0 new messages