-
Notifications
You must be signed in to change notification settings - Fork 26
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
When there is only one open repository but lots of closed ones, WrongNumberOfRepositories exception is thrown #36
Comments
It sounds sensible to filter repositories by state in that method. Would you like to provide a PR with a fix (and an automatic test for that)? Btw, are those "hundreds" of closed repositories generated by the plugin or you have some other releasing activity causing that? In the first case #37 would be beneficial. |
@szpak it's other deployment activity, not the plugin. I will provide a PR. I am having a hard time getting the tests to pass though. Just running
Am I doing something wrong? |
There was one small issue with functional tests - #31, but it was fixed. Travis builds current master without any problem.
|
@szpak Sample stack trace;
Root cause is always the same "Plugin with id 'io.codearte.nexus-staging' not found." Windows 7 SP1 64-bit, Oracle JDK. |
Doesn't matter, travis worked for me too. I will just use that, rather then running locally. 👍 Cloud CI. |
The problem could be related to nebula-plugins/nebula-test#77. I created a separate branch for you - tech/windowsCompatibility - with new nebula-test (which is not a simple nebula bump as could be expected). You can give it a try. |
Yep. That fixed it for me. I had to upgrade the wrapper to 3.4 though (2.4 has a bug with version comparison and it would not take an newer version of Animal Sniffer) and include guava as a "compile" dependency because of usage of VisibleForTesting. Before it was included as part of nebula-test and obviously old gradle versions didn't really care about actual testCompile scope;)
The problem with my fix ofcourse is that promoteRepository does not work still ,ofcourse as there are hundreds of "closed" repositories in my case and it can't find JUST ONE. I think I can fix it for the case when close and promote are called together (by saving the repository Id in the close task like you do with the staging profile Id). I think this will fix the issue in my case, as I'll be ok with closing and promoting right away I guess while still maintaining compatibility for people that are lucky to only have just one closed repository. What do you think of this fix?
|
Available in 0.6.0. Thanks. |
Or am I doing something wrong?
io.codearte.gradle.nexus.logic.RepositoryFetcher#getOpenRepositoryIdForStagingProfileId method is called with ("open", stagingProfileId) and following the call stack it eventually reaches the
io.codearte.gradle.nexus.logic.RepositoryFetcher#verifyThatOneRepositoryAndReturnIt method which takes the response map and the
repositoryState
parameter. This parameter is never used. I have hundreds of "closed" repositories in a staging profile, but only one "open" one. This method of course throws a WrongNumberOfRepositories exception as it checks the response size only.Shouldn't it be:
People using this plugin, do you ever only have ONE repository in your staging profile and it's always open?
The text was updated successfully, but these errors were encountered: