Skip to content

feat(etl): scheduled release publisher (parity 4A)#247

Open
raymondjacobson wants to merge 1 commit intoetl/parity-2e-track-download-dedupefrom
etl/parity-4a-publish-scheduled
Open

feat(etl): scheduled release publisher (parity 4A)#247
raymondjacobson wants to merge 1 commit intoetl/parity-2e-track-download-dedupefrom
etl/parity-4a-publish-scheduled

Conversation

@raymondjacobson
Copy link
Copy Markdown
Contributor

Summary

Stack 4A. Adds `ScheduledReleasePublisher`: a periodic background task (60s interval) that mirrors apps' `publish_scheduled_releases` celery task.

  • Tracks: `is_unlisted=true` → `false` when `is_scheduled_release` and `release_date < now()`
  • Playlists: `is_private=true` → `false` when `is_album AND is_scheduled_release AND release_date < now()` — apps only auto-publishes albums.

Wired into `Indexer.Start()` via errgroup alongside the existing MV refresher. Gated by `Config.EnableScheduledReleases` (default true; `DisableScheduledReleases()` opt-out).

Note on 3A (skipped)

Stack 3A (`sort_block_transactions`) is a no-op for go-openaudio. apps sorts L1 receipts (which arrive unordered); CometBFT delivers transactions in deterministic block order and `indexer.go` iterates them as-is. Verified, no commit needed.

Stack context

Stacked on #246 (2E — track_download dedupe). 3A skipped.

Test plan

  • `TestScheduledReleasePublisher_PublishesPastDueTrack` — past-due scheduled track gets published; future-scheduled stays unlisted.
  • `TestScheduledReleasePublisher_PublishesPastDueAlbum` — past-due album gets published; non-album scheduled playlist stays private.
  • `go build ./...` clean.

🤖 Generated with Claude Code

Stack 4A. Adds ScheduledReleasePublisher periodic task that mirrors apps'
publish_scheduled_releases celery task: every 60s, flips
- tracks: is_unlisted=true → false when is_scheduled_release and
  release_date < now()
- playlists: is_private=true → false when is_album AND is_scheduled_release
  AND release_date < now() (apps only auto-publishes albums)

Wired into Indexer.Start() via errgroup alongside the existing materialized
view refresher; gated by Config.EnableScheduledReleases (default true,
DisableScheduledReleases() opt-out).

Two DB-backed tests verify:
- past-due scheduled track publishes; future-scheduled track does not
- past-due scheduled album publishes; non-album scheduled playlist does not

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant