Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
How do I monitor a simple SVN repository that has no branches?
-
I have my source code in a very simple SVN repository that only has my project in it. There's no trunk, branches or tags, just the code tree. This works fine for my needs, and I'm not interested in discussing whether or not this is a good way to organize my SVN repository.
I want to use the SVN repository monitor to detect when the latest revision of a specific folder in my repository has changed, and trigger a build. However, after setting up my repository monitor, I keep on getting the following error:
System.InvalidOperationException: svn: warning: W160013: '/svn/project/!svn/rvr/231/branches' path not found svn: E200009: Could not list all targets because some targets don't exist at Inedo.Extensions.Subversion.SvnClient.<EnumerateBranchesAsync>d__16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Inedo.Extensions.Subversion.RepositoryMonitors.SvnRepositoryMonitor.<GetCurrentCommitsAsync>d__23.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Inedo.BuildMaster.Windows.ServiceApplication.RepositoryMonitorRunner.<CheckRepositoryAsync>d__3.MoveNext()
It seems like the repository monitor is expecting for my repository to have a specific structure (have a "branches" directory), and since the repository is not organized in that way, it throws an error.
Is there a way to have a repository monitor simply monitor a directory? no branches or anything else?
Thanks
-
Hi @Panda ,
I'm not really familiar with SVN, but I'll do my best to help :)
It looks like our code just assumes that there is a
/branches
directory, and that's why it's crashing.The repository monitor will enumerate the branches to find the most recent revision numbers, and then trigger builds as appropriate.
The code that enumerates branches seems to do the following call
svn ls --xml "«repo-url»" "branches/"
, and then parse the results. But it's failing, becausesvn
is erroring withE200009
.So it would require some sort of code change to get this working. Perhps a flag on the repository monitor, or something like that? If you have any ideas, maybe it's something we can try -- it's easy to get pre-release versions out there.
Cheers,
Alana
-
@atripp Thank you very much for your reply. It is a refreshingly quick, honest and straightforward answer that you rarely see from developers nowadays.
I see. My suspicions were spot on. If the tool expects for there be a "branches" directory, It is quite understandable it breaks when it finds a different structure.
In my opinion, you could just remove the code that adds "branches" to the command. In SVN, "branches" is just a directory that, by convention, a lot of people use to store their branches in, but it is a directory that has nothing special by itself. I can reasonably assume that by removing that, the plugin will work, and instead of monitoring "branches", it can monitor "directories", which is a more generalized solution.
That said, this would be a breaking change, as people who depend on this behavior, would now have to change their settings, and start monitoring the "branches" directory, instead of the directory above.
I didn't know the source code for these plugins was available. I'll probably just make a variant for my own needs. If you have information on how to build my own plugins, that would be great, but I can also look for it myself.
Thanks
-
You could potentially add a new field called "subdirectory to monitor", and have its default value be "branches". That way existing users could migrate to the new version, while getting the previous behavior, and new users can change this to get the new behavior.
You would also need to change other places that mention "monitored branches" and similar terminology, to "monitored subdirectories" though.
Even better, you can add another field called "monitor subdirectories" with a default value of true. In my case, I don't really want to monitor subdirectories, just one directory.
I'll probably play around with the plugin code to see what I can do.
Thanks
-
Hi @Panda ,
That sounds like a great idea; I'm afraid we won't have the resources to add this in the coming weeks (we have some really cool stuff planned for BuildMaster 2022 that we're working on now).
The easiest way to do local-development on the extension is to get the source code from GitHub, then build it into dll. Then, construct a new version of the Subversion.upack file with your DLL, and replace the one in the existing extensions folder. From there, restart the web/service, and your version should load instead.
If you add properties to
SvnRepositoryMonitor.cs
that look like the other properties, they should show-up in the UI and be configurable.Let us know what you come up with, and we can definitely merge in the code and release a new version with your changes.
Cheers,
Alana