From e01d465fd1c648d6278780e54ff52769cf6d25e4 Mon Sep 17 00:00:00 2001 From: Predrag Radenkovic Date: Sun, 19 Apr 2026 22:48:07 +0200 Subject: [PATCH] Add module_name to render_func_id related API calls --- codeplain_REST_api.py | 13 ++++++++++--- render_machine/actions/exit_with_error.py | 1 + .../actions/finish_functional_requirement.py | 1 + render_machine/actions/refactor_code.py | 1 + render_machine/actions/render_conformance_tests.py | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/codeplain_REST_api.py b/codeplain_REST_api.py index e815d9f..5b8f7d2 100644 --- a/codeplain_REST_api.py +++ b/codeplain_REST_api.py @@ -262,12 +262,15 @@ def create_conformance_test_memory( return self.post_request(endpoint_url, headers, payload, run_state) - def refactor_source_files_if_needed(self, frid, files_to_check, existing_files_content, run_state: RunState): + def refactor_source_files_if_needed( + self, frid, module_name: str, files_to_check, existing_files_content, run_state: RunState + ): endpoint_url = f"{self.api_url}/refactor_source_files_if_needed" headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"} payload = { "frid": frid, + "module_name": module_name, "files_to_check": list(files_to_check), "existing_files_content": existing_files_content, } @@ -312,6 +315,7 @@ def render_conformance_tests( def generate_folder_name_from_functional_requirement( self, frid, + module_name: str, functional_requirement, existing_folder_names, run_state: RunState, @@ -321,6 +325,7 @@ def generate_folder_name_from_functional_requirement( payload = { "frid": frid, + "module_name": module_name, "functional_requirement": functional_requirement, "existing_folder_names": existing_folder_names, } @@ -454,22 +459,24 @@ def analyze_rendering( return self.post_request(endpoint_url, headers, payload, run_state) - def finish_functional_requirement(self, frid, run_state: RunState): + def finish_functional_requirement(self, frid, module_name: str, run_state: RunState): endpoint_url = f"{self.api_url}/finish_functional_requirement" headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"} payload = { "frid": frid, + "module_name": module_name, } return self.post_request(endpoint_url, headers, payload, run_state) - def fail_functional_requirement(self, frid, run_state: RunState): + def fail_functional_requirement(self, frid, module_name: str, run_state: RunState): endpoint_url = f"{self.api_url}/fail_functional_requirement" headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"} payload = { "frid": frid, + "module_name": module_name, } return self.post_request(endpoint_url, headers, payload, run_state) diff --git a/render_machine/actions/exit_with_error.py b/render_machine/actions/exit_with_error.py index 0179734..2ef7b3c 100644 --- a/render_machine/actions/exit_with_error.py +++ b/render_machine/actions/exit_with_error.py @@ -13,6 +13,7 @@ def execute(self, render_context: RenderContext, previous_action_payload: Any | render_context.codeplain_api.fail_functional_requirement( render_context.frid_context.frid, + module_name=render_context.module_name, run_state=render_context.run_state, ) diff --git a/render_machine/actions/finish_functional_requirement.py b/render_machine/actions/finish_functional_requirement.py index c928bf1..1a27f10 100644 --- a/render_machine/actions/finish_functional_requirement.py +++ b/render_machine/actions/finish_functional_requirement.py @@ -12,6 +12,7 @@ def execute(self, render_context: RenderContext, previous_action_payload: Any | render_context.codeplain_api.finish_functional_requirement( render_context.frid_context.frid, + module_name=render_context.module_name, run_state=render_context.run_state, ) diff --git a/render_machine/actions/refactor_code.py b/render_machine/actions/refactor_code.py index 728fe00..d7ab098 100644 --- a/render_machine/actions/refactor_code.py +++ b/render_machine/actions/refactor_code.py @@ -31,6 +31,7 @@ def execute(self, render_context: RenderContext, _previous_action_payload: Any | ): response_files = render_context.codeplain_api.refactor_source_files_if_needed( frid=render_context.frid_context.frid, + module_name=render_context.module_name, files_to_check=render_context.frid_context.changed_files, existing_files_content=existing_files_content, run_state=render_context.run_state, diff --git a/render_machine/actions/render_conformance_tests.py b/render_machine/actions/render_conformance_tests.py index af36215..240394f 100644 --- a/render_machine/actions/render_conformance_tests.py +++ b/render_machine/actions/render_conformance_tests.py @@ -38,6 +38,7 @@ def _render_conformance_tests(self, render_context: RenderContext): ): fr_subfolder_name = render_context.codeplain_api.generate_folder_name_from_functional_requirement( frid=render_context.conformance_tests_running_context.current_testing_frid, + module_name=render_context.conformance_tests_running_context.current_testing_module_name, functional_requirement=render_context.conformance_tests_running_context.current_testing_frid_specifications[ plain_spec.FUNCTIONAL_REQUIREMENTS ][