Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions dist/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions dist/merge.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions dist/preview.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions src/runBuilds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,24 @@ export async function* runBuilds({
logger.debug("Guessing config before branch reset");
// If the `branch` already exists, we should guess against it, in case
// there were changes made via the studio.
if (hasBranch) {
configContent = Object.values(
await stainless.projects.configs.guess({
branch,
spec: oasContent!,
}),
)[0]?.content;
} else {
configContent = Object.values(
await stainless.projects.configs.guess({
branch: branchFrom,
spec: oasContent!,
}),
)[0]?.content;
try {
if (hasBranch) {
configContent = Object.values(
await stainless.projects.configs.guess({
branch,
spec: oasContent!,
}),
)[0]?.content;
} else {
configContent = Object.values(
await stainless.projects.configs.guess({
branch: branchFrom,
spec: oasContent!,
}),
)[0]?.content;
}
} catch (e) {
logger.warn("Error guessing config, continuing anyways", e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: { error: e } or { err: e }, because pino has special handling for errors in that case i thiiiiiink

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah wait wrong repo. nvm then

}
} else if (hasBranch && hasBaseBranch) {
logger.debug("Computing config patch before branch reset");
Expand Down