Skip to content

fix(entities): link MEF by identifier, not type#4165

Draft
rerowep wants to merge 1 commit into
rero:stagingfrom
rerowep:wep-better-mef-sync
Draft

fix(entities): link MEF by identifier, not type#4165
rerowep wants to merge 1 commit into
rero:stagingfrom
rerowep:wep-better-mef-sync

Conversation

@rerowep

@rerowep rerowep commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
  • replace.py: identifier alone now links contribution/subjects/ genreForm entries to MEF; search falls back across every MEF family allowed for the field when the locally-declared type is wrong
  • replace.py: contribution type mismatches are tracked in a new type_mismatch dict, no longer conflated with the rero_only retry cache, which was silently blocking later documents sharing the same identifier
  • replace.py: document query now derives allowed entity types from RERO_ILS_ENTITIES_TYPES_FIELDS, so bf:Work-only subjects are no longer skipped from scanning
  • sync.py: sync_record recursion is now capped to guard against a pathological MEF pid cycle; raises specific RuntimeErrors instead of the bare Exception class
  • utils.py: get_mef_data_by_type reports a clear "no result" error instead of a confusing IndexError-derived message
  • proxy.py: search() no longer forwards cookies or arbitrary headers to the remote MEF server; deduplicated _get_query_params and removed a dead _post_process_result_hit override
  • sync.py, replace.py: switched logging calls to lazy %-style formatting instead of f-strings
  • cli.py: stopped reaching into a private method from outside the class

@coveralls

coveralls commented Jul 15, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 91.278%rerowep:wep-better-mef-sync into rero:staging. No base build found for rero:staging.

@rerowep
rerowep force-pushed the wep-better-mef-sync branch 2 times, most recently from 40a91e9 to 2499403 Compare July 20, 2026 12:29
@rerowep
rerowep force-pushed the wep-better-mef-sync branch from 2499403 to ddf6338 Compare July 23, 2026 05:44
* replace.py: identifier alone now links contribution/subjects/
  genreForm entries to MEF; search falls back across every MEF family
  allowed for the field when the locally-declared type is wrong
* replace.py: contribution type mismatches are tracked in a new
  `type_mismatch` dict, no longer conflated with the `rero_only` retry
  cache, which was silently blocking later documents sharing the same
  identifier
* replace.py: document query now derives allowed entity types from
  `RERO_ILS_ENTITIES_TYPES_FIELDS`, so `bf:Work`-only subjects are no
  longer skipped from scanning
* sync.py: `sync_record` recursion is now capped to guard against a
  pathological MEF pid cycle; raises specific `RuntimeError`s instead
  of the bare `Exception` class
* utils.py: `get_mef_data_by_type` reports a clear "no result" error
  instead of a confusing IndexError-derived message
* proxy.py: `search()` no longer forwards cookies or arbitrary
  headers to the remote MEF server; deduplicated `_get_query_params`
  and removed a dead `_post_process_result_hit` override
* sync.py, replace.py: switched logging calls to lazy %-style
  formatting instead of f-strings
* cli.py: stopped reaching into a private method from outside the
  class
* Closes rero#4176.

Co-Authored-by: Peter Weber <peter.weber@rero.ch>
@rerowep
rerowep force-pushed the wep-better-mef-sync branch from ddf6338 to 5db5609 Compare July 23, 2026 14:50
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.

2 participants