Skip to content

Commit fe8ca67

Browse files
committed
Merge branch 'main' of github.com:filecoin-project/filplus-backend
2 parents 9738e0a + f2ad3d9 commit fe8ca67

File tree

5 files changed

+33
-13
lines changed

5 files changed

+33
-13
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fplus-database/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-database"
33
authors = ["clriesco", "kokal33", "alexmcon"]
4-
version = "2.2.17"
4+
version = "2.2.18"
55
edition = "2021"
66
description = "FPlus main database module"
77
license = "MIT OR Apache-2.0"

fplus-http-server/Cargo.toml

Lines changed: 3 additions & 3 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 = "2.2.17"
4+
version = "2.2.18"
55
description = "FPlus main http module"
66
license = "MIT OR Apache-2.0"
77
edition = "2021"
@@ -22,8 +22,8 @@ actix-cors = "0.6.4"
2222
reqwest = { version = "0.11.18", features = ["json"] }
2323
futures = "0.3.28"
2424
dotenv = "0.15.0"
25-
fplus-lib = { path = "../fplus-lib", version = "2.2.17" }
26-
fplus-database = { path = "../fplus-database", version = "2.2.17" }
25+
fplus-lib = { path = "../fplus-lib", version = "2.2.18" }
26+
fplus-database = { path = "../fplus-database", version = "2.2.18" }
2727
anyhow = "1.0.75"
2828
async-trait = "0.1.73"
2929
uuidv4 = "1.0.0"

fplus-lib/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-lib"
33
authors = ["jbesraa", "kokal33", "clriesco"]
4-
version = "2.2.17"
4+
version = "2.2.18"
55
edition = "2021"
66
description = "FPlus library/helper files"
77
license = "MIT OR Apache-2.0"
@@ -30,7 +30,7 @@ uuidv4 = "1.0.0"
3030
rayon = "1.8.0"
3131
log = "0.4.20"
3232
once_cell = "1.19.0"
33-
fplus-database = { path = "../fplus-database", version = "2.2.17" }
33+
fplus-database = { path = "../fplus-database", version = "2.2.18" }
3434
pem = "1.0"
3535
anyhow = "1.0"
3636
regex = "1.0"

fplus-lib/src/core/mod.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ impl LDNApplication {
16811681
let clompleted_application = app_file.reached_total_datacap();
16821682
let parsed_app_file = serde_json::to_string_pretty(&clompleted_application)
16831683
.map_err(|e| LDNError::Load(format!("Failed to pare into string: {}", e)))?;
1684-
LDNPullRequest::create_pr_for_existing_application(
1684+
let pr_number = LDNPullRequest::create_pr_for_existing_application(
16851685
clompleted_application.id.clone(),
16861686
parsed_app_file,
16871687
self.file_name.clone(),
@@ -1694,6 +1694,28 @@ impl LDNApplication {
16941694
format!("Total Datacap reached for {}", clompleted_application.id),
16951695
)
16961696
.await?;
1697+
1698+
let gh = github_async_new(self.github.owner.clone(), self.github.repo.clone()).await?;
1699+
1700+
gh.merge_pull_request(pr_number).await.map_err(|e| {
1701+
LDNError::Load(format!(
1702+
"Failed to merge pull request {}. Reason: {}",
1703+
pr_number, e
1704+
))
1705+
})?;
1706+
1707+
database::applications::merge_application_by_pr_number(
1708+
self.github.owner.clone(),
1709+
self.github.repo.clone(),
1710+
pr_number,
1711+
)
1712+
.await
1713+
.map_err(|e| {
1714+
LDNError::Load(format!(
1715+
"Failed to update application in database. Reason: {}",
1716+
e
1717+
))
1718+
})?;
16971719
Self::add_comment_to_issue(
16981720
application_model.issue_number.to_string().clone(),
16991721
application_model.owner.clone(),
@@ -1980,9 +2002,7 @@ impl LDNApplication {
19802002

19812003
Self::merge_application(pr_number, owner, repo).await?;
19822004
return Ok(true);
1983-
} else if application.lifecycle.get_state() == AppState::Declined
1984-
|| application.lifecycle.get_state() == AppState::TotalDatacapReached
1985-
{
2005+
} else if application.lifecycle.get_state() == AppState::Declined {
19862006
Self::merge_application(pr_number, owner, repo).await?;
19872007
return Ok(true);
19882008
}

0 commit comments

Comments
 (0)