Bug 249353 - [mirror] When the target repo is created, copy the properties
Summary: [mirror] When the target repo is created, copy the properties
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Andrew Cattle CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-10-01 13:29 EDT by Pascal Rapicault CLA
Modified: 2008-11-05 16:13 EST (History)
1 user (show)

See Also:


Attachments
modified both MirrorApplication.javas. Added test cases. (29.74 KB, patch)
2008-10-03 10:54 EDT, Andrew Cattle CLA
dj.houghton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2008-10-01 13:29:12 EDT
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...
Comment 1 Andrew Cattle CLA 2008-10-02 11:42:42 EDT
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).
Comment 2 Andrew Cattle CLA 2008-10-02 11:47:04 EDT
(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.
Comment 3 Andrew Cattle CLA 2008-10-03 10:54:01 EDT
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.
Comment 4 DJ Houghton CLA 2008-10-03 18:03:24 EDT
Released with minor changes.
Closing.