Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
avikalpg committed Oct 30, 2023
1 parent c45a125 commit f41d1b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vibi-dpu/src/bitbucket/prs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ pub async fn get_pr_info(workspace_slug: &str, repo_slug: &str, access_token: &s
pub async fn get_and_store_pr_info(workspace_slug: &str,repo_slug: &str,access_token: &str, pr_number: &str) {
if let Some(pr_info) = get_pr_info(workspace_slug, repo_slug, access_token, pr_number).await {
// If PR information is available, store it in the database
update_pr_info_in_db(workspace_slug, repo_slug, &pr_info, pr_number).await;
println!("[get_and_store_pr_info|update_pr_info_in_db] workspace_slug: {}, repo_slug: {}, pr_number: {}, pr_info: {:?}", &workspace_slug, &repo_slug, &pr_number, &pr_info);
update_pr_info_in_db(workspace_slug, repo_slug, &pr_info, pr_number).await;
} else {
eprintln!("No PR info available for PR number: {:?} repository: {:?} repo_owner{:?}", pr_number, repo_slug, workspace_slug);
}
Expand Down
3 changes: 2 additions & 1 deletion vibi-dpu/src/db/prs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub async fn process_and_update_pr_if_different(webhook_data: &Value, workspace_
}
let pr_info_parsed = pr_info_parsed_opt.expect("Empty pr_info_parsed_opt");
// Retrieve the existing pr_head_commit from the database
print!("[process_and_update_pr_if_different] workspace_slug: {}, repo_slug: {}, pr_number: {}, pr_info_parsed: {:?}", &workspace_slug, &repo_slug, &pr_number, &pr_info_parsed); // todo: remove
print!("[process_and_update_pr_if_different|get_pr_info_from_db] workspace_slug: {}, repo_slug: {}, pr_number: {}, pr_info_parsed: {:?}", &workspace_slug, &repo_slug, &pr_number, &pr_info_parsed); // todo: remove
let pr_info_db_opt = get_pr_info_from_db(workspace_slug, repo_slug, pr_number, repo_provider, &pr_info_parsed).await;
if pr_info_db_opt.is_none() {
eprintln!("[process_and_update_pr_if_different] No pr_info in db, parsed: {:?}", pr_info_parsed);
Expand All @@ -48,6 +48,7 @@ pub async fn process_and_update_pr_if_different(webhook_data: &Value, workspace_
if pr_info_db.pr_head_commit().to_string().eq_ignore_ascii_case(pr_info_parsed.pr_head_commit()){
return false; // commits are the same
} else {
println!("[process_and_update_pr_if_different|update_pr_info_in_db] workspace_slug: {}, repo_slug: {}, pr_info_parsed: {:?}, pr_number: {}", &workspace_slug, &repo_slug, &pr_info_parsed, &pr_number);
update_pr_info_in_db(&workspace_slug, &repo_slug, &pr_info_parsed, &pr_number).await;
return true; // commits are different, and PR info should be updated
}
Expand Down

0 comments on commit f41d1b3

Please sign in to comment.