archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
153 stars 52 forks source link

jArchi pre-commit hook #183

Closed dwinkler-oebb closed 2 years ago

dwinkler-oebb commented 2 years ago

Hi @Phillipus,

This pull request is a following up my question in https://github.com/archimatetool/archi-scripting-plugin/issues/77#issuecomment-905787803

Btw, I am planning to use this feature when a user publishes a Change via the "coArchi" Plugin to the git Repo. Is there some way of "event hook" for "before commit" or "after push" to hook into this workflow with a jArchi script?

Thanks in advance!

For realizing my envisioned Archi workflow it prepared this pull request since there is currently no integration of jArchi & coArchi.

This pull-request realizes the following:

Kind regards Dominic

Phillipus commented 2 years ago

Thanks for putting in the effort for this PR (ideally it should be a draft PR)

We have to assume that not all coArchi users also use jArchi. Furthermore, coArchi and jArchi should know nothing of each other, so I see some problems with this and the other PR.

  1. Adding a reference to jArchi in coArchi's preference pane should not be done here
  2. Adding the callPreCommitScript method should not be done here

On the other PR (https://github.com/archimatetool/archi-scripting-plugin/pull/100) the problems are:

  1. The cleanFolder(String path) method - this is a very specific method and we shouldn't add this here

What may be useful is the proposed jArchi RunScriptHandler command with some changes.

Ideally the way to do something like this is:

  1. Add a more generalised RunScriptHandler command in jArchi that can be called as you do it in callPreCommitScript. The parameter should be a full absolute path. The console should not be opened.
  2. Add an Eclipse extension point in coArchi for pre (and perhaps post) commit so that code such as callPreCommitScript can be called from the extension in a separate plug-in.
  3. In the extension plug-in, add the additional Preference pane option(s)

And another consideration is that this may be more suited to coArchi 2.

Phillipus commented 2 years ago

@dwinkler-oebb I'll close this PR for the reasons in the comment above.