Skip to content

fix(cli): normalize Go repoUrl in dynamic snippet comparison#13272

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773087127-fix-go-snippet-normalization
Open

fix(cli): normalize Go repoUrl in dynamic snippet comparison#13272
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773087127-fix-go-snippet-normalization

Conversation

@devin-ai-integration
Copy link
Contributor

Description

Fixes Go SDK snippet uploads always failing with the warning:

Failed to upload go SDK snippets because of unknown package github.com/…

Discovered while upgrading SchematicHQ/schematic-fern-config.

Link to Devin Session: https://app.devin.ai/sessions/8c552d64dcab44d5af78c0e897d02ccf
Requested by: @willkendall01

Changes Made

  • Apply normalizeGoPackageForLookup to the generator's repoUrl in the "go" case of generateLanguageSpecificDynamicIRs, matching the normalization already applied to the snippet config side (line 952).

Root cause: Commit 0e8c3512cba (v3.47.9) added normalizeGoPackageForLookup to strip the https:// prefix from the snippet config side, but did not apply the same normalization to the generator's repoUrl. This caused the comparison at line 1018 to always fail for Go ("github.com/owner/repo" !== "https://github.com/owner/repo"), triggering the "unknown package" warning and skipping Go dynamic snippet generation.

Review Checklist

  • Swift parity: The "swift" case (line 986) also reads repoUrl directly. Verify whether Swift has the same https:// mismatch issue or if the snippet config side for Swift doesn't normalize.
  • Confirm normalizeGoPackageForLookup is the correct normalization (it is — same function used on line 952 for the other side of the comparison)

Testing

  • Manual testing not feasible without a full FDR/docs publishing environment
  • Verified by code tracing: the normalizeGoPackageForLookup function (return repository.replace(/^https:\/\//, "")) is already used on the snippet config side — this change makes the generator side consistent

Co-Authored-By: will.kendall@buildwithfern.com <wpk235@gmail.com>
@devin-ai-integration
Copy link
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 and CI monitoring

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.

1 participant