Skip to content

feat: classify remaining yt-dlp snapshot entries#4

Merged
antonio-orionus merged 1 commit into
mainfrom
codex/triage-ytdlp-snapshot
Jun 1, 2026
Merged

feat: classify remaining yt-dlp snapshot entries#4
antonio-orionus merged 1 commit into
mainfrom
codex/triage-ytdlp-snapshot

Conversation

@antonio-orionus

@antonio-orionus antonio-orionus commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • classify the generic yt-dlp download wrapper as network
  • add missingDependency as a first-class classifier kind for missing ffmpeg/ffprobe
  • update metadata, golden codes, README, and fixtures

Validation

  • npm run typecheck
  • npm run test
  • npm run build
  • git diff --check

Public API Changes

  • New exported error kind: missingDependency added to YtDlpErrorKind type and ClassifierKind type. This represents missing ffmpeg/ffprobe dependencies detected during yt-dlp operations.
  • New error code mapping: missingDependencyYTDLP_MISSING_DEPENDENCY (exported via codes() public API).
  • Metadata for the new kind includes: recoverable, user-actionable, suggests --ffmpeg-location flag, links to yt-dlp FFmpeg wiki documentation.

Classifier and Pattern Changes

  • Network classifier: Pattern broadened to match "unable to download video data" phrasing in addition to existing timeout/connection-failure patterns (affects yt-unable-download-video-data entry).
  • New missingDependency classifier: Detects stderr messaging when both ffprobe and ffmpeg are missing.
  • Classification updates in data/known-yt-dlp-strings.json:
    • yt-unable-download-video-data: nullnetwork
    • yt-pp-ffmpeg-not-found: nullmissingDependency

Snapshot and Fixture Updates

  • Updated tests/__golden__/codes.json snapshot with new missingDependency mapping.
  • Added test fixture tests/fixtures/yt-dlp-stderr/missingDependency/ffmpeg-not-found.txt.
  • README "Error kinds" table updated to document the new classifier.

SemVer Stability and Risk Areas

  • Type-safe addition: missingDependency is a new union member of exported YtDlpErrorKind type. Consumers using exhaustive type checking on this union will need updates.
  • No breaking changes to existing error kinds or function signatures.
  • Pattern matching expansion for network may affect edge cases in error classification behavior.

Validation Status

PR indicates validation via: npm run typecheck, npm run test, npm run build, git diff --check.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 470ed7eb-9347-4550-95f6-f97ae5b15e93

📥 Commits

Reviewing files that changed from the base of the PR and between 312c72c and 0fc579f.

📒 Files selected for processing (7)
  • README.md
  • data/known-yt-dlp-strings.json
  • src/kinds.ts
  • src/metadata.ts
  • src/patterns.ts
  • tests/__golden__/codes.json
  • tests/fixtures/yt-dlp-stderr/missingDependency/ffmpeg-not-found.txt
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (5)
tests/**

⚙️ CodeRabbit configuration file

Prioritize meaningful coverage, deterministic fixtures, golden-code stability, and whether tests prove the declared classifier behavior. Do not nitpick formatting unless it makes the test unreliable.

Files:

  • tests/fixtures/yt-dlp-stderr/missingDependency/ffmpeg-not-found.txt
  • tests/__golden__/codes.json
src/**

⚙️ CodeRabbit configuration file

This is a zero-runtime-dependency TypeScript library. Prioritize public API stability, SemVer impact, ESM/CJS export compatibility, regex correctness, classification precedence, recoverability metadata accuracy, and behavior for unknown stderr.

Files:

  • src/kinds.ts
  • src/metadata.ts
  • src/patterns.ts
src/metadata.ts

⚙️ CodeRabbit configuration file

Metadata codes are public API. Flag code string changes, recoverability changes, suggested flag changes, or docs URL changes unless tests and SemVer impact are explicit.

Files:

  • src/metadata.ts
data/**

⚙️ CodeRabbit configuration file

Snapshot data drives upstream compatibility. Watch for accidental wholesale rewrites, untriaged kind:null growth, mismatched source/fragment/kind values, and generated churn that should be split from source fixes.

Files:

  • data/known-yt-dlp-strings.json
src/patterns.ts

⚙️ CodeRabbit configuration file

Regex changes are behavior changes. Check ordering, overly broad matches, missed case variants, false positives, and whether the changed patterns are covered by snapshot or classifier tests.

Files:

  • src/patterns.ts
🔇 Additional comments (7)
src/kinds.ts (1)

17-17: LGTM!

src/metadata.ts (1)

93-99: LGTM!

src/patterns.ts (1)

69-73: LGTM!

Also applies to: 88-88

data/known-yt-dlp-strings.json (1)

26-27: LGTM!

Also applies to: 85-86

tests/__golden__/codes.json (1)

11-11: LGTM!

tests/fixtures/yt-dlp-stderr/missingDependency/ffmpeg-not-found.txt (1)

1-1: LGTM!

README.md (1)

78-78: LGTM!


📝 Walkthrough

Walkthrough

The PR adds a new missingDependency error classification kind to the yt-dlp error taxonomy. It defines the kind, adds detection patterns, classifies existing error strings, and updates documentation and test snapshots accordingly.

Changes

missingDependency Error Kind

Layer / File(s) Summary
Error kind definition and metadata
src/kinds.ts, src/metadata.ts
missingDependency is added to YT_DLP_ERROR_KINDS and assigned metadata: stable code YTDLP_MISSING_DEPENDENCY, marked recoverable and user-actionable, with suggested --ffmpeg-location flag and documentation link to yt-dlp's FFmpeg wiki page.
Pattern matching for error detection
src/patterns.ts
New pattern matches ffprobe/ffmpeg absence errors; network pattern is broadened to also match "unable to download video data" phrasing.
Error classification and testing
data/known-yt-dlp-strings.json, tests/__golden__/codes.json, tests/fixtures/yt-dlp-stderr/missingDependency/ffmpeg-not-found.txt, README.md
Two known error strings receive explicit kind classifications (yt-unable-download-video-datanetwork, yt-pp-ffmpeg-not-foundmissingDependency); golden code snapshot and test fixture are added; documentation table updated with the new kind and its metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

enhancement, documentation, tests

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: introducing classification for remaining yt-dlp error snapshot entries, specifically adding network and missingDependency classifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/triage-ytdlp-snapshot

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation enhancement New feature or request tests labels Jun 1, 2026
@antonio-orionus antonio-orionus merged commit 8154102 into main Jun 1, 2026
5 checks passed
@antonio-orionus antonio-orionus deleted the codex/triage-ytdlp-snapshot branch June 1, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant