I tried to configure two plugin repos: internal and updates.jenkins-ci.org (base) on my jenkins instance. For internal server I create my own update-center.json file. If I specify only my repo, or only base repo - I have no problems with plugin manager(plugins are displayed, installed and updated correctly).
But if I set two repos at the same time (by groovy script), I have a problem. I can see plugins only from one server but duplicated twice (or any other times depends on how much repos did I add).
Jenkins error log says that data was obtained without errors (signature fails or JSON parsing fails and others) from all repos - default and mine.
Unfortunately Plugin manager (via User Interface and Groovy scripts) shows that myUpdateSite.getAvailables and defaultUpdateSite.getAvailables contain same data, that is impossible according to contents of JSON update files.
UPD.
I seek through code and found the reason of that bug:
list of updates is generated by UpdateCenter.getUpdates();
UpdateCenter.getUpdates() ->(call) UpdateSite.getUpdates() for each update site in UpdateCenter.sites.
UpdateSite.getUpdates() iterates through ALL plugins from PluginManager.getPlugins() and gets only those that have new version.
That means that as a result we have a list which contains (all updates list)x(number of update sites). It works perfectly if we have only one update site.
I don't know the best way to fix it while preserving architecture integrity, so I ask someone to fix it.
I seek through code and found the reason of that bug:
list of updates is generated by UpdateCenter.getUpdates();
UpdateCenter.getUpdates() ->(call) UpdateSite.getUpdates() for each update site in UpdateCenter.sites.
UpdateSite.getUpdates() iterates through ALL plugins from PluginManager.getPlugins() and gets only those that have new version.
That means that as a result we have a list which contains (all updates list)x(number of update sites). It works perfectly if we have only one update site.
I don't know the best way to fix it while preserving architecture integrity, so I ask someone to fix it.
UPD.
I put this comment's body into the issue description, so it might be deleted now, but I have not such permissions.