From bc565a72f1c0a9b6985131ba0917010ee1177bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Z=C3=BCbeyde=20Civelek?= Date: Mon, 5 Oct 2026 17:01:45 +0200 Subject: [PATCH 1/2] migration: update streams and config --- cds_migrator_kit/rdm/migration_config.py | 12 ++++++++++- cds_migrator_kit/rdm/streams.yaml | 13 +----------- cds_migrator_kit/rdm/streams_done.yaml | 27 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/cds_migrator_kit/rdm/migration_config.py b/cds_migrator_kit/rdm/migration_config.py index 4be35615..727045bf 100644 --- a/cds_migrator_kit/rdm/migration_config.py +++ b/cds_migrator_kit/rdm/migration_config.py @@ -606,7 +606,7 @@ def resolve_record_pid(pid): "counter_digits": 3, }, }, - "7277793b-5fce-458a-a3c4-e05a6cc43c69": { + "8b213ed1-31a6-408a-b474-c0c39734c2e3": { # ship "label": "EP approval", # shown in UI buttons/headings "referee_group": "cds-ph-ep-publications-referee-non-lhc", # CERN e-group slug @@ -616,4 +616,14 @@ def resolve_record_pid(pid): "counter_digits": 3, # zero-padding width, e.g. 3 → "001" }, }, + "31bf228a-ae6e-462b-b70e-345d3e74b8ca": { + # lhcf + "label": "EP approval", # shown in UI buttons/headings + "referee_group": "cds-ph-ep-publication", # CERN e-group slug + "report_number": { + "prefix": "CERN-EP", # literal prefix, e.g. "CERN-EP" + "include_year": True, # append the current year after prefix + "counter_digits": 3, # zero-padding width, e.g. 3 → "001" + }, + }, } diff --git a/cds_migrator_kit/rdm/streams.yaml b/cds_migrator_kit/rdm/streams.yaml index c57e48f5..5199d992 100644 --- a/cds_migrator_kit/rdm/streams.yaml +++ b/cds_migrator_kit/rdm/streams.yaml @@ -622,18 +622,7 @@ records: files_dump_dir: cds_migrator_kit/rdm/data/lhcf/files/ missing_users: cds_migrator_kit/rdm/data/users communities_ids: - - "88a105fe-4713-493b-b555-6ab398599d21" - lhcf-ep: - data_dir: cds_migrator_kit/rdm/data/lhcf-ep - plots: true - create_inclusion_request: true - extract: - dirpath: cds_migrator_kit/rdm/data/lhcf-ep/dump/ - transform: - files_dump_dir: cds_migrator_kit/rdm/data/lhcf-ep/files/ - missing_users: cds_migrator_kit/rdm/data/users - communities_ids: - - "88a105fe-4713-493b-b555-6ab398599d21" + - "31bf228a-ae6e-462b-b70e-345d3e74b8ca" na61: data_dir: cds_migrator_kit/rdm/data/north_area/na61 plots: true diff --git a/cds_migrator_kit/rdm/streams_done.yaml b/cds_migrator_kit/rdm/streams_done.yaml index 8b445758..68b97636 100644 --- a/cds_migrator_kit/rdm/streams_done.yaml +++ b/cds_migrator_kit/rdm/streams_done.yaml @@ -331,3 +331,30 @@ records: missing_users: cds_migrator_kit/rdm/data/users communities_ids: - "e5de962b-5e2c-408f-be69-2823fda1f732" + ship: + data_dir: cds_migrator_kit/rdm/data/ship + plots: true + create_inclusion_request: true + extract: + dirpath: cds_migrator_kit/rdm/data/ship/dump + transform: + files_dump_dir: cds_migrator_kit/rdm/data/ship/files/ + missing_users: cds_migrator_kit/rdm/data/users + communities_ids: + - "8b213ed1-31a6-408a-b474-c0c39734c2e3" + load: + legacy_pids_to_redirect: cds_migrator_kit/rdm/data/ship/legacy_pids_to_redirect.json + ship-restricted: + data_dir: cds_migrator_kit/rdm/data/ship-restricted + plots: true + create_inclusion_request: true + restricted: "True" + extract: + dirpath: cds_migrator_kit/rdm/data/ship-restricted/dump/ + transform: + files_dump_dir: cds_migrator_kit/rdm/data/ship-restricted/files/ + missing_users: cds_migrator_kit/rdm/data/users + communities_ids: + - "8b213ed1-31a6-408a-b474-c0c39734c2e3" + load: + legacy_pids_to_redirect: cds_migrator_kit/rdm/data/ship-restricted/legacy_pids_to_redirect.json From cb121b551f9155c4358b60d18b2f3ce4ff6d2c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Z=C3=BCbeyde=20Civelek?= Date: Tue, 6 Oct 2026 13:31:35 +0200 Subject: [PATCH 2/2] fix(load): drop CERN-PH-EP draft RNs from EP public split --- .../rdm/records/load/entities/ep_split.py | 8 +++---- tests/cds-rdm/test_ep_approval_entry.py | 21 +++++++++++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/cds_migrator_kit/rdm/records/load/entities/ep_split.py b/cds_migrator_kit/rdm/records/load/entities/ep_split.py index febd1438..12f18658 100644 --- a/cds_migrator_kit/rdm/records/load/entities/ep_split.py +++ b/cds_migrator_kit/rdm/records/load/entities/ep_split.py @@ -19,7 +19,7 @@ from cds_migrator_kit.rdm.records.transform.entities.version import VersionEntry EPPHAPP_FILE_TYPE = "EPPHAPP_FILE" -EP_APPROVAL_REPORT_NUMBER_PREFIX = "CERN-EP" +EP_APPROVAL_REPORT_NUMBER_PREFIX_RE = re.compile(r"^CERN-(?:PH-)?EP-") EP_APPROVAL_REPORT_NUMBER_RE = re.compile(r"^CERN-(?:PH-)?EP-\d{2,4}-\d+$") @@ -223,7 +223,7 @@ def identifiers(self, identifiers): kept.append(id_entry) continue identifier = id_entry.get("identifier", "") - if identifier.startswith(EP_APPROVAL_REPORT_NUMBER_PREFIX): + if EP_APPROVAL_REPORT_NUMBER_PREFIX_RE.match(identifier): removed.append(identifier) else: kept.append(id_entry) @@ -331,10 +331,10 @@ def identifiers(self, identifiers): elif scheme != "cdsrn": kept.append(id_entry) continue - if not identifier.startswith(EP_APPROVAL_REPORT_NUMBER_PREFIX): + if not EP_APPROVAL_REPORT_NUMBER_PREFIX_RE.match(identifier): kept.append(id_entry) continue - # Remove CERN-EP-YYYY-NNN but keep CERN-EP-DRAFT report number + # Remove CERN-(PH-)?EP-YYYY-NNN but keep *-DRAFT report numbers. if EP_APPROVAL_REPORT_NUMBER_RE.match(identifier): if identifier != self.approval_request.report_number: raise UnexpectedValue( diff --git a/tests/cds-rdm/test_ep_approval_entry.py b/tests/cds-rdm/test_ep_approval_entry.py index 3cb97593..8485de00 100644 --- a/tests/cds-rdm/test_ep_approval_entry.py +++ b/tests/cds-rdm/test_ep_approval_entry.py @@ -442,7 +442,14 @@ class TestPublicEntryIdentifiers: """Test identifier handling in the public split.""" def test_public_removes_cern_ep_report_numbers(self, app): - entry = _make_entry(_versions_with_epphapp()) + legacy_draft_rn = "CERN-PH-EP-DRAFT-LHCF-2015-001" + identifiers = [ + {"identifier": RECID, "scheme": "cds"}, + {"scheme": "cdsrn", "identifier": APPROVED_REPORT_NUMBER}, + {"scheme": "cdsrn", "identifier": DRAFT_REPORT_NUMBER}, + {"scheme": "cdsrn", "identifier": legacy_draft_rn}, + ] + entry = _make_entry(_versions_with_epphapp(), identifiers=identifiers) result = PublicEntry( entry, _make_approval_request(), _make_migration_logger() ).build() @@ -451,6 +458,8 @@ def test_public_removes_cern_ep_report_numbers(self, app): cdsrn_values = {i["identifier"] for i in identifiers if i["scheme"] == "cdsrn"} assert APPROVED_REPORT_NUMBER not in cdsrn_values + assert DRAFT_REPORT_NUMBER not in cdsrn_values + assert legacy_draft_rn not in cdsrn_values assert any( i["scheme"] == "apprn" and i["identifier"] == APPROVED_REPORT_NUMBER for i in identifiers @@ -510,7 +519,14 @@ def test_restricted_removes_apprn(self, app): ) def test_restricted_keeps_draft_report_number(self, app): - entry = _make_entry(_versions_with_epphapp()) + legacy_draft_rn = "CERN-PH-EP-DRAFT-LHCF-2015-001" + identifiers = [ + {"identifier": RECID, "scheme": "cds"}, + {"scheme": "cdsrn", "identifier": APPROVED_REPORT_NUMBER}, + {"scheme": "cdsrn", "identifier": DRAFT_REPORT_NUMBER}, + {"scheme": "cdsrn", "identifier": legacy_draft_rn}, + ] + entry = _make_entry(_versions_with_epphapp(), identifiers=identifiers) result = RestrictedEntry( entry, _make_approval_request(), _make_migration_logger() ).build() @@ -522,6 +538,7 @@ def test_restricted_keeps_draft_report_number(self, app): } assert DRAFT_REPORT_NUMBER in cdsrn_values + assert legacy_draft_rn in cdsrn_values def test_restricted_raises_on_mismatched_report_number(self, app): identifiers = [