Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cds_migrator_kit/rdm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CommentsStreamDefinition,
)
from cds_migrator_kit.rdm.records.streams import ( # UserStreamDefinition,
RecordEPApprovalStreamDefinition,
RecordStreamDefinition,
)
from cds_migrator_kit.rdm.stats.runner import RecordStatsRunner
Expand Down Expand Up @@ -69,12 +70,20 @@ def migration():
"Can also be set per-collection in streams.yaml under transform.workers."
),
)
@click.option(
"--ep-approval",
is_flag=True,
help="Use the EP approval load stream (pre-EP draft snapshots without legacy minting).",
)
@with_appcontext
def run(collection, dry_run=False, keep_logs=False, workers=None):
def run(collection, dry_run=False, keep_logs=False, workers=None, ep_approval=False):
"""Run."""
stream_config = current_app.config["CDS_MIGRATOR_KIT_STREAM_CONFIG"]
stream_definition = (
RecordEPApprovalStreamDefinition if ep_approval else RecordStreamDefinition
)
runner = Runner(
stream_definitions=[RecordStreamDefinition],
stream_definitions=[stream_definition],
# stream_definitions=[UserStreamDefinition],
config_filepath=Path(stream_config).absolute(),
dry_run=dry_run,
Expand Down
21 changes: 21 additions & 0 deletions cds_migrator_kit/rdm/migration_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ def _(x): # needed to avoid start time failure with lazy strings
"validator": always_valid,
"datacite": "CDS",
},
"apprn": {
"label": _("Approval Report Number"),
"validator": schemes.is_approval_report_number,
"datacite": "CDS",
},
"aleph": {
"label": _("Aleph number"),
"validator": schemes.is_aleph,
Expand Down Expand Up @@ -518,3 +523,19 @@ def resolve_record_pid(pid):

# don't generate logs for migration
AUDIT_LOGS_ENABLED = False

### EP Approval configuration
# ===========================
CDS_CERN_SCIENTIFIC_COMMUNITY_ID = "8c42db1e-1230-42f0-9d99-5880bbee5326"
"""The id of the CERN Scientific community."""

CDS_EP_APPROVAL_COMMUNITIES = {
# Map community UUID → workflow config.
# UUIDs are used (not slugs) because slugs can be renamed.
#
"8dfea666-5758-4614-bbc1-56209565c78a": {
"label": "EP approval", # shown in UI buttons/headings
"referee_group": "cds-ph-ep-publication", # CERN e-group slug
"report_number_pattern": "CERN-EP-{year}-{seq:03d}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one has changed in the latest implementation on https://github.com/CERNDocumentServer/cds-rdm/tree/feature/ep-approval

},
}
3 changes: 2 additions & 1 deletion cds_migrator_kit/rdm/records/load/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

"""CDS-RDM Migration load package."""

from .ep_approval_load import CDSEPApprovalRecordServiceLoad
from .load import CDSRecordServiceLoad

__all__ = ("CDSRecordServiceLoad",)
__all__ = ("CDSEPApprovalRecordServiceLoad", "CDSRecordServiceLoad")
Loading
Loading