refactor(EventUpsert): delegate to DM core upsert-post ability#209
Merged
Conversation
…sert-post ability Replaces inline createEventPost/updateEventPost/hasDataChanged with a single call to datamachine/upsert-post, which handles content-hash idempotency and provenance stamping. Domain-specific logic kept in the extension: - Fuzzy identity resolution (findExistingEventViaAbility + findExistingEvent) - Advisory locks by (date, normalized_title) - Venue/promoter taxonomy assignment with smart merging - Featured image processing - Submission metadata - Block content generation Net: -122 lines, simpler create/update branching, leverages core primitives. Refs Extra-Chill/data-machine#1167 Closes #208
Contributor
Homeboy Results —
|
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.
Summary
Refactors
EventUpsertto delegate the create/update/no_change decision to DM core'sdatamachine/upsert-postability (shipped in data-machine#1167 / v0.77.0).What changed
createEventPost(),updateEventPost(),hasDataChanged()— replaced by single call todatamachine/upsert-postbuildEventMetaInput()— extracts submission metadata for core upsertbuildEventData()— accepts optional$existing_post_idfor datetime hydration on update pathexecuteUpsertWithinLock()— domain-specific identity resolution → core upsert → post-upsert event processingWhat stayed (domain-specific)
findExistingEventViaAbility,findExistingEvent, all find* helpers)(date, normalized_title)generate_event_block_content)Size
EventUpsert.php: 1,701 → 1,579 lines (-122)Depends on
post_authorparam to core ability)Closes