Book a Demo

Author Topic: EA and Subversion  (Read 8459 times)

ext

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
EA and Subversion
« on: November 25, 2007, 02:54:36 pm »
Hi all!

 I'm totally confused about how to use EA and SVN. I read the docs, browsed forum, but I can't get things working as I expected. Here is what I did:

1. I created a new project in .eap file
2. I created some models in it
3. I created a folder "models" in the folder containing my .eap file and put "models" folder under (sub)version control
4. I set up svn in EA for my project pointing "working copy path" to "models folder
5. I "configured" top level model and some sub-models to be version controlled (and placed in "models" folder).

So far so good. It was rather slow (poor connection?) but it worked, I was able to check out and check in my models.

Then Second User tried to use the models. He:
1. updated his svn sandbox
2. created new clean project (also .eap)
3. set up svn settings for his project
4. imported top level model.xmi

Then the top level model and it's submodels appeared in project browser. But only top level model (the one that represents a project i think) was marked as version controlled. Second User was not able to get submodels as version controlled (the only way was to mark submodels as configured, but Second User didn't want to create new models but to use the existing ones).

Since that we've tested plenty of different configurations but with no success, so I ask here:

What is the correct way of setting and using SVN with EA for the use case above (one project, some independetly versioned models, some users)?

Regards
Jakub


 

thomaskilian

  • Guest
Re: EA and Subversion
« Reply #1 on: November 26, 2007, 12:45:15 am »
Jakub,
after some fiddling with the build-in SVN of EA I decided to manually control my packages. I set the relevant packages under root to controlled. Now I can save them to XMI files that I store in a (Tortoise controlled) SVN directory. Every now an then I save the packages to the XMI files and issue a check-in for SVN. Others can check out these XMIs and can import them in their repository. Note that you always have to import XMIs twice in order to get references between two controlled packages right (this has been discussed in another recent thread). Concurrent changes to packages must be prevented by organizational means. You could use SVN locks for that, but usually it is better to simply use verbal communication ;)

One disadvantage is that you can not control package stubs but only complete package trees in that way. That makes handling a bit clumsy if you have a complex control structure because you need to re-build the structures manually rather than simply importing the root.

There might be other ways, but that's what I'm doing.

peter.zrnko

  • EA User
  • **
  • Posts: 253
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #2 on: November 26, 2007, 08:23:33 am »
I'm using SVN with EA for about 1 year and I didn't noticed what you have reported. We are using different scenarios.

But you are completely right. Please report it as a bug.
Peter

ext

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #3 on: November 26, 2007, 01:24:08 pm »
Quote
Jakub,
after some fiddling with the build-in SVN of EA I decided to manually control my packages. I set the relevant packages under root to controlled. Now I can save them to XMI files that I store in a (Tortoise controlled) SVN directory.

Ok, I've done the same here. I exported a root model and submodels to files and added these to svn.

Quote
Every now an then I save the packages to the XMI files and issue a check-in for SVN. Others can check out these XMIs and can import them in their repository.

You mean that others may import single XMI files into .eap file?

Quote
Note that you always have to import XMIs twice in order to get references between two controlled packages right (this has been discussed in another recent thread).

Twice? I'havent found the thread you wrote about :( I can't import the same model twice because it throws an error: "model exists".

In my case I imported (on an another user's machine) root Model.xml, changed localPath (to reflect different paths for configured models) and then I did some changes to a submodel. After that I had to right click the changed model and select save model to file to have changes reflected in this file. Global "save" button didn't work for me.

Quote
One disadvantage is that you can not control package stubs but only complete package trees in that way. That makes handling a bit clumsy if you have a complex control structure because you need to re-build the structures manually rather than simply importing the root.

There might be other ways, but that's what I'm doing.

Err.. what? When I don't use VC there is no checkbox to mark whether I want to use stubs or not. What do you mean by rebuilding the structures? Manually importing single files into eap project? I also tried this scenario but it still was not saving the changes to separate model XMI's by default (with global save button) :/

Thanks for you help but I still can't get it work in a right manner.

To be clear here is what I want to do:

- I have: some (2-3) analysts/designers, svn repository

- I don't have: central ftp server, anything to share one project file, instead of that I can put .eap to repository (but it is not so good because there should be different paths for each user inside .eap)

- I want:
I want each user to create his own .eap (in ideal case get the common one from repository), and then import the models into it. Then users shoud be able to work independently on models (locking the models for themselves using svn's lock or in scenario with EA's version control check-out). After their work they should be able to click save and perform commit (or check-in in scenario with EA's VC).
That's all.

- I got:
Users can create .eap, import models, but are not able to just edit a model click save and commit changed model's XMI. They have to right-click the model and select save model to file. Insane...

ext

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #4 on: November 26, 2007, 01:42:39 pm »
Quote
I'm using SVN with EA for about 1 year and I didn't noticed what you have reported. We are using different scenarios.

Would you like to share your scenario? I have a problem to understand the different scenarios EA supports so it will be very helpful.

Quote
But you are completely right. Please report it as a bug.

Yes... but I'm not sure whether I did something wrong or it's in fact a bug...

thomaskilian

  • Guest
Re: EA and Subversion
« Reply #5 on: November 26, 2007, 10:53:46 pm »
Quote
You mean that others may import single XMI files into .eap file?
 
Correct

Quote
Twice? I'havent found the thread you wrote about  I can't import the same model twice because it throws an error: "model exists".  
Wrong wording. I mean import once, but reload. The 2nd load fixes missing relations between different controlled packages. (I'll try to find the thread again.)

Edit::http://www.sparxsystems.com/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1194422662;start=10#10

Quote
Err.. what? When I don't use VC there is no checkbox to mark whether I want to use stubs or not. What do you mean by rebuilding the structures? Manually importing single files into eap project? I also tried this scenario but it still was not saving the changes to separate model XMI's by default (with global save button) :/
Yes. Strange that stub saving is only allowed with VC. No idea why Sparx limited this. And as you can't save stubs there is no real possibility to recursively save and reload a tree (except you VC the root only).

I know: not very helpful. :-/
« Last Edit: November 26, 2007, 10:56:05 pm by thomaskilian »

Arthur

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #6 on: November 29, 2007, 02:14:17 am »
Quote
I want each user to create his own .eap (in ideal case get the common one from repository), and then import the models into it. Then users shoud be able to work independently on models (locking the models for themselves using svn's lock or in scenario with EA's version control check-out). After their work they should be able to click save and perform commit (or check-in in scenario with EA's VC).
That's all.  


You are using controlled packages and not export/import? We are using controlled packages extensively and it works like a charm with subversion. Make shure all users have the same local path definitions though. The macro that points to your version controlled tree must be spelled the same by all users.

thomaskilian

  • Guest
Re: EA and Subversion
« Reply #7 on: November 29, 2007, 02:29:54 am »
Arthur,
happy to hear that someone else found that way too. :)

I hope Sparx will find ways to allow stub saving also with controlled packages. That would make it much more flexible. Somewhere one of the Sparxians explained why that was limited, but I did not really understand it (I claim it for my age).

ext

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #8 on: November 29, 2007, 02:39:30 am »
Quote
You are using controlled packages and not export/import?
We are using controlled packages extensively and it works like a charm with subversion. Make shure all users have the same local path definitions though.
 The macro that points to your version controlled tree must be spelled the same by all users.


Hmm.. Ok, I'm lost. It seems that there are:

1. Controlled packages for which I can:
 a) "save to file" throught model's context menu using "Package control" -> "Save to file"
 b) save throught "Project" -> "Batch export"

2. Export/import feature for any model, even not "controlled" one.

3. Version Control of packages.

Right now I try to get option 1 to work. I have an .eap project with some models in it and I've set each model's "batch export" to true. Then I've batch exported the project. Now I have bunch of files in my filesystem.

The problem is that after I change something in my model the changes are not saved in model's file but in .eap... So what are controlled packages for? Do I really have to manually export my models to files after I change something in them?


regards
Jakub
« Last Edit: November 29, 2007, 04:38:37 am by ext »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: EA and Subversion
« Reply #9 on: November 29, 2007, 04:43:10 am »
Quote
The problem is that after I change something in my model the changes are not saved in model's file but in .eap... So what are controlled packages for? Do I really have to manually export my models to files after I change something in them?
We have taken the view that "controlled Package" actually means "Transportable package  (Exportable/Importable)"  nothing more...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

ext

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #10 on: November 29, 2007, 06:18:03 am »
Quote
We have taken the view that "controlled Package" actually means "Transportable package  (Exportable/Importable)"  nothing more...

HTH

"HTH" - oh yes.. I think I understand it now.

In case I have exported models to XMI and put them to repo:

1. An another user has to create .eap project (EA)
2. Update his svn sandbox to get fresh versions of models files (XMI) and lock a choosen models if required (using any SVN Client),
3. Import models into .eap from XMI files (EA)
4. Reload them (package control -> load package from file) to set links between models properly. (EA)
5. Then the user is able to work on models, so he works (EA)
6. After finishing his work the user has to export changed models to files (context menu's package control -> save to file, or top menu's project->batch export) (EA) and commit them to repo (SVN Client)
7. some time flows
8. user updates his sandbox and gets new versions of models (SVN Client)
9. user starts EA, opens his .eap, then has to reload changed (all?) models (EA)
10. user is able to do some work... (EA)
11. etc.

One more thing is that all users have to set localPath with the same name.

If I'm not right, please correct me.

regards
Jakub

Arthur

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #11 on: November 29, 2007, 06:52:16 am »
This is the way we use controlled packages:
First user:
1. Right click package/Package control/Version control settings.
2. Click this model is private ( means this eap file is private)
3. Click new button
4. Enter a Unique ID (e.g RepositoryUml)
5. Select Subversion
6. Set the working copy path to the root of the subversion workspace
7. Point to the subversion executable
8. Save and close the version control configuration
9. Right click package/Package control/Configure
10. Click Control Package
11. Select the Unique ID (from 4.) in the Version Control drop down
12. Enter a filename in XMI filename (e.g MyPackage.xml)
13. Ok
14. Accept adding to version control, Enter log message.
Second user:
15. Create new eap file. Repeat points 1 to 8 above _exactly_.
16. Get the subversion package that contains the MyPackage.xmi file.
17. In ea project browser, right click where you want the package, select Package Control/Get Package
18. Select the Unique ID in Select a version control configuration.
19. Select the xmi file in Select shared file for
20. Ok

Now you can check out, edit, check in from ea. You must explicitly do Get latest if your collegues have updated the model after you did.
« Last Edit: November 29, 2007, 06:53:57 am by Arthur »

rgevaerd

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #12 on: November 29, 2007, 08:12:02 am »
Suppose I have a lot of packages with version control, each mapped to a XMI file in SVN.
A new user would have to manually recreate the whole structure in an empty EAP file?
Is there a better practice for this? May the EAP file be copied from another user? Or is there any feature to export/import the structure where the XMI files will be imported into, with those references included, so just import that in an empty EAP file and then when use version control to update the controlled packages?

Arthur

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #13 on: November 30, 2007, 12:04:01 am »
Quote
Suppose I have a lot of packages with version control, each mapped to a XMI file in SVN.  
A new user would have to manually recreate the whole structure in an empty EAP file?


We have a tree of controlled packages. If one follows the the procedure in my previous post, a new user needs to get all the packages but at least they snap to the right location in the tree. There might be a way of combining controlled packages with replicated eap-files. I haven't tried that yet though.

ext

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: EA and Subversion
« Reply #14 on: November 30, 2007, 03:03:07 am »
Quote

We have a tree of controlled packages. If one follows the the procedure in my previous post, a new user needs to get all the packages but at least they snap to the right location in the tree. There might be a way of combining controlled packages with replicated eap-files. I haven't tried that yet though.

Thanks a lot Arthur - your procedure allowed me to properly set up VC. It works! It works!

I've tried what will happend when I'll put my VC-configured .eap into svn, and when the second user will open it.

The effect of the above is that EA shouts that .eap is not configured and shows VC Setup dialog. User has to set up his local path and path to SVN.exe. After that everything seems to work ok.

To summarize - I decided to use configured packages and import/export/reload scenario. Pros: my users don't have to install svn with svn.exe. EA works faster - one doesn't have to wait until EA will talk with svn server.

regards
Jakub