Skip to content

Backend: Implement template apply engine (remove + copy)Β #17393

@acn-sbuad

Description

@acn-sbuad

Description

Implement logic to apply a template to an app repo creation process.

Steps

  1. Copy default repo
  2. Remove:
    • Expand globs in remove
    • Delete files/folders
  3. Copy:
    • Copy <template>/<contentPath> β†’ app root
    • Overwrite existing files
  4. update appmetadata

steps 1 and 2 handled by template apply engine

Safety

  • Never delete outside app root
  • Reject path traversal
  • No-op if remove matches nothing

Acceptance criteria

  • Directories and files are removed correctly.

  • Copy overwrites existing files.

  • Safety checks prevent deleting outside root.

  • Logs removed + copied files.

  • Unit tests cover all behaviors.

  • Apply template during app initialization

  • If no templateId β†’ use default behavior

  • API accepts optional templateId

  • Unknown templateId β†’ 400 error

  • Template applied in correct order

  • Integration test covers create-app with template

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions