bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

CLI `reconcile` cmd should be able to remove rings and services from the hld repository via the lifecycle pipeline

Open mtarng opened this issue 5 years ago • 6 comments

As a: SPK User

I want: To be able to remove rings and services via spk and pipelines

So that: I don't have to manually remove them and worry about conflicts.

Describe the solution you'd like:

  • [x] As a user, if I remove a ring, then the changes are reflected in: the associated bedrock.yaml, my hld repository, and the materialized repository.
    • for every service in my application reppository, every service to have the removed ring… removed
    • p-1: delete just the ring directory for every service
    • p-unicorn: delete the configuration for the ring at every level it is referenced in the HLD
    • idea: copy all config content into memory, mapped by path, blow away existing HLD, re-generate new HLD based on bedrock.yaml, emit config content in memory to config files at path.
      • ¡idempotent!
    • https://github.com/microsoft/bedrock/issues/1118
  • [x] (low pri) As a user, if I remove a service from my mono-repository, then the service should be removed from the associated bedrock.yaml, my hld repository, and the materialized repository.
    • Need spk service delete command first. for full testing work flow, but reconcile will remove services that have been removed from a project bedrock.yaml
    • same operations as just removing a ring itself.
  • [ ] (low pri) As a user, if I remove an external dependency (ie. Kafka, MongoDB) from my mono-repository, then:
    • [ ] then the external dependency should be removed from the associated bedrock.yaml, my hld repository, and the materialized repository, if and only if, it is not also being utilized by any other mono-repository linked to the same HLD and Materialized repositories.
    • Related task on managing external dependencies: https://github.com/microsoft/bedrock/issues/824
  • [ ] As a user, if I wish to delete a service repository or mono-repository, how would this be reflected in the downstream (HLD, ultimately flux) repositories?
    • low-pri - no identified case yet

Acceptance Criteria: If i have multiple bedrock application repositories (or even many mono-repositories) removing a shared referenced dependency from one, should not impact other repositories.

Describe alternatives you've considered: Running spk hld reconcile locally/manually or through automation pipelines.

Additional context: Previous work to add rings and services https://github.com/microsoft/bedrock/issues/717

Does this require updates to documentation?: Yes!

mtarng avatar Dec 17 '19 20:12 mtarng

Describe the solution you'd like:

  • [ ] As a user, if I remove a ring from a service, then the changes are reflected in: the associated bedrock.yaml, my hld repository, and the materialized repository.

  • [ ] As a user, if I remove a service from my mono-repository, then the service should be removed from the associated bedrock.yaml, my hld repository, and the materialized repository.

  • [ ] As a user, if I remove an external dependency (ie. Kafka, MongoDB) from my mono-repository, then:

    • [ ] then the external dependency should be removed from the associated bedrock.yaml, my hld repository, and the materialized repository, if and only if, it is not also being utilized by any other mono-repository linked to the same HLD and Materialized repositories.
  • [ ] As a user, if I wish to delete a service repository or mono-repository, how would this be reflected in the downstream repositories?

@evanlouie @bnookala @mtarng do we have sub tasks that correspond to these?

andrebriggs avatar Jan 09 '20 19:01 andrebriggs

@andrebriggs Don't believe subtasks have been written yet. I think it would probably be best to wait for @bnookala and @mtarng to return to go through more thoroughly.

evanlouie avatar Jan 09 '20 22:01 evanlouie

@bnookala can you share you design doc here?

andrebriggs avatar Jan 24 '20 19:01 andrebriggs

image

image

bnookala avatar Jan 24 '20 20:01 bnookala

Non-indexable text in an image? 😅

andrebriggs avatar Jan 25 '20 23:01 andrebriggs

@bnookala @mtarng let's create a separate task for documenting how the user would use this and start that first

andrebriggs avatar Feb 07 '20 21:02 andrebriggs