Skip to content

feat(cli): support local library git inputs - #17510

Merged
aditya-arolkar-swe merged 2 commits into
mainfrom
devin/1787585764-local-library-git-ref
Aug 24, 2026
Merged

feat(cli): support local library git inputs#17510
aditya-arolkar-swe merged 2 commits into
mainfrom
devin/1787585764-local-library-git-ref

Conversation

@Ryan-Amirthan

@Ryan-Amirthan Ryan-Amirthan commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

Linear ticket: Closes

Allow fern docs md generate --local to resolve library documentation inputs from git repositories, including optional refs and repository-relative subpaths.

Changes Made

  • Extract the existing shallow clone/ref materialization behavior from remote spec loading into @fern-api/github, preserving default-branch, branch/tag, and commit-SHA handling.
  • Reuse that helper for local library docs, mount the repository root at /repo, and forward packagePath, source URL, and configured ref to the parser.
  • Register process-exit cleanup for temporary repository checkouts.
  • Add focused clone/path validation tests, a local git generation integration test, remote metadata regression coverage, and a CLI changelog entry.
  • Updated README.md generator (if applicable)

Testing

  • Unit tests added/updated
  • Manual testing completed
  • pnpm turbo run compile --filter @fern-api/github --filter @fern-api/configuration-loader --filter @fern-api/library-docs-generator --filter @fern-api/workspace-loader
  • pnpm turbo run test --filter @fern-api/github --filter @fern-api/library-docs-generator --filter @fern-api/workspace-loader
  • pnpm turbo run test --filter @fern-api/configuration-loader -- src/docs-yml/__test__/gitRefVersioning.matrix.test.ts
  • pnpm turbo run depcheck --filter @fern-api/github --filter @fern-api/configuration-loader --filter @fern-api/library-docs-generator --filter @fern-api/workspace-loader
  • pnpm lint:biome --fix && pnpm format:fix && pnpm check:fix
  • pnpm test:ete ran 168 passing tests; the suite still reported two .fernignore timeouts, a missing FERN_ORG_TOKEN_DEV, and an existing validate snapshot mismatch.

Link to Devin session: https://app.devin.ai/sessions/33a7d2928e6a4665be1498ed388596ac
Requested by: @Ryan-Amirthan


Open in Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread packages/commons/github/src/cloneRepositoryAtRef.ts
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-24T04:15:25Z).

Fixture main PR Delta
docs 270.7s (n=5) 258.6s (35 versions) -12.1s (-4.5%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-08-24T04:15:25Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-24 17:01 UTC

@github-actions

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-24T04:15:25Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 75s (n=5) 113s (n=5) 70s -5s (-6.7%)
go-sdk square 137s (n=5) 298s (n=5) 118s -19s (-13.9%)
java-sdk square 239s (n=5) 285s (n=5) 225s -14s (-5.9%)
php-sdk square 64s (n=5) N/A 49s -15s (-23.4%)
python-sdk square 152s (n=5) 252s (n=5) 117s -35s (-23.0%)
ruby-sdk-v2 square 95s (n=5) 125s (n=5) 88s -7s (-7.4%)
rust-sdk square 228s (n=5) 215s (n=5) 158s -70s (-30.7%)
swift-sdk square 60s (n=5) 450s (n=5) 57s -3s (-5.0%)
ts-sdk square 138s (n=5) 150s (n=5) 119s -19s (-13.8%)

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 fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-08-24T04:15:25Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-24 17:02 UTC

@aditya-arolkar-swe
aditya-arolkar-swe merged commit ab95307 into main Aug 24, 2026
223 checks passed
@aditya-arolkar-swe
aditya-arolkar-swe deleted the devin/1787585764-local-library-git-ref branch August 24, 2026 21:12
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.

2 participants