Skip to content
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

Extend Archi plugin to provide a simple way to save a local model to a remote repository without any actions outside Archi itself. #15

Closed
jbsarrodie opened this issue May 19, 2017 · 15 comments

Comments

@jbsarrodie
Copy link
Member

This requires to choose a Web based Git System that provides API or equivalent solution to create repository remotely...

@Phillipus
Copy link
Member

And I think might require SSH certificate authentication?

@Phillipus
Copy link
Member

If the model already exists locally on the file system then we have to think about how this will work given that we use a "temp.archimate" file in a local repo folder.

@jbsarrodie
Copy link
Member Author

jbsarrodie commented May 23, 2017

Some comments...

And I think might require SSH certificate authentication?

I can see several solutions:

  • Use the API provided by the GitHub-like git server. Cons: there is no standard API, so this would bound us to only one product.
  • Use SSH to execute a git init on the server. Cons: this requires SSH access which in turn requires a socks proxy in most real life cases, and I'm not sure doing a git init is enough (there might be some application side configuration)
  • Use a GitHub-like server that allows to create the repository on push. That's my prefered option as several products allows it, and this is pretty straightforward.

So I suggest to test using GitBlit. GitBlit is a simple but effective GitHub-like solution that can easily be installed and customized (I recommend the GO setup). Then you have to enable the git.allowCreateOnPush option in the gitblit.properties. This option does the following:

Allow an authenticated user to create a destination repository on a push
if the repository does not already exist.

Administrator accounts can create a repository in any project.
These repositories are created with the default access restriction and authorization control values.
The pushing account is set as the owner.

Non-administrator accounts with the CREATE role may create personal repositories.
These repositories are created as VIEW restricted for NAMED users.
The pushing account is set as the owner.

If the model already exists locally on the file system then we have to think about how this will work given that we use a "temp.archimate" file in a local repo folder.

I think we should just tell the user that after having saved the model on the server he should no more use the original .archimate file (and suggest to close it to avoid mistakes).

@Phillipus
Copy link
Member

Phillipus commented May 25, 2017

I'm trialling GitBlit set up on localhost.

One thing to note is found here http://gitblit.com/setup_transport_http.html

I had to set http.sslVerify to false in order to perform git actions. Note that this is a global setting. You can't set it in the local config file because it has to be set before cloning.

@Phillipus
Copy link
Member

I'm able to create a new blank repo locally and push it to GitBlit. So, all the pieces are working (assuming that GitBlit is configured correctly and that "http.sslVerify" is false). Probably needs more work on catching authentication errors and certificates.

Now it's time to create a workflow and UI.

  1. User has an existing Archi model and wants to share it
  2. User wants to create a new Archi model and share as well

Take case 2 to start with

  1. User presses button "Create New Model and Share"
  2. Wizard / dialog asks for a model name, remote git URL, user name and password
  3. New local repo is made ("git init")
  4. New temp.archimate model is created
  5. Grafico export to xml files
  6. Do a first commit (perhaps get the commit message from user in dialog?)
  7. Push to remote (give user choice to do this now or later?)

@jbsarrodie
Copy link
Member Author

I'll test ASAP.

IMHO we should focus on case 1 because it is the one that create more value (and the one I had in mind for this story): people will have already existing models that theyr want to share.

I'm creating #19 for case 2

@Phillipus
Copy link
Member

Most of the functionality of case 2 is the same for case 1. Case 2 is easier to start with.

@jbsarrodie
Copy link
Member Author

Most of the functionality of case 2 is the same for case 1. Case 2 is easier to start with.

Ok, in this case just consider that you work on #19 and come back later on this one :-)

@Phillipus
Copy link
Member

After trialling different methods I've come to the conclusion that there is no need to add an extra menu item in the plugin. The actual context for this is the model whether it is a new unsaved model or an existing model not in the repository. Maybe this was the intent of @jbsarrodie and I misunderstood.

What I am developing now is based on the two use cases above but as follows:

  1. User has an existing Archi model and wants to share it
  2. User creates new blank model and wants to share it

The only difference is that (2) just has not been saved

The action is a context menu item on a selected model in the tree and on the "Tools" menu:

image 1

@jbsarrodie
Copy link
Member Author

That's exactly what I had in mind !

@Phillipus
Copy link
Member

Phillipus commented May 29, 2017

That's exactly what I had in mind !

Good because we can close the other issue now. That case is solved by creating a new blank model and then choosing the share option.

@Phillipus
Copy link
Member

The dialog for adding repo and user details asks for URL and model name The idea is to concatenate them together to create the repo url and name like this:

url = https://www.somegitblitrepo.net/r/
model name = newmodel

result = https://www.somegitblitrepo.net/r/newmodel.git

I'm not sure I like this, and it may not work in all cases. I suggest we remove the model name field and rely on the user providing the full url for now.

@jbsarrodie
Copy link
Member Author

I suggest we remove the model name field and rely on the user providing the full url for now.

I'd prefer to keep it like that because we might in the future make the url a parameter in preferences and just let user choose model name...

@Phillipus
Copy link
Member

The problem is whether to add ".git" on the end automatically or not.

@jbsarrodie
Copy link
Member Author

I'm closing this issue. We'll see later if and how to refine it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants