Skip to content

Commit 8f23e4c

Browse files
authored
Merge pull request #109 from filecoin-project/fix/modify-bot-name
Modified bot name. Retrieve from env variable
2 parents c61a72a + e709228 commit 8f23e4c

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

fplus-http-server/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "fplus-http-server"
33
authors = ["jbesraa", "kokal33", "clriesco"]
4-
version = "1.0.16"
4+
version = "1.0.17"
55
description = "FPlus main http module"
66
license = "MIT OR Apache-2.0"
77
edition = "2021"
@@ -20,7 +20,7 @@ actix-cors = "0.6.4"
2020
reqwest = { version = "0.11.18", features = ["json"] }
2121
futures = "0.3.28"
2222
dotenv = "0.15.0"
23-
fplus-lib = { path = "../fplus-lib", version = "1.0.16" }
23+
fplus-lib = { path = "../fplus-lib", version = "1.0.17" }
2424
anyhow = "1.0.75"
2525
async-trait = "0.1.73"
2626
uuidv4 = "1.0.0"

fplus-lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "fplus-lib"
33
authors = ["jbesraa", "kokal33", "clriesco"]
4-
version = "1.0.16"
4+
version = "1.0.17"
55
edition = "2021"
66
description = "FPlus library/helper files"
77
license = "MIT OR Apache-2.0"

fplus-lib/src/core/mod.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ use crate::core::application::file::Allocation;
2727

2828
pub mod application;
2929

30-
const DEV_BOT_USER: &str = "filplus-github-bot-read-write[bot]";
31-
const PROD_BOT_USER: &str = "filplus-falcon[bot]";
32-
3330
#[derive(Deserialize)]
3431
pub struct CreateApplicationInfo {
3532
pub issue_number: String,
@@ -778,14 +775,7 @@ impl LDNApplication {
778775
log::info!("- Application is in a valid state!");
779776
return Ok(true);
780777
}
781-
782-
// Check if application is in any other state
783-
let bot_user = if get_env_var_or_default("FILPLUS_ENV", "dev") == "prod" {
784-
PROD_BOT_USER
785-
} else {
786-
DEV_BOT_USER
787-
};
788-
778+
let bot_user = get_env_var_or_default("BOT_USER", "filplus-github-bot-read-write[bot]");
789779
if author != bot_user {
790780
log::warn!("- Author is not the bot user");
791781
return Ok(false);
@@ -813,11 +803,7 @@ impl LDNApplication {
813803
let app_state = application_file.lifecycle.get_state();
814804
let active_request_id = application_file.lifecycle.active_request.clone();
815805
let valid_rkh = Self::fetch_rkh().await?;
816-
let bot_user = if get_env_var_or_default("FILPLUS_ENV", "dev") == "prod" {
817-
PROD_BOT_USER
818-
} else {
819-
DEV_BOT_USER
820-
};
806+
let bot_user = get_env_var_or_default("BOT_USER", "filplus-github-bot-read-write[bot]");
821807

822808
let res: bool = match app_state {
823809
AppState::Submitted => {

0 commit comments

Comments
 (0)