Skip to content

feat: YouTube API v3 worker + fix CircleCI workflow failures - #311

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

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

Conversation

@circleci-app

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

Copy link
Copy Markdown
Contributor

Summary

  • YouTube API v3 Cloudflare Worker (app/src/index.ts): fetches channel stats, video listings, and search results from YouTube channel UCrjJP_SHUeCmqpTSHJCXkdA via the YouTube Data API v3. Falls back to demo data when no API key is configured. Exposes /health, /api/channel, /api/videos, and /api/search endpoints.
  • Worker config (app/wrangler.jsonc): worker name set to ytstudio, compatibility date 2024-09-23.
  • 8 vitest tests (app/test/index.spec.ts): cover all endpoints including health, channel, videos, search, 404s, and CORS preflight.

Workflow fixes

Job Problem Fix
python-checks ruff check . --fix exited non-zero due to PTH123 (open() → Path.open()) in fix_app.py and fix_index.py — not auto-fixable Rewrote both files to use Path.open()
node-checks functions/node_modules missing — only root pnpm install ran, so ESLint and tsc failed Added explicit cd functions && npm install step
node-checks Used cimg/node:20.18 but project requires Node 22 (.node-version) Upgraded all jobs to cimg/node:22.19
functions/package.json Duplicate firebase-admin entry; typescript: ^6 (non-existent) Removed duplicate, pinned typescript: ^5.0.0

New CI jobs

  • worker-test: installs app/ deps and runs all 8 vitest worker tests (runs on every branch).
  • worker-deploy: deploys the ytstudio worker via wrangler deploy on main only — requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID to be set in CircleCI project settings.

https://app.circleci.com/agents/gh/ruhdevops/chat/fde80fbf-a25d-47dd-ac21-90f9bf4acc97

- app/src/index.ts: Cloudflare Worker fetching YouTube Data API v3
  (channel stats, video listing, search) for channel UCrjJP_SHUeCmqpTSHJCXkdA
- app/test/index.spec.ts: 8 vitest tests covering all worker endpoints
- app/wrangler.jsonc: set worker name 'ytstudio' and compatibility date

Fix CircleCI workflow failures:
- .circleci/config.yml: upgrade to Node 22, add 'npm install' step for
  functions/ (node_modules was missing), add worker-test and worker-deploy
  jobs, add 'validate' and 'deploy' workflows
- fix_app.py, fix_index.py: replace builtin open() with Path.open() to
  fix PTH123 ruff errors that blocked the python-checks job
- functions/package.json: remove duplicate firebase-admin entry and
  downgrade typescript to ^5 (^6 does not exist)
- pnpm-lock.yaml: sync lockfile with package.json changes

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 1, 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 1, 2026 12:47am UTC
yt-studio-production Error Error Nov 1, 2026 12:47am 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 c8bf71e Nov 01 2026, 12:46 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 c8bf71e Nov 01 2026, 12:47 AM

@netlify

netlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for elegant-seahorse-d9d460 ready!

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

Copy link
Copy Markdown

❌ Deploy Preview for ytr-studio failed.

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

This branch had an error being deployed

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