Skip to content

Commit 1360caa

Browse files
committed
modify review agent env var names
1 parent d69851c commit 1360caa

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

docs/docs/configuration/environment-variables.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ The following environment variables allow you to configure your Sourcebot deploy
6262
### Review Agent Environment Variables
6363
| Variable | Default | Description |
6464
| :------- | :------ | :---------- |
65-
| `GITHUB_APP_ID` | `-` | <p>The GitHub App ID used for review agent authentication.</p> |
66-
| `GITHUB_APP_PRIVATE_KEY_PATH` | `-` | <p>The container relative path to the private key file for the GitHub App used by the review agent.</p> |
67-
| `GITHUB_APP_WEBHOOK_SECRET` | `-` | <p>The webhook secret for the GitHub App used by the review agent.</p> |
65+
| `GITHUB_REVIEW_AGENT_APP_ID` | `-` | <p>The GitHub App ID used for review agent authentication.</p> |
66+
| `GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET` | `-` | <p>The container relative path to the private key file for the GitHub App used by the review agent.</p> |
67+
| `GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH` | `-` | <p>The webhook secret for the GitHub App used by the review agent.</p> |
6868
| `OPENAI_API_KEY` | `-` | <p>The OpenAI API key used by the review agent.</p> |
6969
| `REVIEW_AGENT_API_KEY` | `-` | <p>The Sourcebot API key used by the review agent.</p> |
7070
| `REVIEW_AGENT_AUTO_REVIEW_ENABLED` | `false` | <p>Enables/disables automatic code reviews by the review agent.</p> |

docs/docs/features/agents/review-agent.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Before you get started, make sure you have an OpenAPI account that you can creat
4444
<Step title="Configure the environment variables in Sourcebot">
4545
Sourcebot requires the following environment variables to begin reviewing PRs through your new GitHub app:
4646

47-
- `GITHUB_APP_ID`: The client ID of your GitHub app. Can be found in your [app settings](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart#navigate-to-your-app-settings)
48-
- `GITHUB_APP_WEBHOOK_SECRET`: The webhook secret you defined in your GitHub app. Can be found in your [app settings](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart#navigate-to-your-app-settings)
49-
- `GITHUB_APP_PRIVATE_KEY_PATH`: The path to your app's private key. If you're running Sourcebot from a container, this is the path to this file from within your container
47+
- `GITHUB_REVIEW_AGENT_APP_ID`: The client ID of your GitHub app. Can be found in your [app settings](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart#navigate-to-your-app-settings)
48+
- `GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET`: The webhook secret you defined in your GitHub app. Can be found in your [app settings](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart#navigate-to-your-app-settings)
49+
- `GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH`: The path to your app's private key. If you're running Sourcebot from a container, this is the path to this file from within your container
5050
(ex `/data/review-agent-key.pem`). You must copy the private key file into the directory you mount to Sourcebot (similar to the config file).
5151

5252
You can generate a private key file for your app in the [app settings](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart#navigate-to-your-app-settings). You must copy this private key file into the
@@ -74,9 +74,9 @@ Before you get started, make sure you have an OpenAPI account that you can creat
7474
- "/Users/michael/sourcebot_review_agent_workspace:/data"
7575
environment:
7676
CONFIG_PATH: "/data/config.json"
77-
GITHUB_APP_ID: "my-github-app-id"
78-
GITHUB_APP_WEBHOOK_SECRET: "my-github-app-webhook-secret"
79-
GITHUB_APP_PRIVATE_KEY_PATH: "/data/review-agent-key.pem"
77+
GITHUB_REVIEW_AGENT_APP_ID: "my-github-app-id"
78+
GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET: "my-github-app-webhook-secret"
79+
GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH: "/data/review-agent-key.pem"
8080
REVIEW_AGENT_API_KEY: "sourcebot-my-key"
8181
OPENAI_API_KEY: "sk-proj-my-open-api-key"
8282
```

packages/web/src/app/[domain]/agents/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const agents = [
88
id: "review-agent",
99
name: "Review Agent",
1010
description: "An AI code review agent that reviews your PRs. Uses the code indexed on Sourcebot to provide codebase-wide context.",
11-
requiredEnvVars: ["GITHUB_APP_ID", "GITHUB_APP_WEBHOOK_SECRET", "GITHUB_APP_PRIVATE_KEY_PATH", "OPENAI_API_KEY"],
11+
requiredEnvVars: ["GITHUB_REVIEW_AGENT_APP_ID", "GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET", "GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH", "OPENAI_API_KEY"],
1212
configureUrl: "https://docs.sourcebot.dev/docs/features/agents/review-agent"
1313
},
1414
];

packages/web/src/app/api/(server)/webhook/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import { createLogger } from "@sourcebot/logger";
1414
const logger = createLogger('github-webhook');
1515

1616
let githubApp: App | undefined;
17-
if (env.GITHUB_APP_ID && env.GITHUB_APP_WEBHOOK_SECRET && env.GITHUB_APP_PRIVATE_KEY_PATH) {
17+
if (env.GITHUB_REVIEW_AGENT_APP_ID && env.GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET && env.GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH) {
1818
try {
19-
const privateKey = fs.readFileSync(env.GITHUB_APP_PRIVATE_KEY_PATH, "utf8");
19+
const privateKey = fs.readFileSync(env.GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH, "utf8");
2020

2121
const throttledOctokit = Octokit.plugin(throttling);
2222
githubApp = new App({
23-
appId: env.GITHUB_APP_ID,
23+
appId: env.GITHUB_REVIEW_AGENT_APP_ID,
2424
privateKey: privateKey,
2525
webhooks: {
26-
secret: env.GITHUB_APP_WEBHOOK_SECRET,
26+
secret: env.GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET,
2727
},
2828
Octokit: throttledOctokit,
2929
throttle: {

packages/web/src/env.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ export const env = createEnv({
8585
SOURCEBOT_EE_AUDIT_LOGGING_ENABLED: booleanSchema.default('true'),
8686

8787
// GitHub app for review agent
88-
GITHUB_APP_ID: z.string().optional(),
89-
GITHUB_APP_WEBHOOK_SECRET: z.string().optional(),
90-
GITHUB_APP_PRIVATE_KEY_PATH: z.string().optional(),
88+
GITHUB_REVIEW_AGENT_APP_ID: z.string().optional(),
89+
GITHUB_REVIEW_AGENT_APP_WEBHOOK_SECRET: z.string().optional(),
90+
GITHUB_REVIEW_AGENT_APP_PRIVATE_KEY_PATH: z.string().optional(),
9191
REVIEW_AGENT_API_KEY: z.string().optional(),
9292
REVIEW_AGENT_LOGGING_ENABLED: booleanSchema.default('true'),
9393
REVIEW_AGENT_AUTO_REVIEW_ENABLED: booleanSchema.default('false'),

0 commit comments

Comments
 (0)