roxy icon indicating copy to clipboard operation
roxy copied to clipboard

bootstrap does not remove amps

Open dmcassel opened this issue 8 years ago • 7 comments

If you remove an amp from ml-config.xml and then bootstrap, the amp is not removed.

Since amps are written to the Security database, which is likely shared among multiple applications, I'm not sure what a good way to address this is.

dmcassel avatar Oct 25 '16 14:10 dmcassel

@dmcassel I tried a couple combinations of wipe with/without apply-changes=amps and it seemed to wipe whatever's defined in ml-config each time I tried. Do you have a case you can share where it doesn't work?

RobertSzkutak avatar Oct 26 '16 03:10 RobertSzkutak

Sorry, I misstated the problem. Time to edit.

dmcassel avatar Oct 26 '16 11:10 dmcassel

Ah, that makes more sense. How do we handle roles and privileges? Don't those also become orphaned in the Security Database? I'm not sure if it makes sense for Roxy to be responsible for managing assets outside of whats defined in ml-config.

One idea, we could add an attribute to assets in ml-config like: @ignore-bootstrap='true' which would allow us to only consider these assets when wiping as well as remove them if they exist on bootstrap. Thus, you could effectively deprecate an asset. IMHO, this would be an enhancement opposed to a bug though. And we may as well add @ignore-wipe='true' support even though I'm not sure it could be used as much more than accident-proofing.

What do you think?

RobertSzkutak avatar Oct 26 '16 12:10 RobertSzkutak

Haven't given much thought to a solution yet, or looked at how we handle roles and privileges. I suspect we have the same problem. Wanted to capture this when I noticed it.

One option (to consider along with your ideas) is to make removing security assets an interactive process:

  • ml remove role
  • Roxy prompts for each role in ml-config, keep or discard?
  • on discard:
    • "should users with this role be removed or drop the role?"
    • delete or modify users as needed
    • delete role
    • remove role specification from ml-config.xml

Likewise for users, amps.

dmcassel avatar Oct 26 '16 13:10 dmcassel

I like where that's going. However, if multiple people are working on a project across multiple environments, how could it make sure that all people remove the correct assets from all environments after ml-config changes from one person are pushed back into a shared repo? I think we'd still need a mechanism to maintain the deprecation in order to ensure its propagated across all environments correctly.

RobertSzkutak avatar Oct 26 '16 13:10 RobertSzkutak

This also occurs when someone decides to change the name of a user, role, amp or whatever. Changing ${app-name}-my-role into ${app-name}-our-role is already enough to get an orphaned artifact..

Most sensible thing I could imagine to do in wipe would be to scan through those Security items, and look for anything starting with ${app-name}-. If anything is lingering after wipe itself completed, we could warn about it, and suggest to remove it using something like ./ml env wipe --users=my-app-org-user --roles=.... etc.

An interactive mode to wipe (--interactive flag?) sounds intriguing too, but perhaps worth a separate ticket..

grtjn avatar Jun 07 '17 14:06 grtjn

We could print a similar warning at bootstrap too, actually, though comparing to ml-config..

grtjn avatar Jun 07 '17 14:06 grtjn