feat(cli): let a generator image declare that it needs the raw API specs - #17508
Draft
ATechAdventurer wants to merge 1 commit into
Draft
feat(cli): let a generator image declare that it needs the raw API specs#17508ATechAdventurer wants to merge 1 commit into
ATechAdventurer wants to merge 1 commit into
Conversation
Local generation decides whether to bundle and mount the pre-processed raw specs from GENERATORS_WANTING_SPECS, an exact-string allowlist of generator names. That cannot describe a generator image published under an existing Fern generator name in a different registry, which is how the private-registry setup documented for self-hosting works: the name is identical whether the image is Fern's or the vendor's, so only the image itself can say what it needs. Adds getImageLabels to docker-utils and reads com.postman.sdk-gen.adapter.wants-raw-specs off the resolved image alongside the existing name check. An image can therefore opt in without a CLI release. The label read is best-effort by construction. A generator with no labels, an image that cannot be pulled, or an unavailable container runtime all fall back to the previous behaviour rather than failing a generation that would otherwise succeed. Docker reports an unlabelled image as JSON null rather than an object, which is handled explicitly. Also extracts resolveGeneratorImage so the capability check and the container execution resolve the same reference, rather than duplicating the containerImage-or-name expression in two places. Generators without the label are unaffected, and the existing first-party allowlist entry keeps working unchanged.
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Local generation decides whether to bundle and mount the pre-processed raw API specs from
GENERATORS_WANTING_SPECS— an exact-string allowlist of generator names, currently one entry.That cannot describe a generator image published under an existing Fern generator name in a different registry, which is exactly how the private registry setup documented for self-hosting works:
The generator name is identical whether the image is Fern's or the org's own. Only the image can say what it needs.
What changed
getImageLabelsadded todocker-utils. The package had no image inspection at all — justrunDocker.tsandbuildContainerEnvVars.ts.com.postman.sdk-gen.adapter.wants-raw-specsis read off the resolved image, alongside the existing name check. An image can opt in without a CLI release.resolveGeneratorImageextracted so the capability check and the container execution resolve the same reference, instead of duplicating thecontainerImage-or-nameexpression in two places.Generators without the label are unaffected, and the existing first-party allowlist entry keeps working unchanged.
Best-effort by construction
This now runs on every local generation, so it must never be the reason a run fails. A generator with no labels, an image that cannot be pulled, or an unavailable container runtime all fall back to the previous behaviour.
One detail worth flagging for review: Docker reports an unlabelled image as JSON
null, not{}. I found that by building a control image and inspecting it, and the parser handles it explicitly. Verified across four shapes — labelled image, unlabelled image, malformed output, and non-string label values.The label read pulls the image if it is absent. That is not an extra pull: local generation is about to pull and run this exact image, so it is the same pull moved earlier.
Testing
biome checkclean.I was not able to run the full monorepo build locally, so CI is the real check on integration.
Context
This unblocks a self-hosted SDK generation adapter that generates from the API spec rather than the Fern IR — without the raw-spec mount it has no input at all. Related work lives outside this repo.
Draft while the consuming image is still in review on our side.