Skip to content

Release: videos CMS (collections, YouTube sync, review workflow) - #314

Merged
jadhavgaurav merged 3 commits into
mainfrom
development
Oct 31, 2026
Merged

jadhavgaurav merged 3 commits into
mainfrom
development

Conversation

@jadhavgaurav

Copy link
Copy Markdown
Contributor

What this ships to production

Only the CMS half of the /videos work (merged to development in #312, CI green). There are no apps/web changes in this PR, so the website is unchanged. The page itself is in #313 and stays in development until it is approved.

Merging this runs the CMS deploy workflow: the image is rebuilt and the migration 20261031_100000_add_videos runs on boot (additive: new tables and enum labels, nothing is altered or dropped).

Before merging

  • Add the GitHub Actions secret YOUTUBE_API_KEY (read-only key restricted to YouTube Data API v3). The workflow renders it into the server .env. Without it the sync uses the RSS feed, which has no video length and cannot see removed videos, and YouTube's feed endpoint returned 404 in testing.
  • Optional repo variables: YOUTUBE_EXPLAINER_PLAYLIST_ID and YOUTUBE_DEMO_PLAYLIST_ID (pre-fill the category of new uploads).
  • Pick a deploy window you are happy to watch: /api/health, then open Content, Videos in the admin.

What happens after it deploys

  • The hourly task syncYoutubeVideos (runs only where PAYLOAD_AUTO_RUN=true) imports the channel's recent uploads as drafts marked Needs review. It never publishes anything. Expect about 14 drafts and a "Videos to review" card on the dashboard.
  • If WEBHOOK_TEAMS_URL is set without WEBHOOK_TEAMS_EVENTS, that Teams channel gets one "N new videos need review" message. An integration row subscribed to video.needs-review gets it too.
  • Nothing is visible on the public site until someone runs the backfill and sets VIDEOS_SOURCE=cms (rollout doc, section 26).

Rollback

Revert this PR and redeploy. The tables stay but are unused.

Checks

CI green on #312 (CMS lint, typecheck, tests, types drift, build). Migration verified against Payload's own schema push with all earlier migrations applied in order. Playlist and Teams behaviour is covered by mocked tests only; no real YouTube or Teams call has been made.

jadhavgaurav and others added 3 commits October 31, 2026 12:03
…a clean editor

Adds the `videos` and `videoTopics` collections for the /videos page. Nothing on the
public site changes: the page itself ships separately and the CMS only becomes its data
source when VIDEOS_SOURCE=cms is set on the web app.

- Videos play inline on the listing, so there is no per-video page: no SEO block,
  permalink, or detail route. The slug stays but is hidden.
- Editor: the video and its YouTube facts at the top, category (explainer or product
  demo), topics with one-click suggestions from the YouTube hashtags and inline "+ New",
  summary with a "use the first paragraph" helper, one video in the hero at a time.
- List view: thumbnail, state chip (Needs review, Live, or a problem such as private on
  YouTube), category, topics and length. Dashboard card: Videos to review.
- Hourly sync (task syncYoutubeVideos, gated by PAYLOAD_AUTO_RUN): imports new uploads as
  needs-review drafts. Uses the YouTube Data API when YOUTUBE_API_KEY is set (length,
  privacy, removed videos), otherwise the RSS feed. Optional category suggestion from two
  playlists. Never publishes anything.
- Publish gate: a video needs a category, one topic and a summary.
- Teams message "N new videos need review" (event video.needs-review) when a sync run
  imports new videos and an integration subscribes to it.
- Migration 20261031_100000_add_videos, checked against Payload's own schema push on a
  database with every earlier migration applied in order.
- Backfill script for the 14 videos on the current page (dry run by default), and the
  rollout steps in docs/operations/PRODUCTION-ROLLOUT.md (section 26).
feat(cms): videos library with a YouTube sync, review workflow and editor
@jadhavgaurav
jadhavgaurav marked this pull request as ready for review October 31, 2026 07:22
@jadhavgaurav
jadhavgaurav merged commit a4fae5c into main Oct 31, 2026
10 checks passed
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.

2 participants