Skip to content

Add CLI option for using calm generate with pre-defined options #1951

@niamhg-ms

Description

@niamhg-ms

Feature Proposal

Target Project:

This is for the CALM CLI project.

Description of Feature:

This feature would allow users to pass a file/cli arguments that contains values for each of the options in a pattern into the calm generate cli command. The architecture generated will then be created with the correct options present.

User Stories:

As a pattern writer,
I want to be able to use calm generate with pre-defined options
So that I can create automated tests that generate a architecture from a pattern with options

Current Limitations:

This functionality does not exist on the CLI.

Proposed Implementation:

We need to decide if we want to go with a file or cli argument based approach. Based on the decided approach a new option will be need to be added to the calm generate command (e.g. --option-choices <file path> or --option-choices <list of objects containing unique-ids & values>.

The cli should then be able to read in these values and generate the architecture with the correct options present.

For example using the file approach:

======example-pattern.choices.json======
[
  {
    "option": "Use HTTP or HTTPS", <- this will match the description of the calm resource, the unique-id could be used here instead
    "choice": "HTTP"
  }
]
===============================

calm generate -p example-pattern.json --option-choices example-pattern.choices.json

Using the CLI approach:
calm generate -p example-pattern.json --option-choices [{"http-or-https", "HTTP"}]
where http-or-https is the unique-id of the calm resource

Testing Strategy:

Unit and integration tests should be added.

Documentation Requirements:

The documentation on the calm generate command should be updated with how to use this new feature.

Implementation Checklist:

  • Design reviewed and approved
  • Implementation completed
  • Tests written and passing
  • Documentation updated
  • Relevant workflows updated (if needed)
  • Performance impact assessed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions