Skip to content

Commit

Permalink
chore(fern-bot): update fdr sdks and update major version slack messa…
Browse files Browse the repository at this point in the history
…ge (#1409)
  • Loading branch information
armandobelardo authored Sep 6, 2024
1 parent c58f70b commit 4debbd5
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 25 deletions.
98 changes: 79 additions & 19 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion servers/fern-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@fern-api/core-utils": "0.15.0-rc63",
"@fern-api/github": "workspace:*",
"@fern-api/venus-api-sdk": "0.8.1-1-gd6d1a5b",
"@fern-fern/generators-sdk": "0.107.0-892e7c392",
"@fern-fern/generators-sdk": "0.107.0-00fe26566",
"@octokit/openapi-types": "^22.1.0",
"@slack/web-api": "^6.9.0",
"cohere-ai": "^7.9.5",
Expand Down
15 changes: 11 additions & 4 deletions servers/fern-bot/src/__test__/basic-ete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@ it(
process.env["REPO_TO_RUN_ON"] = REPO_FULL_NAME;
await updateGeneratorVersions({});

// Pull each branch and make sure the version is not what it was (hardcoded)
await getBranch(git, CLI_TEST_BRANCH);
const upgradedCliVersion = cleanStdout((await execFernCli("--version", fullRepoPath)).stdout);
expect(upgradedCliVersion).not.toBe(cliVersion);
try {
// Pull each branch and make sure the version is not what it was (hardcoded)
await getBranch(git, CLI_TEST_BRANCH);
const upgradedCliVersion = cleanStdout((await execFernCli("--version", fullRepoPath)).stdout);
expect(upgradedCliVersion).not.toBe(cliVersion);
} catch (e) {
console.log(
"Error in CLI branch, likely because main has been updated to latest, so no upgrade branch has been made.",
);
console.log(e);
}

await getBranch(git, PYTHON_TEST_BRANCH);
const upgradedPythonVersion = cleanStdout((await execFernCli("--version", fullRepoPath)).stdout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ async function handleSingleUpgrade({
});
return;
} else if (fromVersion === toVersion) {
console.log("Versions were the same, let's see if there's a new version across major versions.");
await upgradeAction({ includeMajor: true });
const toVersion = await getEntityVersion();
if (fromVersion !== toVersion) {
Expand All @@ -319,6 +320,7 @@ async function handleSingleUpgrade({
repoName: repository.full_name,
currentVersion: fromVersion,
organization,
generator: maybeGetGeneratorMetadata ? await maybeGetGeneratorMetadata() : undefined,
});
console.log("No change made as the upgrade is across major versions.");
return;
Expand Down
4 changes: 3 additions & 1 deletion servers/fern-bot/src/libs/slack/SlackService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class SlackService {
return `:csharp: ${organization} - ${header} for \`${generatorName}\``;
} else if (generatorName.includes("go")) {
return `:gopher: ${organization} - ${header} for \`${generatorName}\``;
} else if (generatorName.includes("php")) {
return `:php: ${organization} - ${header} for \`${generatorName}\``;
}

return `:interrobang: ${header} for \`${generatorName}\``;
Expand Down Expand Up @@ -126,7 +128,7 @@ export class SlackService {
type: "section",
text: {
type: "mrkdwn",
text: `Hey <!here>, we've encountered a major version upgrade which needs manual intervention!\n\n*Organization*: ${organization}\n*Github Repo*: ${repoName}${generator && "\n" + this.getGeneratorMetadataMessage(generator)}\n*Current version*: ${currentVersion}`,
text: `Hey <!here>, we've encountered a major version upgrade which needs manual intervention!\n\n*Organization*: ${organization}\n*Github Repo*: ${repoName}${generator ? "\n" + this.getGeneratorMetadataMessage(generator) : ""}\n*Current version*: ${currentVersion}`,
},
},
{
Expand Down

0 comments on commit 4debbd5

Please sign in to comment.