Repository navigation
Newsletter issue blocks: edit every block in DataOps, revisions, two-way Relay sync - #501
Merged
Merged
Conversation
…ree-way Relay sync
…ad-only, Blocks tab on the preview page, sponsor-doc sync note
…auto-sync to issue and Relay
…sor-doc auto-sync, slot release
…ponsor-sync modules
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.
Staff can now edit every block of a newsletter issue in DataOps, not only the sponsor doc. Each edit becomes a revision you can read from the CLI, and blocks sync with Relay in both directions.
What's in it
/newsletter/<issue>): a "Content blocks" section. Every block is a form whose fields mirror Relay's block types (intro, sponsor, event spotlight, course updates, events list, recording, article, and the rest). Each block has Save and History buttons and shows "In sync" or "Edited, not synced". The section also has "Check Relay" (a dry run) and "Sync with Relay". The first time, an issue with no blocks offers "Import blocks from Relay".dataops newsletter revisions <issue> [--block <id>] [--origin edit] [--diff] [--rev N]dataops newsletter blocks <issue> [--show] [--import weekly-304 --target production|dev],block-edit,blocks-sync [--dry-run]./api/newsletter-issues/:id/blockswithGET,POST /import,PUT /:blockId(withversion),POST /sync(dryRun) andGET /revisions.Sync decision: two-way, three-way merge per block
We did not make DataOps the only source of truth. Relay still renders and sends the newsletter, and its blocks still get written outside DataOps: Relay's editor, template autofill, and
newsletter relay-syncfor the sponsor block. Rebuilding Relay from DataOps would silently overwrite those edits.Instead, each block stores the content both sides last agreed on, as a hash plus Relay's
updated_at. A sync then does this for each block:PUTper block).relay-pullrevision.Safeguards:
Relay targets are fixed, and each has its own runtime secret:
productionusesrelay-production.dtc-newsletter-api-key,devusesrelay-dev.api-keys. The key is never returned or logged. Nothing in this PR sends a newsletter, campaign or test email.Tests
tests/newsletter-blocks.test.ts(fake Relay): import per target, edit with revision and diff, stale or invalid edit, push and pull round-trip, refusal on conflict, race between plan and push, campaign lock, Relay 404 and timeout, body cap.test/newsletter-blocks.test.mjs, frontendtest/newsletter-blocks.test.mjs.