archi-contribs / database-plugin

Database export/import plugin that store models in a central database repository
Other
81 stars 23 forks source link

Issue: Limit Result Set in Import Components from DB & Feature: Refresh elements in a view using a context menu #147

Open jayanthsunchu opened 2 years ago

jayanthsunchu commented 2 years ago

Hello

First of all, thank you for the awesome plugin. We use your plugin in combination with coArchi so that our architecture teammates can collaborate.

Background: We have a Postgres database that is refreshed weekly which has all the elements (apps/services etc., in our application portfolio) and all the metadata (properties) associated to those elements. We have a model in github that we work on (contributions from multiple architects using coArchi) and we use import components to pull any new elements and their metadata into the model.

Issue: The Postgres database is common throughout the org (app portfolio across the org) and thus has > 5k elements, so in the Import Components dialog box, when we search for elements by just selecting elements or by using the name filter text box, it ends up not responding because of the huge result set and the fact that the query is fired every time we type a letter in to the name filter textbox. We usually end up force closing Archi.

Manual Workaround: We type the full text that we want to search for in the name filter text box, when Models radio button is selected and then switch to elements radio button so that we don't have this issue. Everytime we forget doing this we force close Archi.

Fix: Open for other ideas on how we can fix this but one idea that I tried out in my local was to limit the result set to 100. Right now, I only have code to limit it for a Postgres database query but I can add fixes for others. Let me know if you think this is okay and I can submit a PR or if you have any other better ideas of how to fix this issue and I can work on this.

Feature Request: As I mentioned earlier, we pull the elements from a Postgres database which gets refreshed weekly. Typically, we don't have any major updates to the existing elements but once in a while we add/update metadata. We wanted to be able to refresh the metadata (properties mainly) using a simple context menu in the context of a view (right click on an archimate view and click Refresh elements from DB). In the context of a view because the architects have control over what they refresh and takes less time compared to refreshing the whole model (again we have > 5k elements). I have this also working on my local, I can submit a PR if you think this makes sense or we can discuss other ways to enable this feature and I am open to working on it.

(Images for the feature request built in my local attached for reference - fyi, I did use the 2.2.16 code because that's what we use I will obviously submit the PR if you agree with the latest)

Thanks again for the awesome plugin. Sorry about the long explanation. RefreshInContextMenu RefreshSummaryView

herve91 commented 2 years ago

Hi, Thanks for raising those points.

Regarding the import components window, I do not really its look and fell and will probably completely rewrite it at some stage. Nevertheless, changing the behaviour of the filter and add a "apply" bytton rather than sending a SQL request to the database on every keystroke is very straight forward. Adding a request limit to get "pages" and showing "next" and "previous" buttons to navigate across pages should not be very complex either.

They will be part of the next release.

Regarding your feature request, I do not really see the use case, but I am ready to discuss it further :)

Basically, when you import a model from your database, you can choose the version to import, let say as an example:

image

Importing version 4 will import the model as it was when vesion 4 has been exported in the database (thus you would not import the updates dones on the components after this export).

But importing latest version will import the latest version of all components, as they've been updated by your external process.

Is it what you're searching for ?

jayanthsunchu commented 2 years ago

Totally agree with the fix for limiting result set using Apply button or multiple pages showing "next" and "previous".

On the feature request, I see how it might not be a valid use case for everyone, ours is a weird scenario where we don't import the full model or export the full model back to the database, just pull the added/updated components from the model in the database. This is because even though we have a common app portfolio under the big org (which is refreshed in the db weekly), we work as part of a specific division which needs its "own" model so we pull components we need from the model in DB but use coArchi and archi reports to collaborate and distribute the division's specific Archi model. Hope that makes sense.

Also, let me know if you could use another hand for the result set fix and any features in the roadmap where you could use another hand, I am willing to contribute. Thanks again :)