Skip to content

Commit 1f1ca75

Browse files
authored
Merge pull request #2262 from apiraino/enable-using-test-zulip-server
Enable using a test git repository when sending commands from Zulip
2 parents b2321e0 + 0ae5534 commit 1f1ca75

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.env.sample

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ GITHUB_WEBHOOK_SECRET=MUST_BE_CONFIGURED
3232
# Authenticates inbound webhooks from Github
3333
# ZULIP_WEBHOOK_SECRET=xxx
3434

35+
# Which GitHub repository should be used when triagebot executes commands sent from Zulip
36+
# For testing purposes, you can use another repository
37+
# Defaults: "rust-lang" and "rust"
38+
# MAIN_GH_REPO_OWNER="rust-lang"
39+
# MAIN_GH_REPO_NAME="rust"
40+
3541
# Use another endpoint to retrieve teams of the Rust project (useful for local testing)
3642
# default: https://team-api.infra.rust-lang.org/v1
3743
# TEAMS_API_URL=http://localhost:8080

src/zulip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ async fn accept_decline_backport(
376376

377377
// Repository owner and name are hardcoded
378378
// This command is only used in this repository
379-
let repo_owner = "rust-lang";
380-
let repo_name = "rust";
379+
let repo_owner = std::env::var("MAIN_GH_REPO_OWNER").unwrap_or("rust-lang".to_string());
380+
let repo_name = std::env::var("MAIN_GH_REPO_NAME").unwrap_or("rust".to_string());
381381

382382
// TODO: factor out the Zulip "URL encoder" to make it practical to use
383383
let zulip_send_req = crate::zulip::MessageApiRequest {

0 commit comments

Comments
 (0)