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

Add support to Save repository model #229

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RaimondB
Copy link

I have added support to enable the saving of a model to a local repository format.

There is now an extra command line option you can specify:
--modelrepository.saveModel "cloneFolder"

"cloneFolder" would typically be the same location you would use with the loadModel counterpart, but it does not have to be. As it is used the active model, it can also enable scenarios where you would load a normal .archimate file, but then save it in the Grafico format.

The save model will not be pushed as part of this commandline option, that is up to the user to decide and enables CI type of scenarios where the clone and the push would be executed by the CI pipeline.

@Phillipus
Copy link
Member

Comment from @jbsarrodie at #228 (comment)

Hi,

Thank you for this PR. I have some remarks though...

I don't think exporting to grafico is the right use-case (coArchi doesn't support it). Instead, I think we should have a "commit" option which exports the model to grafico and commits it, and a "publish" option which triggers the pull/merge/push.

The main reason is that nobody should use git commands to merge a model. As explained in several occasions, doing it outside coArchi leads to model corruption. So an option to save as grafico would encourage such misuse.

Of course, because of potential conflicts (even though in such automated context, doing the publish really soon after the clone of the model should really mower the risk), the "publish" action should take an attribute to decide what to do (choose "mine", "theirs" or "cancel").

@Phillipus
Copy link
Member

For my own part I'm not going to be doing any more on coArchi 1. My efforts now will be on coArchi 2.

@RaimondB
Copy link
Author

I don't think exporting to grafico is the right use-case (coArchi doesn't support it). Instead, I think we should have a "commit" option which exports the model to grafico and commits it, and a "publish" option which triggers the pull/merge/push.
The main reason is that nobody should use git commands to merge a model. As explained in several occasions, doing it outside coArchi leads to model corruption. So an option to save as grafico would encourage such misuse.
Of course, because of potential conflicts (even though in such automated context, doing the publish really soon after the clone of the model should really mower the risk), the "publish" action should take an attribute to decide what to do (choose "mine", "theirs" or "cancel").

I agree that things could go wrong when somebody commits in between and a merge is needed. For me, I do not see that as a problem since:

  • I have a protected master branch where nobody can commit directly
  • I am doing this in CI automation, and when there would be a merge conflict when trying to push, I would simply fail the pipeline and not push. Since the pipeline can be restarted, it would then do the same action on the latest master branch version, and the issue would not occur anymore.
  • The CI Automation will run daily at night, further reducing merge conflict risk :-)

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

Successfully merging this pull request may close these issues.

2 participants