Skip to content

feat (cli-cicd integration): Enhance import command interface#1

Open
aviatco wants to merge 5 commits intodev/aviatcohen/cli-cicd-intergation-mainfrom
dev/aviatcohen/cicd-import-command-interface
Open

feat (cli-cicd integration): Enhance import command interface#1
aviatco wants to merge 5 commits intodev/aviatcohen/cli-cicd-intergation-mainfrom
dev/aviatcohen/cicd-import-command-interface

Conversation

@aviatco
Copy link
Owner

@aviatco aviatco commented Feb 10, 2026

📥 Pull Request

✨ Description of new changes

This pull request introduces significant improvements to the import command interface in the CLI, enabling support for both Direct API and CI/CD flows with clear argument validation and user guidance. The changes add mutually exclusive argument groups for the two flows, enforce correct usage with custom validators, improve error messages, and update documentation and examples to reflect the new interface.

Import Command Interface and Validation:

  • The import command now supports two mutually exclusive flows: Direct API (using path and -i/--input) and CI/CD (using --config-file and --env). Argument parsing enforces that only one flow can be used at a time, and provides detailed error messages if parameters are missing or flows are mixed. (src/fabric_cli/parsers/fab_fs_parser.py [1] [2]; src/fabric_cli/parsers/fab_parser_validators.py [3]
  • A new validation function validate_import_args ensures that required parameters for each flow are provided and that the flows are not mixed. Custom error messages guide the user to correct syntax. (src/fabric_cli/parsers/fab_parser_validators.py [1]; src/fabric_cli/errors/common.py [2]
  • The import_command and its implementation have been updated to handle both flows, delegating to the correct import logic based on the arguments. (src/fabric_cli/commands/fs/fab_fs.py [1]; src/fabric_cli/commands/fs/fab_fs_import.py [2]

Error Handling and Messages:

  • Improved error messages for unsupported commands, missing parameters, and incorrect flow usage, including more descriptive context about item types and flows. (src/fabric_cli/errors/hierarchy.py [1]; src/fabric_cli/core/hiearchy/fab_base_item.py [2] [3]; src/fabric_cli/core/hiearchy/fab_element.py [4]; src/fabric_cli/errors/common.py [5]
  • Added a new error code for import validation errors. (src/fabric_cli/core/fab_constant.py src/fabric_cli/core/fab_constant.pyR285)

Documentation and Examples:

Codebase Cleanup:

Changelog:

@aviatco aviatco marked this pull request as ready for review February 10, 2026 16:50

@staticmethod
def import_required_param_missing(param_display_name: str, flow_name: str, flow_syntax: str) -> str:
return f"{param_display_name} is required for {flow_name} flow.\nCorrect syntax: {flow_syntax}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure it actually break into a new line.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is - I test it.
but I see not the string is wrong - I wanted it without the "correct" - will remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants