Skip to content

add(scripts): Add script to rebuild rdm_records_state.json - #592

Open
sakshamarora1 wants to merge 1 commit into
CERNDocumentServer:masterfrom
sakshamarora1:fix/past_stats
Open

add(scripts): Add script to rebuild rdm_records_state.json#592
sakshamarora1 wants to merge 1 commit into
CERNDocumentServer:masterfrom
sakshamarora1:fix/past_stats

Conversation

@sakshamarora1

Copy link
Copy Markdown
Contributor

fixes: #565

@zzacharo zzacharo left a comment

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.

Can you run a test for a collection that is correct on production, to verify that the fixed json is identical to the one produced from the migration?

log(f"DONE: legacy_recid={legacy_recid}")


def load_communities_ids(collection, config_files=STREAM_CONFIG_FILES):

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.

I would just pass the community ids here, and how we produce them, it can depend on the use case. wdyt?

)
]
pids = PersistentIdentifier.query.filter(
PersistentIdentifier.pid_type == "lrecid",

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.

we mint the lrecid for the parent of each migrated record or the latest on the migration time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For the parent pid

"""Mirror ``RecordLoad._load_record_state.convert_file_format``."""
return [
{
"legacy_file_id": entry["metadata"]["legacy_file_id"],

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.

I guess you checked the current format of the state json right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will test this against an already correct state json file as well and confirm it should be identical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verify past rdm_record_state against the version overwrite bug

2 participants