[MGRENTITLE-3] mgr-tenant-entitlements - Prevent applications from being uninstalled if depended on Created: 31/Dec/23  Updated: 12/Jan/24  Resolved: 12/Jan/24

Status: Closed
Project: mgr-tenant-entitlements
Components: None
Affects versions: None
Fix versions: None

Type: Story Priority: P3
Reporter: Craig McNally Assignee: Dima Tkachenko
Resolution: Done Votes: 0
Labels: back-end, epam-eureka, eureka-phase4, need-review
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: File MGRENTITLE-3_disabling_apps_errors.mp4     File MGRENTITLE-3_disabling_apps_success.mp4    
Issue links:
Defines
defines UXPROD-4633 Manager Usability Improvements In Progress
Sprint: Eureka Sprint 42, Eureka Sprint 43
Story Points: 3
Development Team: Eureka

 Description   

If an application is being depended on, we should not allow it to be disabled, unless the applications which depend on it are also being disabled.  

Scope:

  • Return an error indicating that the application cannot be disabled because other applications enabled for your tenant depend on it.  This error message should include a list of those applications
  • Ideally not just those which directly depend on the application being disabled, but also those which indirectly depend on it.

NOTE:  Could mean traversing the tree of application dependencies from the target node (application) out to the leaves

NOTE:  May require schema changes and API spec updates 

NOTE:  Support for a ""cascade"" parameter is an interesting idea.  When cascade=true, the application(s) specified would be disabled for the tenant along with those which depend on it.  This is potentially dangerous, but also very convenient/powerful.  For now, let's keep this out of scope, but it's something to think about as a potential future enhancement. 

DEV NOTES:

  • This story relates to the hierarchical installation/hierarchical uninstallation
  • Should be done after this US1129694

Example 

Given:

  • app-foo depends on app-foo-core
  • app-foo-core depends on app-bar and app-baz.

Then:

  • trying to disable [ app-foo ] would result in an error indicating that [ app-foo-core, app-bar, app-baz ] would also need to be disabled.
  • trying to disable [ app-foo-core ] would result in an error indicating that [ app-bar, app-baz ] would also need to be disabled.
  • trying to disable [ app-foo, app-foo-core, app-bar ] would result in an error indicating that [ app-baz ] would also need to be disabled.
  • trying to disable [ app-bar] would succeed since nothing depends on app-bar
  • trying to disable [ app-baz] would succeed since nothing depends on app-baz
  • trying to disable [ app-foo, app-foo-core, app-bar, app-baz ] would succeed because all dependencies would still be satisfied after these applications are disabled.  

 



 Comments   
Comment by Natalia Zaitseva [ 31/Dec/23 ]

Exmaple: Given:app-foo depends on app-foo-coreapp-foo-core depends on app-bar and app-baz. Then:trying to disable [ app-foo ] would result in an error indicating that [ app-foo-core, app-bar, app-baz ] would also need to be disabled.trying to disable [ app-foo-core ] would result in an error indicating that [ app-bar, app-baz ] would also need to be disabled.trying to disable [ app-foo, app-foo-core, app-bar ] would result in an error indicating that [ app-baz ] would also need to be disabled.trying to disable [ app-bar] would succeed since nothing depends on app-bartrying to disable [ app-baz] would succeed since nothing depends on app-baztrying to disable [ app-foo, app-foo-core, app-bar, app-baz ] would succeed because all dependencies would still be satisfied after these applications are disabled.   

Comment by Natalia Zaitseva [ 31/Dec/23 ]

It's not possible to disable an application for a tenant if other applications enabled for that tenant depend on it.  It's possible to disable an application for a tenant if all other applications enabled for the tenant which depend on it are also disabled in the same callTests are updated and coverage is 80%+

Comment by Yauhen Viazau [ 03/Jan/24 ]

Tested on https://evrk.int.aws.folio.org/ - works as expected

Used the following app dependencies on "ok2" tenant:

  • "app-agreements" depends on "app-licenses"
  • "app-licenses" depends on "app-platform-minimal"

Scenarios:

  • Disable minimal → error
  • Disable licenses → error
  • Disable minimal, licenses, agreements in one API call → success (all three disabled)
  • Re-enable all three apps → Disable agreements → success (agreements disabled; licenses, minimal not disabled)
  • Disable licenses → success (licenses disabled; minimal not disabled)
  • Re-enable all three apps → Disable licenses, agreements → success (licenses, agreements disabled; minimal not disabled)

See examples: 

Generated at Thu Feb 08 22:18:07 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.