Skip to content

feat: YouTube API v3 worker deployment + fix CI workflow failures - #260

Open
circleci-app[bot] wants to merge 1 commit into
mainfrom
chunk/youtube-api-worker-deployment
Open

circleci-app[bot] wants to merge 1 commit into
mainfrom
chunk/youtube-api-worker-deployment

Conversation

@circleci-app

@circleci-app circleci-app Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix functions/package.json: Remove duplicate firebase-admin key (^13.9.0 + ^10.3.0). Duplicate JSON keys cause unpredictable resolution — kept ^13.9.0 which matches the lock file.
  • Fix app/wrangler.jsonc: Replace placeholder <WORKER_NAME> and <COMPATIBILITY_DATE> with real values (yt-studio-app, 2024-11-01) so the Cloudflare Worker can actually be built/tested.
  • Fix node-checks CI job: Added missing cd functions && npm install step before npm run lint. Without it, ESLint couldn't find its dependencies and the job always failed.
  • Add worker-tests job: Installs app/ dependencies and runs the Cloudflare vitest-pool-workers test suite against the YouTube API v3 worker.
  • Add deploy-worker job: Installs wrangler CLI globally, then deploys src/youtube-worker.ts as the ytstudio Cloudflare Worker using CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID environment variables.
  • Add deploy workflow: Gates deployment on main only — runs python-checks → node-checks → worker-tests → deploy-worker in sequence.
  • validate workflow: All three check jobs run in parallel on every branch push.

Worker: YouTube API v3 (src/youtube-worker.ts)

The existing worker already implements full YouTube Data API v3 integration for channel UCrjJP_SHUeCmqpTSHJCXkdA (Ruh Al Tarikh):

Endpoint Description
GET / or /health Worker health + endpoint index
GET /api/channel Channel stats (subscribers, views, video count)
GET /api/videos?maxResults=N&pageToken=T Paginated video listing from uploads playlist
GET /api/search?q=query Search videos within the channel

Falls back to demo data when YOUTUBE_API_KEY is not bound.

Test plan

  • Verify validate workflow runs all three jobs on non-main branches
  • Verify deploy workflow triggers on main and gates on tests passing
  • Confirm worker-tests passes (Hello World unit + integration tests)
  • Confirm node-checks passes with the new npm install step in functions/
  • Add CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID to CircleCI project env vars before merging

https://app.circleci.com/agents/gh/ruhdevops/chat/d4beedae-099c-4398-8d4d-ed398476c21e

- Fix functions/package.json: remove duplicate firebase-admin dependency
  that was causing npm resolution issues (kept ^13.9.0, removed ^10.3.0)
- Fix app/wrangler.jsonc: replace placeholder <WORKER_NAME> and
  <COMPATIBILITY_DATE> with real values (yt-studio-app, 2024-11-01)
- Update .circleci/config.yml:
  - Add separate npm install step for functions/ before linting (was
    missing, causing node-checks job to fail)
  - Add worker-tests job: installs app/ deps and runs Cloudflare vitest
    pool tests against the worker
  - Add deploy-worker job: installs wrangler globally and deploys the
    YouTube API v3 worker (src/youtube-worker.ts) as 'ytstudio' to
    Cloudflare Workers using CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID
  - Add deploy workflow that gates deployment on all checks passing on
    main branch (python-checks → node-checks → worker-tests → deploy-worker)
  - Validate workflow runs all three check jobs in parallel on every branch

AI-Generated: true
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
yt-studio Error Error Oct 19, 2026 2:25am UTC
yt-studio-production Error Error Oct 19, 2026 2:25am UTC

@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
ytstudio f07f40a Oct 19 2026, 02:25 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
ytstudio f07f40a Oct 19 2026, 02:25 AM

@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for elegant-seahorse-d9d460 ready!

Name Link
🔨 Latest commit f07f40a
🔍 Latest deploy log https://app.netlify.com/projects/elegant-seahorse-d9d460/deploys/6ad57f9e45dad08b3735755a
😎 Deploy Preview https://deploy-preview-260--elegant-seahorse-d9d460.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for ytr-studio failed.

Name Link
🔨 Latest commit f07f40a
🔍 Latest deploy log https://app.netlify.com/projects/ytr-studio/deploys/6ad57f9e5b800a01d3963390

This branch had an error being deployed

2 failed deployments
Preview – yt-studio-production — f07f40a6 Deployed Oct 19, 2026 by vercel[bot]
Preview – yt-studio — f07f40a6 Deployed Oct 19, 2026 by vercel[bot]
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.

0 participants