fix(cli): improve docs generation logging — silence example noise, elevate skipped API errors#15621
Conversation
Co-Authored-By: kenny <kenny@buildwithfern.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Docs Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on
Docs generation runs |
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
- Change 'Skipping API workspace' from warn to error level - Include API workspace name in all skip/error messages - Aggregate per-endpoint frontmatter warnings into single summary line - Remove duplicate validateOpenApiSpecForDocsCompat from generateIr.ts (the OSS validator already handles this) Co-Authored-By: kenny <kenny@buildwithfern.com>
Co-Authored-By: kenny <kenny@buildwithfern.com>
…ssages Include actual validation reasons inline in the skip error message instead of redirecting to fern check (which doesn't show the same errors). Co-Authored-By: kenny <kenny@buildwithfern.com>
Test Results: Improved Docs Generation LoggingBuilt CLI from this branch and ran Before/After ComparisonBefore (Kenny's production logs on main): After (PR branch CLI): Assertion Details (7/7 passed)
Test Fixture3 APIs in a single docs project:
CI: 186/186 passed | Devin session |
Description
Improves CLI log output during
fern generate --docsin three ways:1. Silence verbose example validation warnings: Individual example validation warnings (
"Example value 'element' is not a valid enum value...") moved fromwarn→debug. The per-API summary ("Validated 54 examples: 39 valid, 15 invalid") stays atwarn. Users get better output fromfern check --warnings.2. Improve logging for skipped APIs: When an API is skipped during docs generation:
warn→error(skipping an API is actionable)fulfillment-importer) instead of full absolute path3. Remove duplicate validation: Removed
validateOpenApiSpecForDocsCompat()fromgenerateIr.ts— the OSS validator already catches the same issues, so this was producing duplicate log lines.Before
After
Changes Made
ExampleTypeFactory.ts: Moved 2warn→debug(enum mismatch + primitive type mismatch)ExampleTypeFactory.test.ts: Updated 23 test assertionsmockLogger.warn→mockLogger.debugExampleConverter.ts: Moved 2warn→debug(enum mismatch + primitive type mismatch) in v3 importergenerateDocsWorkspace.ts: Skip loggingwarn→error, added API name, addedsummarizeValidationErrors()helper with inline reasonsgenerateIr.ts: Removed duplicatevalidateOpenApiSpecForDocsCompat()functionoss-validator/index.ts: ExportedValidationViolationtypeTesting
Link to Devin session: https://app.devin.ai/sessions/a4d85bb7350141469b5c794cb560d189