Skip to content

fix(go): normalize Go package name for dynamic snippet IR generation#14754

Merged
iamnamananand996 merged 1 commit intomainfrom
devin/1775666972-fix-go-dynamic-snippets-package-mismatch
Apr 8, 2026
Merged

fix(go): normalize Go package name for dynamic snippet IR generation#14754
iamnamananand996 merged 1 commit intomainfrom
devin/1775666972-fix-go-dynamic-snippets-package-mismatch

Conversation

@iamnamananand996
Copy link
Copy Markdown
Contributor

Description

Fixes Go dynamic snippets not being generated during fern docs publish, causing docs sites to fall back to raw net/http HTTP snippets instead of SDK-idiomatic Go code.

Root Cause

In generateLanguageSpecificDynamicIRs, the snippet configuration's Go package name is normalized via normalizeGoPackageForLookup() (stripping the https:// prefix), but the packageName extracted from the generator's output config (repoUrl) retains the https:// prefix. The strict equality check (===) always fails for Go, so the dynamic IR is never generated and never uploaded to FDR.

  • snippetConfiguration.gogithub.com/owner/repo (normalized)
  • packageName (from generator config) → https://github.com/owner/repo (not normalized)

Changes Made

  • Normalize the Go packageName with normalizeGoPackageForLookup() before the comparison, matching how snippetConfiguration.go is already normalized
  • Added changelog entry (v4.63.1)

Testing

  • Unit tests added/updated — no new tests; this is a runtime code path during docs publish that requires FDR integration
  • Lint passes (pnpm run check)

Review Checklist

  • Verify the root cause by tracing both sides of the comparison at line ~1234 of publishDocs.ts
  • Check whether Swift has the same bugsnippetConfiguration.swift comes from snippetsConfig.swiftSdk?.package (not normalized), while Swift's packageName also comes from repoUrl (with https://). If swiftSdk.package can be a GitHub URL, Swift would have the same mismatch.

Link to Devin session: https://app.devin.ai/sessions/97992dbbc8c7438bbdf2c381765313d1
Requested by: @iamnamananand996

@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 and CI monitoring

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

@iamnamananand996 iamnamananand996 marked this pull request as ready for review April 8, 2026 19:26
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

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.

@iamnamananand996 iamnamananand996 merged commit 265273d into main Apr 8, 2026
99 of 100 checks passed
@iamnamananand996 iamnamananand996 deleted the devin/1775666972-fix-go-dynamic-snippets-package-mismatch branch April 8, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants