Skip to content

chore(cli): cover placeholder filtering in local autoversioning - #17326

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1785869680-local-autoversion-placeholder-test
Open

chore(cli): cover placeholder filtering in local autoversioning#17326
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1785869680-local-autoversion-placeholder-test

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #17320, which stopped fern generate --local from treating 0.0.0-fern-placeholder as a real previous version. That PR shipped the LocalTaskHandler guard without a permanent test (it was only verified with a throwaway probe); this adds the regression coverage.

Changes Made

  • New describe block in LocalTaskHandler.fallback.test.ts asserting the usableVersion guard: a placeholder from the diff falls through to .fern/metadata.json (1.5.01.5.1), an already-mutated 0.0.0-fern-placeholder.0 also falls through (2.0.02.1.0), and a placeholder in every source lands on the initial 0.0.1 instead of 0.0.0-fern-placeholder.0.
  • Test-only change; no production code touched, so no changelog entry.

Testing

  • Unit tests added/updated
  • Manual testing completed

pnpm vitest run --dir .../local-workspace-runner/src/__test__ → 17 files, 183 passed. Temporarily neutering the isPlaceholderVersion(...) check in LocalTaskHandler.usableVersion makes exactly the 3 new tests fail, confirming they pin the guard rather than passing incidentally. pnpm check clean.

Link to Devin session: https://app.devin.ai/sessions/0dfb28eb8c1447df9207a0b676a81931
Requested by: @fern-support


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 Author

🤖 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

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Review Summary

Test-only PR adding regression coverage for placeholder-version filtering in LocalTaskHandler.usableVersion. The three cases are well-targeted and the failure-injection verification described is convincing. Only minor cleanliness nits: unused helper flexibility and a dead branch in the mock helper.

  • 🔵 2 suggestion(s)

Comment on lines +820 to +830
function metadataReturns(version: string | undefined) {
mockLoggingExeca.mockImplementation((_logger: unknown, cmd: string, args: string[]) => {
if (cmd === "git" && args[0] === "show" && args[1] === "HEAD:.fern/metadata.json") {
return Promise.resolve({
stdout: version == null ? "" : JSON.stringify({ sdkVersion: version }),
exitCode: version == null ? 128 : 0
});
}
return Promise.resolve({ stdout: "", exitCode: 0 });
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestion

The version == null branch (empty stdout + exitCode 128) is never exercised by any of the three tests, and it's also a slightly dubious simulation — loggingExeca typically rejects on non-zero exit unless reject: false is passed, so a future test relying on this would test a shape that never occurs. Consider dropping the undefined case until something needs it, narrowing the param to string.

mockLoggingExeca.mockResolvedValue({ stdout: "", exitCode: 0 });
});

async function createTaskHandler(overrides: Record<string, unknown> = {}) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestion

overrides is never used by any caller. Either drop the parameter or hoist/reuse the equivalent helper that the earlier describe blocks in this file already use, rather than defining a fourth near-identical factory.

@devin-ai-integration devin-ai-integration Bot changed the title test(cli): cover placeholder filtering in local autoversioning chore(cli): cover placeholder filtering in local autoversioning Aug 4, 2026

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-05T05:01:21Z).

Fixture main PR Delta
docs 252.7s (n=5) 264.8s (35 versions) +12.1s (+4.8%)

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-05T05:01:21Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-05 14:39 UTC

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-05T05:01:21Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 98s (n=5) N/A 63s -35s (-35.7%)
go-sdk square 151s (n=5) 298s (n=5) 133s -18s (-11.9%)
java-sdk square 208s (n=5) 272s (n=5) 199s -9s (-4.3%)
php-sdk square 64s (n=5) N/A 56s -8s (-12.5%)
python-sdk square 150s (n=5) 250s (n=5) 142s -8s (-5.3%)
ruby-sdk-v2 square 110s (n=5) 146s (n=5) 84s -26s (-23.6%)
rust-sdk square 221s (n=5) 225s (n=5) 161s -60s (-27.1%)
swift-sdk square 80s (n=5) 448s (n=5) 56s -24s (-30.0%)
ts-sdk square 133s (n=5) 134s (n=5) 120s -13s (-9.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-05T05:01:21Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-05 14:40 UTC

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

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

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.

1 participant