Skip to content

feat(link-wizard): save soundcloud followers - #525

Open
chiptus wants to merge 3 commits into
mainfrom
feat/UPL-39/linkwizard-soundcloud-followers
Open

chiptus wants to merge 3 commits into
mainfrom
feat/UPL-39/linkwizard-soundcloud-followers

Conversation

@chiptus

@chiptus chiptus commented Oct 13, 2026

Copy link
Copy Markdown
Owner

UPL-39: selecting a SoundCloud candidate in the Link Wizard now saves its follower count to soundcloud.followers_count alongside the URL (Spotify unchanged; the next sync-artist-data run may overwrite it). Adds admin insert/update RLS policies on soundcloud, since only the service role could write it before.

Verification

  • In the Link Wizard, select a SoundCloud candidate's URL and Save & Next; the artist list shows its soundcloud_followers.
  • Select a SoundCloud candidate with no follower count; no soundcloud row is written.
  • Select a Spotify candidate; no follower count is persisted.
  • As a non-admin user, writing to soundcloud is still rejected by RLS.

Note: the migration needs the staging label to pass the migration gate; no integration test added (no local Supabase available to verify one).

🤖 Generated with Claude Code

https://claude.ai/code/session_018s7p4uu8gLGvgvJAHujagc


Generated by Claude Code

Copilot AI balanced review requested due to automatic review settings October 13, 2026 05:09
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
upline Ready Ready Preview Oct 22, 2026 5:44am UTC

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Deploy → staging — workflow run
Last updated: 2026-10-22 05:44:33 UTC

  • ✅ DB migrations succeeded
  • ⏭️ Edge functions skipped (no changes)
  • ⏭️ Type generation skipped (no changes)

@chiptus

chiptus commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Require staging label for migrations is red because this PR adds a migration (20261013060000_soundcloud_admin_write_policies.sql) and needs the staging label. That label is off-limits to the agent pipeline, so this is waiting on the maintainer to add it. Not a code failure; no fix to push. I'll keep watching the remaining checks.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Stale follower state, delayed synchronization, future migration dating, and missing integration coverage must be addressed.

3 open findings
What changed in this PR

Adds SoundCloud follower persistence to the Link Wizard and grants authorized admins database write access.

Changes:

  • Stages and saves candidate follower counts.
  • Adds secure SoundCloud insert/update policies.
  • Adds candidate-selection unit tests.
File Description
supabase/​migrations/​20261013060000_soundcloud_admin_write_policies.sql Adds admin write policies.
src/​pages/​admin/​festivals/​LinkWizard/​LinkWizardStep.tsx Stages follower counts for saving.
src/​api/​artistSearch/​mergeCandidateSelection.ts Extracts SoundCloud candidate followers.
src/​api/​artistSearch/​mergeCandidateSelection.test.ts Tests follower-selection behavior.
src/​api/​artists/​useUpdateArtist.ts Upserts followers into SoundCloud data.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/api/artists/useUpdateArtist.ts Outdated
Comment thread src/pages/admin/festivals/LinkWizard/LinkWizardStep.tsx Outdated
Comment on lines +256 to +258
if (data.soundcloud_followers !== undefined) {
updates.soundcloud_followers = data.soundcloud_followers;
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not adding this here: the existing Link Wizard integration suite stubs Spotify-only search results and I have no local Supabase to verify a new SoundCloud/RLS case. Unit tests cover the selection logic; the integration + non-admin RLS case is left for a follow-up.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should have access to staging supabase

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The session only has the staging anon key (VITE_SUPABASE_URL + publishable key). The integration fixtures (signInAsTestUser, grantAdminRole) need the service-role admin API, and the harness is built for a local stack, so I can't run the test, and I'd rather not push one unverified. If you can expose a staging service-role key to the routine environment (or run pnpm run test:integration locally), I'll add the SoundCloud follower + non-admin RLS cases. Otherwise it's a follow-up.


Generated by Claude Code

…syncable

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018s7p4uu8gLGvgvJAHujagc
@github-actions

Copy link
Copy Markdown

Playwright test results

passed  68 passed

Details

stats  68 tests across 22 suites
duration  1 minute, 30 seconds
commit  e5280d0

@chiptus

chiptus commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

migrate / Push migrations (staging) failed with migration-history drift: staging already had 20261008060000_add_festival_day_end_hour.sql (from the day-end-hour PR), which this branch lacked. It's on main now, so I merged main in (78082d0); the re-run on this push should apply cleanly. I did not run any db reset/repair on staging.


Generated by Claude Code

@chiptus

chiptus commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Run Edge Function Tests failed on 78082d0 before any test ran: supabase start couldn't pull its Docker images (toomanyrequests: Data limit exceeded). That's a runner/registry rate limit, not this PR (it touches no edge functions). I re-ran the failed job once; a second failure will be treated as real.


Generated by Claude Code

@chiptus

chiptus commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

CI is red on test / run and report / report, but not because of this PR. The supabase start step failed pulling docker images with toomanyrequests: Data limit exceeded, which is a registry rate limit. Unit tests, typecheck and lint pass. No code fix exists for this, so I re-ran the failed jobs once. The open review thread about integration tests is still waiting on a staging service-role key or a local pnpm run test:integration run, as noted there.


Generated by Claude Code

@chiptus

chiptus commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

CI test / run failed before any test ran: supabase start couldn't pull images (toomanyrequests: Data limit exceeded from the registry). That's runner infrastructure, not this PR's diff. I re-ran the failed jobs once; if it fails again it's still the registry limit and needs a maintainer re-run later.


Generated by Claude Code

This branch was successfully deployed

2 active deployments
Preview — 78082d0c Deployed Oct 22, 2026 by vercel[bot]
staging — 78082d0c Deployed Oct 22, 2026 by chiptus via types / Regenerate types (staging) #149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants