Community
Participate
Working Groups
When the mirroring application (both metadata and artifact repo) creates the target repository, then all the properties of the source repo should be moved to the new repo. This includes things like the name, the mapping rules, etc...
Would you be able to elaborate on the behaviour you'd like to see? I'm looking at how metadata's mirror application works and it seems easy enough to modify "initializeFestination()" to take a repo as a parameter and just do some "destination.setDestription(source.getDesription());" calls if loadRepository fails. What I'm a bit vague on is which attributes are important/are transferable, how are we treating preexisting destinations, and also the default naming scheme seems to be [repo's location] + " - [type of data]" which could get confusing for users (although we could easily say that issue is out of our scope).
(In reply to comment #1) > how are we treating preexisting destinations I just looked at Bug 249355. This only affects new repos so basically I'm thinking any solution for this will be a solution for that, which like I said, so long as I only transfer the properties AFTER the loadRepository fails is just a matter of writing a few extra test cases.
Created attachment 114199 [details] modified both MirrorApplication.javas. Added test cases. Changed the setupRepositories method to load the source before initializing the destination. If (and only if) the loadRepositories call in initializeDestination fails, we pass the source's name/properties to createRepository. Previously this was an arbitrary name and null respectively. The type is still set to simple repository. Will this create problems in the future? Added test cases to verify the repositories' names and properties after the application runs. Added assertRepositoryProperties to AbstractProvisionTest. assertEquals(Map, Map) would fail as we expect the value of the p2.timestamp key to change.
Released with minor changes. Closing.