fix(entities): link MEF by identifier, not type#4165
Draft
rerowep wants to merge 1 commit into
Draft
Conversation
rerowep
force-pushed
the
wep-better-mef-sync
branch
2 times, most recently
from
July 20, 2026 12:29
40a91e9 to
2499403
Compare
rerowep
force-pushed
the
wep-better-mef-sync
branch
from
July 23, 2026 05:44
2499403 to
ddf6338
Compare
* 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
force-pushed
the
wep-better-mef-sync
branch
from
July 23, 2026 14:50
ddf6338 to
5db5609
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
type_mismatchdict, no longer conflated with therero_onlyretry cache, which was silently blocking later documents sharing the same identifierRERO_ILS_ENTITIES_TYPES_FIELDS, sobf:Work-only subjects are no longer skipped from scanningsync_recordrecursion is now capped to guard against a pathological MEF pid cycle; raises specificRuntimeErrors instead of the bareExceptionclassget_mef_data_by_typereports a clear "no result" error instead of a confusing IndexError-derived messagesearch()no longer forwards cookies or arbitrary headers to the remote MEF server; deduplicated_get_query_paramsand removed a dead_post_process_result_hitoverride