Skip to content

Add delete support #167

@jayvdb

Description

@jayvdb

As a repository manager, renaming files is a fairly common requirement.

Currently the name of a target file can be changed, but the old filename isnt scheduled for deletion at the same time.

It may seem obvious that the old file needs to be deleted, especially when the template writer and template users (repo managers) are the same people, but newbies dont learn 'obvious' without clues, and a central configuration management should be able to automatically manage updated to a large number of managed projects which have different teams/repo managers.

The new-file template rule and the old-file delete rule should be together in the same section of the mobanfile. i.e. under targets:

Having learnt from copy: which I think should be a plugin per #165 , I believe delete should also be a plugin. It should be a core plugin, as it satisfies a core requirement of moban. It really should be a plugin, because people should be able to customise moban with plugins which can perform deletions in a way that the moban engine understands.

The easiest syntax would be:

targets:
  - foo:  # implicit empty/null/etc

However that allows unintended deletes to occur very easily.

Much better would be to require an explicit datatype, such as false

targets:
  - foo: false  # explicit delete

If yaml datatype extensions in #165 are implemented, the following would also be possible

targets:
  - !delete foo  # explicit delete

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions