Skip to content

Commit b51ca68

Browse files
Add module_name to render_func_id related API calls
1 parent da10f63 commit b51ca68

5 files changed

Lines changed: 14 additions & 3 deletions

File tree

codeplain_REST_api.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,15 @@ def create_conformance_test_memory(
262262

263263
return self.post_request(endpoint_url, headers, payload, run_state)
264264

265-
def refactor_source_files_if_needed(self, frid, files_to_check, existing_files_content, run_state: RunState):
265+
def refactor_source_files_if_needed(
266+
self, frid, module_name: str, files_to_check, existing_files_content, run_state: RunState
267+
):
266268
endpoint_url = f"{self.api_url}/refactor_source_files_if_needed"
267269
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
268270

269271
payload = {
270272
"frid": frid,
273+
"module_name": module_name,
271274
"files_to_check": list(files_to_check),
272275
"existing_files_content": existing_files_content,
273276
}
@@ -312,6 +315,7 @@ def render_conformance_tests(
312315
def generate_folder_name_from_functional_requirement(
313316
self,
314317
frid,
318+
module_name: str,
315319
functional_requirement,
316320
existing_folder_names,
317321
run_state: RunState,
@@ -321,6 +325,7 @@ def generate_folder_name_from_functional_requirement(
321325

322326
payload = {
323327
"frid": frid,
328+
"module_name": module_name,
324329
"functional_requirement": functional_requirement,
325330
"existing_folder_names": existing_folder_names,
326331
}
@@ -454,22 +459,24 @@ def analyze_rendering(
454459

455460
return self.post_request(endpoint_url, headers, payload, run_state)
456461

457-
def finish_functional_requirement(self, frid, run_state: RunState):
462+
def finish_functional_requirement(self, frid, module_name: str, run_state: RunState):
458463
endpoint_url = f"{self.api_url}/finish_functional_requirement"
459464
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
460465

461466
payload = {
462467
"frid": frid,
468+
"module_name": module_name,
463469
}
464470

465471
return self.post_request(endpoint_url, headers, payload, run_state)
466472

467-
def fail_functional_requirement(self, frid, run_state: RunState):
473+
def fail_functional_requirement(self, frid, module_name: str, run_state: RunState):
468474
endpoint_url = f"{self.api_url}/fail_functional_requirement"
469475
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
470476

471477
payload = {
472478
"frid": frid,
479+
"module_name": module_name,
473480
}
474481

475482
return self.post_request(endpoint_url, headers, payload, run_state)

render_machine/actions/exit_with_error.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def execute(self, render_context: RenderContext, previous_action_payload: Any |
1313

1414
render_context.codeplain_api.fail_functional_requirement(
1515
render_context.frid_context.frid,
16+
module_name=render_context.module_name,
1617
run_state=render_context.run_state,
1718
)
1819

render_machine/actions/finish_functional_requirement.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def execute(self, render_context: RenderContext, previous_action_payload: Any |
1212

1313
render_context.codeplain_api.finish_functional_requirement(
1414
render_context.frid_context.frid,
15+
module_name=render_context.module_name,
1516
run_state=render_context.run_state,
1617
)
1718

render_machine/actions/refactor_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def execute(self, render_context: RenderContext, _previous_action_payload: Any |
3131
):
3232
response_files = render_context.codeplain_api.refactor_source_files_if_needed(
3333
frid=render_context.frid_context.frid,
34+
module_name=render_context.module_name,
3435
files_to_check=render_context.frid_context.changed_files,
3536
existing_files_content=existing_files_content,
3637
run_state=render_context.run_state,

render_machine/actions/render_conformance_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def _render_conformance_tests(self, render_context: RenderContext):
3838
):
3939
fr_subfolder_name = render_context.codeplain_api.generate_folder_name_from_functional_requirement(
4040
frid=render_context.conformance_tests_running_context.current_testing_frid,
41+
module_name=render_context.conformance_tests_running_context.current_testing_module_name,
4142
functional_requirement=render_context.conformance_tests_running_context.current_testing_frid_specifications[
4243
plain_spec.FUNCTIONAL_REQUIREMENTS
4344
][

0 commit comments

Comments
 (0)