feat(etl): index stems, remixes, route_id, and migration playlist routes#237
Open
raymondjacobson wants to merge 2 commits intomainfrom
Open
feat(etl): index stems, remixes, route_id, and migration playlist routes#237raymondjacobson wants to merge 2 commits intomainfrom
raymondjacobson wants to merge 2 commits intomainfrom
Conversation
Each merge to main pushes a new :edge tag, triggering the auto-upgrader on snapshot-serving nodes. When those nodes restart and catch up, the snapshot creator skips every 100k-block interval that fires during CatchingUp=true, leaving no fresh snapshots for up to ~16 hours. Re-enable once PR #226 (catch-up snapshot fix) is merged and deployed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add discovery-provider parity for the four entity-manager side-effects that were previously declared but unimplemented: - stems table: populated on track create from metadata.stem_of.parent_track_id; cleaned up on track delete (rows where this track is the child). - remixes table: refreshed on track create and update from metadata.remix_of.tracks[].parent_track_id (delete-all-then-insert). - tracks.route_id column: now set on create and rebuilt on title change, using helpers.create_track_route_id semantics (handle/sanitized-title). Falls back to a synthetic 'user-<id>' handle for guest uploaders, matching apps#13818. - playlist_routes migration row: on create, also insert the legacy '<title>-<id>' slug as is_current=false so old ID-suffixed URLs keep resolving (mirrors discovery's update_playlist_routes_table is_create=True). Migration 0016 adds the stems and remixes tables (matching the production discovery-provider schema, including the remixes_child_idx). New shared helpers live in track_relations.go. Pure-unit tests cover the helpers; eight DB-backed tests cover the table-maintenance side effects on create / update / delete. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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
Adds discovery-provider parity for the four entity-manager side-effects that were declared as constants in handler.go but not implemented (
Stem,Remix,TrackRoute,PlaylistRoute). These aren't separate transaction types in discovery — they're side effects of Track/Playlist CRUD, and that's how they're wired here.metadata.stem_of.parent_track_id; cleaned up on track delete (rows where this track is the child).metadata.remix_of.tracks[].parent_track_id(delete-all-then-insert).helpers.create_track_route_idsemantics (<handle>/<sanitized-title>). Falls back to a syntheticuser-<id>handle for guest uploaders, matching apps#13818.<title>-<id>slug asis_current=falseso old ID-suffixed URLs keep resolving (mirrors discovery'supdate_playlist_routes_table is_create=True).Migration
0016_stems_remixesadds thestemsandremixestables (matching production's discovery-provider schema, includingremixes_child_idx). New shared helpers live intrack_relations.go.Test plan
TestTrackCreate_PopulatesStemsTableTestTrackCreate_PopulatesRemixesTableTestTrackCreate_SetsRouteIDTestTrackCreate_GuestUserSyntheticHandleTestTrackUpdate_RefreshesRemixesTestTrackUpdate_RebuildsRouteIDOnTitleChangeTestTrackDelete_RemovesStemsForChildTestPlaylistCreate_AddsMigrationRoutego build ./...andgo vet ./...clean🤖 Generated with Claude Code