From 684e54ba1c5302df0cddf54b97d03357d333f9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Di=20Domenico?= Date: Wed, 15 Apr 2026 14:14:08 +0200 Subject: [PATCH 1/4] test(converter): add distributionID checks on cisu to rs cases --- converter/tests/cisu/test_resources_info_converter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/converter/tests/cisu/test_resources_info_converter.py b/converter/tests/cisu/test_resources_info_converter.py index 6162d8669..a51aed653 100644 --- a/converter/tests/cisu/test_resources_info_converter.py +++ b/converter/tests/cisu/test_resources_info_converter.py @@ -237,6 +237,9 @@ def test_from_cisu_to_rs_new_case_id(): assert "resourcesInfo" in first_message, ( "first message must be a RS-RI (resourcesInfo key expected)" ) + assert results[0]["distributionID"] == RC_RI_WITH_POSITION_EDXL["distributionID"], ( + "Converted RS-RI doesn't have the same distributionID as original RC-RI" + ) for i, rs_sr in enumerate(results[1:], start=1): message = get_edxl_message(rs_sr) @@ -393,6 +396,10 @@ def test_from_cisu_to_rs_known_case_id_status_changed_only(): assert isinstance(results, list), "from_cisu_to_rs must return a list" assert len(results) == 1, f"expected 1 RS-SR, got {len(results)}" + assert results[0]["distributionID"] == RC_RI_WITH_POSITION_EDXL["distributionID"], ( + "Converted RS-SR doesn't have the same distributionID as original RC-RI" + ) + message = get_edxl_message(results[0]) assert "resourcesStatus" in message, "expected RS-SR (resourcesStatus key)" assert "resourcesInfo" not in message, ( @@ -421,6 +428,9 @@ def test_from_cisu_to_rs_known_case_id_resource_added(): assert isinstance(results, list), "from_cisu_to_rs must return a list" assert len(results) == 2, f"expected RS-RI + RS-SR, got {len(results)}" + assert results[0]["distributionID"] == RC_RI_WITH_POSITION_EDXL["distributionID"], ( + "Converted RS-RI doesn't have the same distributionID as original RC-RI" + ) first_message = get_edxl_message(results[0]) assert "resourcesInfo" in first_message, ( From 0e00a3fe615bb2799ba1f3214487523c27e7a49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Di=20Domenico?= Date: Wed, 15 Apr 2026 14:14:39 +0200 Subject: [PATCH 2/4] feat(converter): reuse original distributionID in every RC-RI conversion cases --- .../resources_info_cisu_converter.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/converter/converter/cisu/resources_info/resources_info_cisu_converter.py b/converter/converter/cisu/resources_info/resources_info_cisu_converter.py index fee9ff58f..cadd63599 100644 --- a/converter/converter/cisu/resources_info/resources_info_cisu_converter.py +++ b/converter/converter/cisu/resources_info/resources_info_cisu_converter.py @@ -73,7 +73,11 @@ def _build_rs_ri_from_cisu(cls, edxl_json: Dict[str, Any]) -> Dict[str, Any]: @classmethod def _build_rs_sr_from_resource( - cls, edxl_json: Dict[str, Any], resource: Dict[str, Any], case_id: str + cls, + edxl_json: Dict[str, Any], + resource: Dict[str, Any], + case_id: str, + use_original_distribution_id: bool = False, ) -> Dict[str, Any]: """Build an RS-SR from a single RC-RI resource, reusing the EDXL envelope.""" logger.info( @@ -83,8 +87,10 @@ def _build_rs_sr_from_resource( ) output_json = cls.copy_cisu_input_content(edxl_json) - # Set a new distributionID for the RS-SR message - cls.set_distribution_id(output_json, f"{edxl_json['senderID']}_{uuid.uuid4()}") + if not use_original_distribution_id: + cls.set_distribution_id( + output_json, f"{edxl_json['senderID']}_{uuid.uuid4()}" + ) output_use_case_json = { "caseId": case_id, @@ -200,12 +206,17 @@ def from_cisu_to_rs(cls, edxl_json: Dict[str, Any]) -> List[Dict[str, Any]]: rs_ri = cls._build_rs_ri_from_cisu(edxl_json) messages.append(rs_ri) - for resource in modified_status_resources: + for idx, resource in enumerate(modified_status_resources): logger.info( "Resource %s has a modified status — adding RS-SR to output.", resource.get("resourceId"), ) - rs_sr = cls._build_rs_sr_from_resource(edxl_json, resource, case_id) + should_use_original_distribution_id = ( + not engaged_resources_updated and idx == 0 + ) + rs_sr = cls._build_rs_sr_from_resource( + edxl_json, resource, case_id, should_use_original_distribution_id + ) messages.append(rs_sr) if not messages: From 93b31a33727c75ffb279c8e84af8f6bd4f067baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Di=20Domenico?= Date: Wed, 15 Apr 2026 14:15:21 +0200 Subject: [PATCH 3/4] chore(converter): remove dupplicate coverage posting in PR comment CI step --- .github/workflows/converter-tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/converter-tests.yml b/.github/workflows/converter-tests.yml index d01b76af1..8e9166391 100644 --- a/.github/workflows/converter-tests.yml +++ b/.github/workflows/converter-tests.yml @@ -63,11 +63,6 @@ jobs: path: tools/converter/htmlcov retention-days: 7 - - name: Run ReportGenerator for test coverage - uses: danielpalme/ReportGenerator-GitHub-Action@5.1.23 - with: - reports: ./converter/coverage.xml - targetdir: coveragereport - name: Pytest coverage comment uses: MishaKav/pytest-coverage-comment@v1.1.53 From 8e67200b78fc061d5011b52c4c55679c209e2e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Di=20Domenico?= Date: Wed, 15 Apr 2026 14:16:45 +0200 Subject: [PATCH 4/4] chore(converter): bump comment coverage in PR action to version 1.7.1 --- .github/workflows/converter-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/converter-tests.yml b/.github/workflows/converter-tests.yml index 8e9166391..99ecc9bb2 100644 --- a/.github/workflows/converter-tests.yml +++ b/.github/workflows/converter-tests.yml @@ -65,7 +65,7 @@ jobs: - name: Pytest coverage comment - uses: MishaKav/pytest-coverage-comment@v1.1.53 + uses: MishaKav/pytest-coverage-comment@v1.7.1 with: pytest-xml-coverage-path: ./converter/coverage.xml title: "Converter - python code coverage"