ara-cli 0.1.9.64__tar.gz → 0.1.9.66__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/PKG-INFO +1 -1
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/ara_command_action.py +36 -17
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/ara_command_parser.py +7 -1
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_creator.py +3 -2
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_fuzzy_search.py +1 -1
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/artefact_model.py +3 -2
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_reader.py +23 -1
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/prompt_handler.py +12 -13
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tag_extractor.py +20 -9
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_ara_command_action.py +6 -2
- ara_cli-0.1.9.66/ara_cli/tests/test_tag_extractor.py +83 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/version.py +1 -1
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli.egg-info/PKG-INFO +1 -1
- ara_cli-0.1.9.64/ara_cli/tests/test_tag_extractor.py +0 -54
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/MANIFEST.in +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/README.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/__init__.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/__main__.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/ara_config.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_autofix.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_deleter.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_link_updater.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_lister.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/artefact_load.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/artefact_mapping.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/artefact_templates.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/businessgoal_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/capability_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/epic_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/example_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/feature_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/issue_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/keyfeature_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/serialize_helper.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/task_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/userstory_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/vision_artefact_model.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_renamer.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_scan.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/chat.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/classifier.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/codefusionretriever.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/codehierachieretriever.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/commandline_completer.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/directory_navigator.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/file_classifier.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/file_lister.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/filename_validator.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/list_filter.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/output_suppressor.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/prompt_chat.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/prompt_extractor.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/prompt_rag.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/run_file_lister.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/template_manager.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/agile.artefacts +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/empty.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/classify_task.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/empty.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_fix_steps_for_scenario.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_reverse_formulation_from_code.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation_update.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_scenario_outline_extension.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/feature_update_formulation.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/fibonacci_example_implementation.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/js_implementation_from_task_description.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/js_steps_implementation.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/python_cli_implementation_with_test.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/python_code_understanding.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/task_prompt_control_by_status.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_number.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_status.intention.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/code_analyst.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/empty.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/error_analyst.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/js_expert_developer.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/product_owner.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/python_behave.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/python_developer.rules.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.concept.exploration.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.concept.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.customer.exploration.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.customer.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.persona.exploration.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.persona.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.step.exploration.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.step.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.technology.exploration.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/specification_breakdown_files/template.technology.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.businessgoal +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.businessgoal.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.capability +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.capability.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.epic +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.epic.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.example +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.example.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.feature +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.feature.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.issue +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.issue.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.keyfeature +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.keyfeature.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.steps.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.task +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.task.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.userstory +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.userstory.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.vision +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/template.vision.prompt_log.md +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/__init__.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_ara_autofix.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_ara_config.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_artefact_fuzzy_search.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_artefact_link_updater.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_artefact_lister.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_artefact_reader.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_artefact_renamer.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_artefact_scan.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_chat.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_classifier.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_directory_navigator.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_file_classifier.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_file_creator.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_file_lister.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_list_filter.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_template_manager.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/tests/test_update_config_prompt.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/update_config_prompt.py +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli.egg-info/SOURCES.txt +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli.egg-info/dependency_links.txt +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli.egg-info/entry_points.txt +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli.egg-info/requires.txt +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli.egg-info/top_level.txt +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/setup.cfg +0 -0
- {ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/setup.py +0 -0
|
@@ -18,6 +18,8 @@ def create_action(args):
|
|
|
18
18
|
from ara_cli.classifier import Classifier
|
|
19
19
|
from ara_cli.filename_validator import is_valid_filename
|
|
20
20
|
from ara_cli.template_manager import SpecificationBreakdownAspects
|
|
21
|
+
from ara_cli.artefact_reader import ArtefactReader
|
|
22
|
+
from ara_cli.artefact_fuzzy_search import find_closest_rule
|
|
21
23
|
|
|
22
24
|
check_validity(Classifier.is_valid_classifier(args.classifier), "Invalid classifier provided. Please provide a valid classifier.")
|
|
23
25
|
check_validity(is_valid_filename(args.parameter), "Invalid filename provided. Please provide a valid filename.")
|
|
@@ -25,11 +27,20 @@ def create_action(args):
|
|
|
25
27
|
def handle_parent_arguments(args):
|
|
26
28
|
parent_classifier = args.parent_classifier if hasattr(args, "parent_classifier") else None
|
|
27
29
|
parent_name = args.parent_name if hasattr(args, "parent_name") else None
|
|
30
|
+
rule = args.rule if hasattr(args, 'rule') else None
|
|
31
|
+
invalid_classifier_message = "Invalid parent classifier provided. Please provide a valid classifier"
|
|
32
|
+
invalid_name_message = "Invalid filename provided for parent. Please provide a valid filename."
|
|
33
|
+
if parent_classifier and parent_name and rule:
|
|
34
|
+
check_validity(Classifier.is_valid_classifier(parent_classifier), invalid_classifier_message)
|
|
35
|
+
check_validity(is_valid_filename(parent_name), invalid_name_message)
|
|
36
|
+
parent_artefact = ArtefactReader.read_single_artefact(artefact_name=parent_name, classifier=parent_classifier)
|
|
37
|
+
rule = find_closest_rule(parent_artefact, rule)
|
|
38
|
+
return parent_classifier, parent_name, rule
|
|
28
39
|
if parent_classifier and parent_name:
|
|
29
|
-
check_validity(Classifier.is_valid_classifier(parent_classifier),
|
|
30
|
-
check_validity(is_valid_filename(parent_name),
|
|
31
|
-
return parent_classifier, parent_name
|
|
32
|
-
return None, None
|
|
40
|
+
check_validity(Classifier.is_valid_classifier(parent_classifier), invalid_classifier_message)
|
|
41
|
+
check_validity(is_valid_filename(parent_name), invalid_name_message)
|
|
42
|
+
return parent_classifier, parent_name, rule
|
|
43
|
+
return None, None, None
|
|
33
44
|
|
|
34
45
|
def handle_aspect_creation(args):
|
|
35
46
|
aspect = args.aspect if hasattr(args, "aspect") else None
|
|
@@ -43,12 +54,12 @@ def create_action(args):
|
|
|
43
54
|
sys.exit(1)
|
|
44
55
|
return False
|
|
45
56
|
|
|
46
|
-
parent_classifier, parent_name = handle_parent_arguments(args)
|
|
57
|
+
parent_classifier, parent_name, rule = handle_parent_arguments(args)
|
|
47
58
|
if handle_aspect_creation(args):
|
|
48
59
|
return
|
|
49
60
|
|
|
50
61
|
artefact_creator = ArtefactCreator()
|
|
51
|
-
artefact_creator.run(args.parameter, args.classifier, parent_classifier, parent_name)
|
|
62
|
+
artefact_creator.run(args.parameter, args.classifier, parent_classifier, parent_name, rule)
|
|
52
63
|
|
|
53
64
|
|
|
54
65
|
def delete_action(args):
|
|
@@ -122,15 +133,17 @@ def list_action(args):
|
|
|
122
133
|
|
|
123
134
|
def list_tags_action(args):
|
|
124
135
|
from ara_cli.tag_extractor import TagExtractor
|
|
136
|
+
from ara_cli.list_filter import ListFilter
|
|
125
137
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
138
|
+
list_filter = ListFilter(
|
|
139
|
+
include_extension=args.include_classifier,
|
|
140
|
+
exclude_extension=args.exclude_classifier,
|
|
141
|
+
)
|
|
129
142
|
|
|
130
143
|
tag_extractor = TagExtractor()
|
|
131
144
|
tags = tag_extractor.extract_tags(
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
filtered_extra_column=getattr(args, "filtered_extra_column", False),
|
|
146
|
+
list_filter=list_filter
|
|
134
147
|
)
|
|
135
148
|
|
|
136
149
|
if args.json:
|
|
@@ -340,12 +353,12 @@ def reconnect_action(args):
|
|
|
340
353
|
artefact_name = args.parameter
|
|
341
354
|
parent_classifier = args.parent_classifier
|
|
342
355
|
parent_name = args.parent_name
|
|
343
|
-
rule = None
|
|
344
|
-
if args.rule:
|
|
345
|
-
rule = ' '.join(args.rule)
|
|
356
|
+
rule = args.rule if hasattr(args, 'rule') else None
|
|
346
357
|
|
|
347
358
|
read_error_message = f"Could not connect {classifier} '{artefact_name}' to {parent_classifier} '{parent_name}'"
|
|
348
359
|
|
|
360
|
+
feedback_message = f"Updated contribution of {classifier} '{artefact_name}' to {parent_classifier} '{parent_name}'"
|
|
361
|
+
|
|
349
362
|
content, artefact_info = ArtefactReader.read_artefact(
|
|
350
363
|
artefact_name=artefact_name,
|
|
351
364
|
classifier=classifier
|
|
@@ -377,15 +390,21 @@ def reconnect_action(args):
|
|
|
377
390
|
)
|
|
378
391
|
|
|
379
392
|
if rule:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
393
|
+
try:
|
|
394
|
+
closest_rule = find_closest_rule(parent, rule)
|
|
395
|
+
contribution.rule = closest_rule
|
|
396
|
+
feedback_message += f" using rule '{closest_rule}'"
|
|
397
|
+
except TypeError as e:
|
|
398
|
+
print(f"{type(e).__name__}:", e)
|
|
399
|
+
exit(1)
|
|
383
400
|
|
|
384
401
|
artefact.contribution = contribution
|
|
385
402
|
with open(artefact.file_path, 'w') as file:
|
|
386
403
|
artefact_content = artefact.serialize()
|
|
387
404
|
file.write(artefact_content)
|
|
388
405
|
|
|
406
|
+
print(feedback_message + ".")
|
|
407
|
+
|
|
389
408
|
|
|
390
409
|
def read_status_action(args):
|
|
391
410
|
from ara_cli.file_classifier import FileClassifier
|
|
@@ -18,6 +18,7 @@ def create_parser(subparsers):
|
|
|
18
18
|
contribution_parser = option_parser.add_parser("contributes-to")
|
|
19
19
|
contribution_parser.add_argument("parent_classifier", choices=classifiers, help="Classifier of the parent")
|
|
20
20
|
contribution_parser.add_argument("parent_name", help="Name of a parent artefact").completer = ParentNameCompleter()
|
|
21
|
+
contribution_parser.add_argument("-r", "--rule", dest="rule", action="store")
|
|
21
22
|
|
|
22
23
|
aspect_parser = option_parser.add_parser("aspect")
|
|
23
24
|
aspect_parser.add_argument("aspect", choices=aspects, help="Adds additional specification breakdown aspects in data directory.")
|
|
@@ -70,12 +71,16 @@ def add_filter_flags(parser):
|
|
|
70
71
|
extension_group.add_argument(
|
|
71
72
|
"-i",
|
|
72
73
|
"--include-extension",
|
|
74
|
+
"--include-classifier",
|
|
75
|
+
dest="include_extension",
|
|
73
76
|
nargs='+',
|
|
74
77
|
help='list of extensions to include in listing'
|
|
75
78
|
)
|
|
76
79
|
extension_group.add_argument(
|
|
77
80
|
"-e",
|
|
78
81
|
"--exclude-extension",
|
|
82
|
+
"--exclude-classifier",
|
|
83
|
+
dest="exclude_extension",
|
|
79
84
|
nargs='+',
|
|
80
85
|
help='list of extensions to exclude from listing'
|
|
81
86
|
)
|
|
@@ -121,6 +126,7 @@ def list_tags_parser(subparsers):
|
|
|
121
126
|
tags_parser = subparsers.add_parser("list-tags", help="Show tags")
|
|
122
127
|
tags_parser.add_argument("--json", "-j", help="Output tags as JSON", action=argparse.BooleanOptionalAction)
|
|
123
128
|
tags_parser.add_argument("--include-classifier", choices=classifiers, help="Show tags for an artefact type")
|
|
129
|
+
tags_parser.add_argument("--exclude_classifier", choices=classifiers, help="Show tags for an artefact type")
|
|
124
130
|
tags_parser.add_argument("--filtered-extra-column", action="store_true", help="Filter tags for extra column")
|
|
125
131
|
|
|
126
132
|
|
|
@@ -184,7 +190,7 @@ def reconnect_parser(subparsers):
|
|
|
184
190
|
reconnect_parser.add_argument("parameter", help="Filename of artefact").completer = ArtefactCompleter()
|
|
185
191
|
reconnect_parser.add_argument("parent_classifier", choices=classifiers, help="Classifier of the parent artefact type")
|
|
186
192
|
reconnect_parser.add_argument("parent_name", help="Filename of parent artefact").completer = ParentNameCompleter()
|
|
187
|
-
reconnect_parser.add_argument("-r", "--rule", dest="rule",
|
|
193
|
+
reconnect_parser.add_argument("-r", "--rule", dest="rule", action="store")
|
|
188
194
|
|
|
189
195
|
|
|
190
196
|
def read_status_parser(subparsers):
|
|
@@ -87,7 +87,7 @@ class ArtefactCreator:
|
|
|
87
87
|
artefact._parent = matching_artefacts[0]
|
|
88
88
|
return artefact
|
|
89
89
|
|
|
90
|
-
def run(self, filename, classifier, parent_classifier=None, parent_name=None):
|
|
90
|
+
def run(self, filename, classifier, parent_classifier=None, parent_name=None, rule=None):
|
|
91
91
|
# make sure this function is always called from the ara top level directory
|
|
92
92
|
original_directory = os.getcwd()
|
|
93
93
|
navigator = DirectoryNavigator()
|
|
@@ -111,7 +111,8 @@ class ArtefactCreator:
|
|
|
111
111
|
if parent_classifier and parent_name:
|
|
112
112
|
artefact.set_contribution(
|
|
113
113
|
artefact_name=parent_name,
|
|
114
|
-
classifier=parent_classifier
|
|
114
|
+
classifier=parent_classifier,
|
|
115
|
+
rule=rule
|
|
115
116
|
)
|
|
116
117
|
|
|
117
118
|
artefact_content = artefact.serialize()
|
|
@@ -41,7 +41,7 @@ def find_closest_name_match(artefact_name: str, all_artefact_names: list[str]) -
|
|
|
41
41
|
return closest_match
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def find_closest_rule(parent_artefact, rule):
|
|
44
|
+
def find_closest_rule(parent_artefact: 'Artefact', rule: str):
|
|
45
45
|
parent_classifier = parent_artefact.artefact_type.value
|
|
46
46
|
parent_title = parent_artefact.title
|
|
47
47
|
if not hasattr(parent_artefact, 'rules'):
|
|
@@ -401,9 +401,10 @@ class Artefact(BaseModel, ABC):
|
|
|
401
401
|
return description
|
|
402
402
|
return f"{description}{self.description}"
|
|
403
403
|
|
|
404
|
-
def set_contribution(self, artefact_name, classifier):
|
|
404
|
+
def set_contribution(self, artefact_name, classifier, rule=None):
|
|
405
405
|
contribution = Contribution(
|
|
406
406
|
artefact_name=artefact_name,
|
|
407
|
-
classifier=classifier
|
|
407
|
+
classifier=classifier,
|
|
408
|
+
rule=rule
|
|
408
409
|
)
|
|
409
410
|
self.contribution = contribution
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from ara_cli.classifier import Classifier
|
|
2
2
|
from ara_cli.file_classifier import FileClassifier
|
|
3
3
|
from ara_cli.artefact_models.artefact_model import Artefact
|
|
4
|
+
from ara_cli.artefact_models.artefact_load import artefact_from_content
|
|
4
5
|
from ara_cli.artefact_fuzzy_search import suggest_close_name_matches_for_parent, suggest_close_name_matches
|
|
5
6
|
from typing import Dict, List
|
|
6
7
|
import os
|
|
@@ -9,7 +10,7 @@ import re
|
|
|
9
10
|
|
|
10
11
|
class ArtefactReader:
|
|
11
12
|
@staticmethod
|
|
12
|
-
def read_artefact(artefact_name, classifier):
|
|
13
|
+
def read_artefact(artefact_name, classifier) -> tuple[str, dict[str, str]]:
|
|
13
14
|
if not Classifier.is_valid_classifier(classifier):
|
|
14
15
|
print("Invalid classifier provided. Please provide a valid classifier.")
|
|
15
16
|
return None, None
|
|
@@ -34,6 +35,27 @@ class ArtefactReader:
|
|
|
34
35
|
|
|
35
36
|
return None, None
|
|
36
37
|
|
|
38
|
+
@staticmethod
|
|
39
|
+
def read_single_artefact(artefact_name, classifier, classified_file_info=None) -> Artefact:
|
|
40
|
+
if not Classifier.is_valid_classifier(classifier):
|
|
41
|
+
print("Invalid classifier provided. Please provide a valid classifier.")
|
|
42
|
+
return None
|
|
43
|
+
if not classified_file_info:
|
|
44
|
+
file_classifier = FileClassifier(os)
|
|
45
|
+
classified_file_info = file_classifier.classify_files()
|
|
46
|
+
artefact_info_of_classifier = classified_file_info.get(classifier, [])
|
|
47
|
+
|
|
48
|
+
for artefact_info in artefact_info_of_classifier:
|
|
49
|
+
file_path = artefact_info["file_path"]
|
|
50
|
+
artefact_title = artefact_info["title"]
|
|
51
|
+
if artefact_title == artefact_name:
|
|
52
|
+
with open(file_path, 'r') as file:
|
|
53
|
+
content = file.read()
|
|
54
|
+
artefact = artefact_from_content(content)
|
|
55
|
+
artefact._file_path = file_path
|
|
56
|
+
return artefact
|
|
57
|
+
return None
|
|
58
|
+
|
|
37
59
|
@staticmethod
|
|
38
60
|
def extract_parent_tree(artefact_content):
|
|
39
61
|
artefact_titles = Classifier.artefact_titles()
|
|
@@ -357,10 +357,8 @@ def prepend_system_prompt(message_list):
|
|
|
357
357
|
def append_images_to_message(message, image_data_list):
|
|
358
358
|
if not image_data_list:
|
|
359
359
|
return message
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
message["content"] = new_content_list
|
|
360
|
+
message_content = message["content"]
|
|
361
|
+
message["content"] = message_content + image_data_list
|
|
364
362
|
|
|
365
363
|
return message
|
|
366
364
|
|
|
@@ -380,23 +378,24 @@ def create_and_send_custom_prompt(classifier, parameter):
|
|
|
380
378
|
append_headings(classifier, parameter, "prompt")
|
|
381
379
|
write_prompt_result(classifier, parameter, prompt)
|
|
382
380
|
|
|
383
|
-
|
|
381
|
+
message = {
|
|
384
382
|
"role": "user",
|
|
385
383
|
"content": combined_content_markdown
|
|
386
384
|
}
|
|
387
385
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
message_list_to_send = [final_message]
|
|
386
|
+
message_list = [message]
|
|
391
387
|
|
|
388
|
+
message_list = append_images_to_message(message_list, image_data_list)
|
|
392
389
|
append_headings(classifier, parameter, "result")
|
|
390
|
+
|
|
393
391
|
artefact_data_path = f"ara/{sub_directory}/{parameter}.data/{classifier}.prompt_log.md"
|
|
394
392
|
with open(artefact_data_path, 'a') as file:
|
|
395
|
-
for chunk in send_prompt(
|
|
396
|
-
|
|
397
|
-
if
|
|
398
|
-
|
|
399
|
-
|
|
393
|
+
for chunk in send_prompt(message_list):
|
|
394
|
+
chunk_content = chunk.choices[0].delta.content
|
|
395
|
+
if not chunk_content:
|
|
396
|
+
continue
|
|
397
|
+
file.write(chunk_content)
|
|
398
|
+
file.flush()
|
|
400
399
|
# write_prompt_result(classifier, parameter, response)
|
|
401
400
|
|
|
402
401
|
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from ara_cli.
|
|
2
|
+
from ara_cli.list_filter import ListFilter, filter_list
|
|
3
|
+
from ara_cli.artefact_lister import ArtefactLister
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class TagExtractor:
|
|
6
7
|
def __init__(self, file_system=None):
|
|
7
8
|
self.file_system = file_system or os
|
|
8
9
|
|
|
9
|
-
def extract_tags(
|
|
10
|
+
def extract_tags(
|
|
11
|
+
self,
|
|
12
|
+
navigate_to_target=False,
|
|
13
|
+
filtered_extra_column=False,
|
|
14
|
+
list_filter: ListFilter | None = None
|
|
15
|
+
):
|
|
10
16
|
from ara_cli.template_manager import DirectoryNavigator
|
|
11
17
|
from ara_cli.artefact_reader import ArtefactReader
|
|
12
18
|
|
|
@@ -16,24 +22,29 @@ class TagExtractor:
|
|
|
16
22
|
|
|
17
23
|
artefacts = ArtefactReader.read_artefacts()
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
filtered_artefacts = filter_list(
|
|
26
|
+
list_to_filter=artefacts,
|
|
27
|
+
list_filter=list_filter,
|
|
28
|
+
content_retrieval_strategy=ArtefactLister.artefact_content_retrieval,
|
|
29
|
+
file_path_retrieval=ArtefactLister.artefact_path_retrieval,
|
|
30
|
+
tag_retrieval=ArtefactLister.artefact_tags_retrieval
|
|
31
|
+
)
|
|
21
32
|
|
|
22
33
|
unique_tags = set()
|
|
23
34
|
|
|
24
35
|
if filtered_extra_column:
|
|
25
36
|
status_tags = {"to-do", "in-progress", "review", "done", "closed"}
|
|
26
|
-
|
|
37
|
+
artefacts_to_process = []
|
|
27
38
|
|
|
28
|
-
for artefact_list in
|
|
39
|
+
for artefact_list in filtered_artefacts.values():
|
|
29
40
|
for artefact in artefact_list:
|
|
30
41
|
tags = artefact.tags + \
|
|
31
42
|
[artefact.status] if artefact.status else artefact.tags
|
|
32
43
|
tag_set = set(tag for tag in tags if tag is not None)
|
|
33
44
|
if not tag_set & status_tags:
|
|
34
|
-
|
|
45
|
+
artefacts_to_process.append(artefact)
|
|
35
46
|
|
|
36
|
-
for artefact in
|
|
47
|
+
for artefact in artefacts_to_process:
|
|
37
48
|
tags = [tag for tag in (
|
|
38
49
|
artefact.tags + [artefact.status]) if tag is not None]
|
|
39
50
|
for tag in tags:
|
|
@@ -46,7 +57,7 @@ class TagExtractor:
|
|
|
46
57
|
unique_tags.add(tag)
|
|
47
58
|
|
|
48
59
|
else:
|
|
49
|
-
for artefact_list in
|
|
60
|
+
for artefact_list in filtered_artefacts.values():
|
|
50
61
|
for artefact in artefact_list:
|
|
51
62
|
user_tags = [f"user_{tag}" for tag in artefact.users]
|
|
52
63
|
tags = [tag for tag in (artefact.tags + [artefact.status] + user_tags) if tag is not None]
|
|
@@ -26,8 +26,10 @@ def mock_dependencies():
|
|
|
26
26
|
"ara_cli.filename_validator.is_valid_filename"
|
|
27
27
|
) as mock_is_valid_filename, patch(
|
|
28
28
|
"ara_cli.template_manager.SpecificationBreakdownAspects"
|
|
29
|
-
) as MockSpecificationBreakdownAspects
|
|
30
|
-
|
|
29
|
+
) as MockSpecificationBreakdownAspects, patch(
|
|
30
|
+
"ara_cli.artefact_fuzzy_search.find_closest_rule"
|
|
31
|
+
) as mock_find_closest_rule:
|
|
32
|
+
yield MockArtefactCreator, MockClassifier, mock_is_valid_filename, MockSpecificationBreakdownAspects, mock_find_closest_rule
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
@pytest.fixture
|
|
@@ -129,9 +131,11 @@ def test_create_action_validity_checks(
|
|
|
129
131
|
MockClassifier,
|
|
130
132
|
mock_is_valid_filename,
|
|
131
133
|
MockSpecificationBreakdownAspects,
|
|
134
|
+
mock_find_closest_rule,
|
|
132
135
|
) = mock_dependencies
|
|
133
136
|
MockClassifier.is_valid_classifier.return_value = classifier_valid
|
|
134
137
|
mock_is_valid_filename.return_value = filename_valid
|
|
138
|
+
mock_find_closest_rule.return_value = None
|
|
135
139
|
|
|
136
140
|
args = MagicMock()
|
|
137
141
|
args.classifier = "test_classifier"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from unittest.mock import MagicMock, patch
|
|
3
|
+
from ara_cli.tag_extractor import TagExtractor
|
|
4
|
+
from ara_cli.list_filter import ListFilter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.fixture
|
|
8
|
+
def artefact():
|
|
9
|
+
"""Fixture to create a mock artefact object."""
|
|
10
|
+
class Artefact:
|
|
11
|
+
def __init__(self, tags, status, users, path="dummy.md", content=""):
|
|
12
|
+
self.tags = tags
|
|
13
|
+
self.status = status
|
|
14
|
+
self.users = users
|
|
15
|
+
self.path = path
|
|
16
|
+
self.content = content
|
|
17
|
+
return Artefact
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.mark.parametrize("navigate_to_target, filtered_extra_column, list_filter, artefact_data, expected_tags", [
|
|
21
|
+
(
|
|
22
|
+
False, False, None,
|
|
23
|
+
{'artefacts': [
|
|
24
|
+
(['tag1', 'tag2'], 'in-progress', ['user1']),
|
|
25
|
+
(['tag3'], 'done', ['user2'])
|
|
26
|
+
]},
|
|
27
|
+
['done', 'in-progress', 'tag1', 'tag2', 'tag3', 'user_user1', 'user_user2']
|
|
28
|
+
),
|
|
29
|
+
(
|
|
30
|
+
False, True, None,
|
|
31
|
+
{'artefacts': [
|
|
32
|
+
(['project_a', 'priority_high'], None, ['user1']),
|
|
33
|
+
(['feature_x'], 'done', ['user2'])
|
|
34
|
+
]},
|
|
35
|
+
['project_a']
|
|
36
|
+
),
|
|
37
|
+
(
|
|
38
|
+
False, False, ListFilter(include_tags=['@kritik']),
|
|
39
|
+
{'artefacts': [
|
|
40
|
+
(['release', 'kritik'], 'review', ['dev1']),
|
|
41
|
+
(['bugfix'], 'to-do', ['dev2'])
|
|
42
|
+
]},
|
|
43
|
+
['kritik', 'release', 'review', 'user_dev1']
|
|
44
|
+
),
|
|
45
|
+
(
|
|
46
|
+
True, False, None,
|
|
47
|
+
{'artefacts': [
|
|
48
|
+
(['tag3'], 'status2', ['user3'])
|
|
49
|
+
]},
|
|
50
|
+
['status2', 'tag3', 'user_user3']
|
|
51
|
+
),
|
|
52
|
+
(
|
|
53
|
+
False, False, None,
|
|
54
|
+
{'artefacts': []},
|
|
55
|
+
[]
|
|
56
|
+
),
|
|
57
|
+
])
|
|
58
|
+
@patch('ara_cli.artefact_reader.ArtefactReader')
|
|
59
|
+
@patch('ara_cli.template_manager.DirectoryNavigator')
|
|
60
|
+
def test_extract_tags(mock_directory_navigator, mock_artefact_reader, artefact, navigate_to_target, filtered_extra_column, list_filter, artefact_data, expected_tags):
|
|
61
|
+
mock_artefacts = {key: [artefact(
|
|
62
|
+
*data) for data in artefact_list] for key, artefact_list in artefact_data.items()}
|
|
63
|
+
mock_artefact_reader.read_artefacts.return_value = mock_artefacts
|
|
64
|
+
|
|
65
|
+
mock_navigator_instance = mock_directory_navigator.return_value
|
|
66
|
+
mock_navigator_instance.navigate_to_target = MagicMock()
|
|
67
|
+
|
|
68
|
+
tag_extractor = TagExtractor()
|
|
69
|
+
|
|
70
|
+
result = tag_extractor.extract_tags(
|
|
71
|
+
navigate_to_target=navigate_to_target,
|
|
72
|
+
filtered_extra_column=filtered_extra_column,
|
|
73
|
+
list_filter=list_filter
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
if navigate_to_target:
|
|
77
|
+
mock_navigator_instance.navigate_to_target.assert_called_once()
|
|
78
|
+
else:
|
|
79
|
+
mock_navigator_instance.navigate_to_target.assert_not_called()
|
|
80
|
+
|
|
81
|
+
mock_artefact_reader.read_artefacts.assert_called_once()
|
|
82
|
+
|
|
83
|
+
assert sorted(result) == sorted(expected_tags)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# version.py
|
|
2
|
-
__version__ = "0.1.9.
|
|
2
|
+
__version__ = "0.1.9.66" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from unittest.mock import MagicMock, patch
|
|
3
|
-
from ara_cli.tag_extractor import TagExtractor
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@pytest.fixture
|
|
7
|
-
def artefact():
|
|
8
|
-
"""Fixture to create a mock artefact object."""
|
|
9
|
-
class Artefact:
|
|
10
|
-
def __init__(self, tags, status, users):
|
|
11
|
-
self.tags = tags
|
|
12
|
-
self.status = status
|
|
13
|
-
self.users = users
|
|
14
|
-
return Artefact
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@pytest.mark.parametrize("navigate_to_target, include_classifier, artefact_data, expected_tags", [
|
|
18
|
-
(False, None, {'artefacts': [
|
|
19
|
-
(['tag1', 'tag2'], 'status1', ['user1', 'user2']),
|
|
20
|
-
(['tag3'], 'status2', ['user3'])
|
|
21
|
-
]}, ['status1', 'status2', 'tag1', 'tag2', 'tag3', 'user_user1', 'user_user2', 'user_user3']),
|
|
22
|
-
|
|
23
|
-
(False, 'key', {'key': [
|
|
24
|
-
(['tag1', 'tag2'], 'status1', ['user1', 'user2'])
|
|
25
|
-
]}, ['status1', 'tag1', 'tag2', 'user_user1', 'user_user2']),
|
|
26
|
-
|
|
27
|
-
(True, None, {'artefacts': [
|
|
28
|
-
(['tag3'], 'status2', ['user3'])
|
|
29
|
-
]}, ['status2', 'tag3', 'user_user3'])
|
|
30
|
-
])
|
|
31
|
-
@patch('ara_cli.template_manager.DirectoryNavigator')
|
|
32
|
-
@patch('ara_cli.artefact_reader.ArtefactReader')
|
|
33
|
-
def test_extract_tags(mock_artefact_reader, mock_directory_navigator, artefact, navigate_to_target, include_classifier, artefact_data, expected_tags):
|
|
34
|
-
# Mock the artefact reader to return artefact data
|
|
35
|
-
mock_artefact_reader.read_artefacts.return_value = {key: [artefact(
|
|
36
|
-
*data) for data in artefact_list] for key, artefact_list in artefact_data.items()}
|
|
37
|
-
|
|
38
|
-
# Mock the directory navigator
|
|
39
|
-
mock_navigator_instance = mock_directory_navigator.return_value
|
|
40
|
-
mock_navigator_instance.navigate_to_target = MagicMock()
|
|
41
|
-
|
|
42
|
-
tag_extractor = TagExtractor()
|
|
43
|
-
|
|
44
|
-
# Run the extract_tags method with include_classifier
|
|
45
|
-
result = tag_extractor.extract_tags(
|
|
46
|
-
navigate_to_target=navigate_to_target, include_classifier=include_classifier)
|
|
47
|
-
|
|
48
|
-
# Assertions
|
|
49
|
-
if navigate_to_target:
|
|
50
|
-
mock_navigator_instance.navigate_to_target.assert_called_once()
|
|
51
|
-
else:
|
|
52
|
-
mock_navigator_instance.navigate_to_target.assert_not_called()
|
|
53
|
-
|
|
54
|
-
assert result == expected_tags
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/artefact_models/businessgoal_artefact_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/commands/empty.commands.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/intentions/empty.intention.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/code_analyst.rules.md
RENAMED
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/error_analyst.rules.md
RENAMED
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md
RENAMED
|
File without changes
|
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/product_owner.rules.md
RENAMED
|
File without changes
|
{ara_cli-0.1.9.64 → ara_cli-0.1.9.66}/ara_cli/templates/prompt-modules/rules/python_behave.rules.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|