From f41d1b3a193764ba930161f17ebf61a0856d61a0 Mon Sep 17 00:00:00 2001 From: Avikalp Kumar Gupta Date: Mon, 30 Oct 2023 15:51:55 +0530 Subject: [PATCH] logs --- vibi-dpu/src/bitbucket/prs.rs | 3 ++- vibi-dpu/src/db/prs.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vibi-dpu/src/bitbucket/prs.rs b/vibi-dpu/src/bitbucket/prs.rs index 181998bf..a660f67e 100644 --- a/vibi-dpu/src/bitbucket/prs.rs +++ b/vibi-dpu/src/bitbucket/prs.rs @@ -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); } diff --git a/vibi-dpu/src/db/prs.rs b/vibi-dpu/src/db/prs.rs index 788c95d1..627bd2b7 100644 --- a/vibi-dpu/src/db/prs.rs +++ b/vibi-dpu/src/db/prs.rs @@ -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); @@ -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 }