Skip to content

Commit 93a85ca

Browse files
chore(cli): pass GHE host to Fiddle for remote generation (#15790)
* fix(cli): pass GHE host to Fiddle for remote generation * chore: bump @fern-fern/fiddle-sdk to 1.0.3 with proper host field types
1 parent 77cdffa commit 93a85ca

4 files changed

Lines changed: 55 additions & 47 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- summary: |
2+
Pass GitHub Enterprise host to Fiddle for remote generation so that
3+
self-hosted GHE instances are correctly targeted by the remote pipeline.
4+
type: fix

packages/cli/configuration-loader/src/generators-yml/convertGeneratorsConfiguration.ts

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ async function convertOutputMode({
815815
const downloadSnippets = generator.snippets != null && generator.snippets.path !== "";
816816
if (generator.github) {
817817
const repoString = isGithubSelfhosted(generator.github) ? generator.github.uri : generator.github.repository;
818-
const { owner, repo } = parseRepository(repoString);
818+
const { owner, repo, remote } = parseRepository(repoString);
819+
const host = remote !== "github.com" ? remote : undefined;
819820
const publishInfo =
820821
generator.output != null
821822
? getGithubPublishInfo(generator.output, maybeGroupLevelMetadata, maybeTopLevelMetadata)
@@ -833,15 +834,17 @@ async function convertOutputMode({
833834
case "commit":
834835
case "release": {
835836
const releaseConfig = generator.github as generatorsYml.GithubCommitAndReleaseSchema;
837+
const commitAndReleaseValue = {
838+
owner,
839+
repo,
840+
host,
841+
branch: releaseConfig.branch,
842+
license,
843+
publishInfo,
844+
downloadSnippets
845+
};
836846
return FernFiddle.OutputMode.githubV2(
837-
FernFiddle.GithubOutputModeV2.commitAndRelease({
838-
owner,
839-
repo,
840-
branch: releaseConfig.branch,
841-
license,
842-
publishInfo,
843-
downloadSnippets
844-
})
847+
FernFiddle.GithubOutputModeV2.commitAndRelease(commitAndReleaseValue)
845848
);
846849
}
847850
case "pull-request": {
@@ -851,29 +854,30 @@ async function convertOutputMode({
851854
groupLevelReviewers: maybeGroupLevelReviewers,
852855
outputModeReviewers: pullRequestConfig.reviewers
853856
});
854-
return FernFiddle.OutputMode.githubV2(
855-
FernFiddle.GithubOutputModeV2.pullRequest({
856-
owner,
857-
repo,
858-
license,
859-
publishInfo,
860-
downloadSnippets,
861-
reviewers,
862-
branch: pullRequestConfig.branch
863-
})
864-
);
857+
const pullRequestValue = {
858+
owner,
859+
repo,
860+
host,
861+
license,
862+
publishInfo,
863+
downloadSnippets,
864+
reviewers,
865+
branch: pullRequestConfig.branch
866+
};
867+
return FernFiddle.OutputMode.githubV2(FernFiddle.GithubOutputModeV2.pullRequest(pullRequestValue));
868+
}
869+
case "push": {
870+
const pushValue = {
871+
owner,
872+
repo,
873+
host,
874+
branch: generator.github.mode === "push" ? generator.github.branch : undefined,
875+
license,
876+
publishInfo,
877+
downloadSnippets
878+
};
879+
return FernFiddle.OutputMode.githubV2(FernFiddle.GithubOutputModeV2.push(pushValue));
865880
}
866-
case "push":
867-
return FernFiddle.OutputMode.githubV2(
868-
FernFiddle.GithubOutputModeV2.push({
869-
owner,
870-
repo,
871-
branch: generator.github.mode === "push" ? generator.github.branch : undefined,
872-
license,
873-
publishInfo,
874-
downloadSnippets
875-
})
876-
);
877881
default:
878882
assertNever(mode);
879883
}

pnpm-lock.yaml

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ catalog:
6565
"@fern-api/venus-api-sdk": 0.22.34
6666
"@fern-fern/docs-config": 0.0.80
6767
"@fern-fern/fdr-test-sdk": ^0.0.5297
68-
"@fern-fern/fiddle-sdk": 1.0.2
68+
"@fern-fern/fiddle-sdk": 1.0.3
6969
"@fern-fern/generator-exec-sdk": ^0.0.1167
7070
"@fern-fern/generators-sdk": 0.114.0-5745f9e74
7171
"@fern-fern/ir-v53-sdk": 1.0.1

0 commit comments

Comments
 (0)