Skip to content

Create Structure from Within a Folder #2

@httpdss

Description

@httpdss

Objective:
Enable the YAML configuration to reference and include another YAML file to define folder structures within a specified directory. This enhancement will allow users to modularize their project structures by including external YAML definitions.

Requirements:

  1. YAML Reference Syntax:

    • Allow the struct keyword in the YAML configuration to specify the path to another YAML file.
    • The referenced YAML file will define additional folder structures and files to be created within the specified directory.
  2. Example Usage:

    • The following example demonstrates how to use the struct keyword to include another YAML file for defining the structure within the .devops/apps/myapp/ directory:
      folders:
        - .devops/apps/myapp/:
            struct: terraform-app
  3. Implementation Details:

    • Parse the main YAML configuration.
    • Identify the struct keyword and its associated file path.
    • Read and parse the referenced YAML file.
    • Merge the folder structure defined in the referenced YAML file into the specified directory in the main configuration.
    • Ensure proper error handling for cases where the referenced YAML file is missing or contains invalid configurations.
  4. Error Handling:

    • If the referenced YAML file does not exist, log an error and skip the structure creation for that entry.
    • If the referenced YAML file contains invalid YAML syntax or structure, log an error and skip the structure creation for that entry.
  5. Testing:

    • Add unit tests to verify that the main YAML configuration correctly references and includes the structure defined in external YAML files.
    • Test edge cases, such as missing files, invalid YAML syntax, and circular references.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions