Skip to content

Source identifier validations#1165

Merged
laritakr merged 3 commits intomainfrom
source-identifier-validations
Apr 3, 2026
Merged

Source identifier validations#1165
laritakr merged 3 commits intomainfrom
source-identifier-validations

Conversation

@laritakr
Copy link
Copy Markdown
Contributor

@laritakr laritakr commented Apr 3, 2026

Validates source identifiers

  • validate & report row validation warnings and errors separately
  • correct method of finding in repository... finding in the entries table is not adequate to ensure the record exists, and finding in the repo by source identifier wasn't working correctly.

Screenshot

Screenshot 2026-04-03 at 2 11 28 PM Screenshot 2026-04-03 at 2 18 12 PM

Exported as file

row-errors-and-warnings_errors (1).csv

laritakr added 3 commits April 2, 2026 18:08
Validates that source identifiers are present and unique.

This addresses three situations which can occur with source identifiers:
1. A source identifier is missing from a row in the CSV file.
2. A source identifier is duplicated within the same CSV file.
3. A source identifier already exists in the repository, which would result in an update instead of a new record being created.
Finding existence in the entity table isn't adequate
for determining if a record exists in the repository.

Additionally the find by identifier wasn't using the correct term to look up.
Splits row validations into errors or warnings.

This allows us to display warnings in the UI without
preventing the user from proceeding with the import.
The UI will display warnings in a different color and
with a warning icon, while errors will still prevent
the user from proceeding until they are resolved.
def build_find_record(mapping_manager, mappings)
work_identifier = mapping_manager.resolve_column_name(flag: 'source_identifier', default: 'source').first&.to_s || 'source'
work_identifier_search = Array.wrap(mappings.dig(work_identifier, 'search_field')).first&.to_s ||
def build_find_record
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.

In order to find the correct identifier from the mappings, we have to load the mappings here. The mapping manager excluded the source_identifier and the find was falling back to the wrong search term.

@laritakr laritakr added the patch-ver for release notes label Apr 3, 2026
@laritakr laritakr merged commit 00a3d7b into main Apr 3, 2026
9 of 10 checks passed
@laritakr laritakr deleted the source-identifier-validations branch April 3, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch-ver for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants