Skip to content

fix: resolve CI failures and add YouTube Worker deployment pipeline - #327

Open
circleci-app[bot] wants to merge 1 commit into
mainfrom
chunk/fix-ci-add-worker-deploy
Open

circleci-app[bot] wants to merge 1 commit into
mainfrom
chunk/fix-ci-add-worker-deploy

Conversation

@circleci-app

@circleci-app circleci-app Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix node-checks CI failure: The job ran pnpm install at root but functions/ is a separate npm package — ESLint and tsc weren't available. Added npm install in functions/ before lint/typecheck steps.
  • Add worker TypeScript check: Added a npx tsc --noEmit step at root to validate src/youtube-worker.ts (the Cloudflare Worker) on every CI run.
  • Add deploy-worker job: New CircleCI job deploys src/youtube-worker.ts to Cloudflare Workers as ytstudio using wrangler. Runs only on main merges via the cloudflare context (requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID env vars).
  • Fix functions/package.json: Removed duplicate firebase-admin, removed stray lint dep, corrected node engine from 24 to 20, downgraded TypeScript from ^6.0.0 to ^5.5.0 (v6 doesn't exist yet).
  • Expand functions/.eslintrc.js: Was minified; expanded to readable form and added .eslintrc.js to ignorePatterns to prevent ESLint from trying to parse its own config file.
  • Ruff auto-fixes: Applied quote style and unused import fixes to fix_app.py, fix_deps.py, fix_index.py.

Worker Endpoints

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

Endpoint Description
GET / or /health Health check + endpoint listing
GET /api/channel Channel stats (UCrjJP_SHUeCmqpTSHJCXkdA)
GET /api/videos Latest videos (paginated, maxResults param)
GET /api/search?q=... Search videos in channel

Requires YOUTUBE_API_KEY secret binding in Cloudflare; falls back to demo data if missing.

Test plan

  • CI validate workflow: python-checks and node-checks both pass
  • CI deploy workflow triggers on merge to main and runs deploy-worker
  • Set CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, and YOUTUBE_API_KEY in Cloudflare/CircleCI contexts before first deployment
  • After deploy, hit https://ytstudio.<account>.workers.dev/api/videos to confirm live data

https://app.circleci.com/agents/gh/ruhdevops/chat/90c71c74-bfe5-468b-b2b3-8bae79811414

- Fix node-checks job: add npm install in functions/ before lint/tsc
  (pnpm install at root doesn't install functions' npm dependencies)
- Add TypeScript type check step for Cloudflare Worker (src/)
- Add deploy-worker job: deploys src/youtube-worker.ts to Cloudflare
  Workers as 'ytstudio' on main branch merges via cloudflare context
- Fix functions/package.json: remove duplicate firebase-admin, remove
  stray lint dep, correct node engine 24→20, TypeScript ^6→^5.5
- Expand functions/.eslintrc.js from minified form; add .eslintrc.js
  to ignorePatterns so ESLint doesn't try to parse itself
- Regenerate functions/package-lock.json after dependency cleanup
- Remove duplicate circletui from root package.json
- Apply ruff auto-fixes to fix_app.py, fix_deps.py, fix_index.py
  (quote style, unused import)

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 Nov 5, 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 Nov 5, 2026 12:30am UTC
yt-studio-production Error Error Nov 5, 2026 12:30am UTC

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

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 d212b51 Nov 05 2026, 12:31 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

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 d212b51 Nov 05 2026, 12:31 AM

@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for elegant-seahorse-d9d460 ready!

Name Link
🔨 Latest commit d212b51
🔍 Latest deploy log https://app.netlify.com/projects/elegant-seahorse-d9d460/deploys/6aebce0fb187ced8dfa6e076
😎 Deploy Preview https://deploy-preview-327--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 Nov 5, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for ytr-studio failed.

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

This branch had an error being deployed

2 failed deployments
Preview – yt-studio — d212b51e Deployed Nov 5, 2026 by vercel[bot]
Preview – yt-studio-production — d212b51e Deployed Nov 5, 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