-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diff Graph implementation #187
Changes from all commits
4d2b184
68b967b
368d610
101e01e
9442eb5
bbc74a8
3b62d4c
d308fbc
662fe9c
46475dd
ec75135
4f4e26d
683710d
36529f3
c9fe29e
e6f3ad9
8bb7eb2
7cb5769
0db988d
bead6d2
a4a7e1e
c7bba0a
6960788
3c9ce00
0799afe
3bc8c64
c47e532
0eeff01
cfe569f
de19077
9fe33f9
ac70d68
06d34e4
40f427e
3413a48
6dba807
5094866
2d41069
67672f1
99bc426
691fb56
eb00357
d67a36a
81a289c
0ba7fc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "vibi-dpu" | ||
version = "1.0.0" | ||
version = "2.0.0" | ||
edition = "2021" | ||
authors = ["Tapish Rathore <tapish@vibinex.com>"] | ||
license = "GPL-3.0-or-later" | ||
|
@@ -21,7 +21,7 @@ serde = { version = "1.0", features = ["derive"] } | |
serde_json = "1.0" | ||
base64ct = "1.5.3" | ||
sha256 = "1.1.1" | ||
reqwest = { version = "0.11", features = ["json", "blocking"] } | ||
reqwest = { version = "0.11", features = ["json", "blocking", "stream"] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The "stream" feature added to reqwest is not utilized in the codebase. Consider removing this feature to maintain minimal and efficient dependencies. 🔗 Analysis chainVerify usage of the new reqwest "stream" feature. The addition of the "stream" feature to the reqwest dependency is a good improvement that can enable more efficient handling of large HTTP responses. To ensure this new feature is being utilized, please run the following script to check for its usage in the codebase: If the feature is not currently used, consider removing it to keep the dependencies minimal, or add a TODO comment to implement streaming in the future. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for usage of reqwest streaming functionality
# Test: Search for common streaming methods from reqwest
rg --type rust 'reqwest::.*Client.*stream' || echo "No direct usage of reqwest streaming found."
Length of output: 141 |
||
google-cloud-pubsub = "0.15.0" | ||
google-cloud-default = { version = "0.3.0", features = ["pubsub"] } | ||
google-cloud-googleapis = "0.9.0" | ||
|
@@ -37,5 +37,5 @@ once_cell = "1.18.0" # MIT | |
jsonwebtoken = "8.3.0" # MIT | ||
fern = "0.6.2" # MIT | ||
log = "0.4.20" # MIT/Apache2 | ||
|
||
walkdir = "2.5.0" # Unlicence/MIT | ||
# todo - check all lib licences |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,46 @@ | ||||||
use crate::graph::mermaid_elements::generate_mermaid_flowchart; | ||||||
use crate::utils::user::ProviderEnum; | ||||||
use crate::utils::review::Review; | ||||||
use crate::core::github; | ||||||
use crate::utils::gitops::StatItem; | ||||||
|
||||||
pub async fn send_diff_graph(review: &Review, excluded_files: &Vec<StatItem>, small_files: &Vec<StatItem>, access_token: &str) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use slices In Rust, it's more idiomatic to accept slices ( Apply this diff to update the function signatures: -pub async fn send_diff_graph(review: &Review, excluded_files: &Vec<StatItem>, small_files: &Vec<StatItem>, access_token: &str) {
+pub async fn send_diff_graph(review: &Review, excluded_files: &[StatItem], small_files: &[StatItem], access_token: &str) { -async fn diff_graph_comment_text(excluded_files: &Vec<StatItem>, small_files: &Vec<StatItem>, review: &Review) -> String {
+async fn diff_graph_comment_text(excluded_files: &[StatItem], small_files: &[StatItem], review: &Review) -> String { -async fn mermaid_comment(diff_files: &Vec<StatItem>, review: &Review) -> Option<String> {
+async fn mermaid_comment(diff_files: &[StatItem], review: &Review) -> Option<String> { Also applies to: 18-18, 33-33 |
||||||
let comment = diff_graph_comment_text(excluded_files, small_files, review).await; | ||||||
// add comment for GitHub | ||||||
if review.provider().to_string() == ProviderEnum::Github.to_string() { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplify enum comparison by matching enum variants directly Instead of converting enums to strings for comparison, you can compare enums directly. This makes the code more idiomatic and efficient. Apply this diff to simplify the comparison: -if review.provider().to_string() == ProviderEnum::Github.to_string() {
+if review.provider() == &ProviderEnum::Github { 📝 Committable suggestion
Suggested change
|
||||||
log::info!("Inserting comment on repo {}...", review.repo_name()); | ||||||
github::comment::add_comment(&comment, review, &access_token).await; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid passing unnecessary references to Since Apply this diff to correct the function call: - github::comment::add_comment(&comment, review, &access_token).await;
+ github::comment::add_comment(&comment, review, access_token).await; 📝 Committable suggestion
Suggested change
|
||||||
} | ||||||
|
||||||
// TODO: add comment for Bitbucket | ||||||
} | ||||||
|
||||||
async fn diff_graph_comment_text(excluded_files: &Vec<StatItem>, small_files: &Vec<StatItem>, review: &Review) -> String { | ||||||
let mut comment = "Diff Graph:\n\n".to_string(); | ||||||
|
||||||
let all_diff_files: Vec<StatItem> = excluded_files | ||||||
.iter() | ||||||
.chain(small_files.iter()) | ||||||
.cloned() // Clone the StatItem instances since `iter` returns references | ||||||
.collect(); // Collect into a new vector | ||||||
if let Some(mermaid_text) = mermaid_comment(&all_diff_files, review).await { | ||||||
comment += mermaid_text.as_str(); | ||||||
} | ||||||
comment += "\nTo modify DiffGraph settings, go to [your Vibinex settings page.](https://vibinex.com/settings)\n"; | ||||||
return comment; | ||||||
} | ||||||
|
||||||
async fn mermaid_comment(diff_files: &Vec<StatItem>, review: &Review) -> Option<String> { | ||||||
let flowchart_str_opt = generate_mermaid_flowchart(diff_files, review).await; | ||||||
if flowchart_str_opt.is_none() { | ||||||
log::error!("[mermaid_comment] Unable to generate flowchart for review: {}", review.id()); | ||||||
return None; | ||||||
} | ||||||
let flowchart_str = flowchart_str_opt.expect("Empty flowchart_str_opt"); | ||||||
Comment on lines
+33
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Simplify You can streamline the handling of Apply this diff to refactor the function: async fn mermaid_comment(diff_files: &[StatItem], review: &Review) -> Option<String> {
- let flowchart_str_opt = generate_mermaid_flowchart(diff_files, review).await;
- if flowchart_str_opt.is_none() {
+ if let Some(flowchart_str) = generate_mermaid_flowchart(diff_files, review).await {
+ let mermaid_comment = format!(
+ "### Call Stack Diff\n```mermaid\n{}\n```",
+ flowchart_str,
+ );
+ Some(mermaid_comment)
+ } else {
log::error!("[mermaid_comment] Unable to generate flowchart for review: {}", review.id());
- return None;
- }
- let flowchart_str = flowchart_str_opt.expect("Empty flowchart_str_opt");
- let mermaid_comment = format!(
- "### Call Stack Diff\n```mermaid\n{}\n```",
- flowchart_str,
- );
- return Some(mermaid_comment);
+ None
+ }
} |
||||||
let mermaid_comment = format!( | ||||||
"### Call Stack Diff\n```mermaid\n{}\n```", | ||||||
flowchart_str, | ||||||
); | ||||||
return Some(mermaid_comment); | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,10 +1,10 @@ | ||||||||||
use std::collections::{HashMap, HashSet}; | ||||||||||
|
||||||||||
use crate::{bitbucket::{self, user::author_from_commit}, core::github, db::review::save_review_to_db, utils::{aliases::get_login_handles, relevance::Relevance, hunk::{HunkMap, PrHunkItem}, user::ProviderEnum}}; | ||||||||||
use crate::{bitbucket::{self, user::author_from_commit}, core::github, db::review::save_review_to_db, utils::{aliases::get_login_handles, gitops::StatItem, hunk::{HunkMap, PrHunkItem}, relevance::Relevance, user::ProviderEnum}}; | ||||||||||
use crate::utils::review::Review; | ||||||||||
use crate::utils::repo_config::RepoConfig; | ||||||||||
|
||||||||||
pub async fn process_relevance(hunkmap: &HunkMap, review: &Review, | ||||||||||
pub async fn process_relevance(hunkmap: &HunkMap, excluded_files: &Vec<StatItem>, review: &Review, | ||||||||||
repo_config: &mut RepoConfig, access_token: &str, old_review_opt: &Option<Review>, | ||||||||||
) { | ||||||||||
log::info!("Processing relevance of code authors..."); | ||||||||||
|
@@ -22,7 +22,7 @@ pub async fn process_relevance(hunkmap: &HunkMap, review: &Review, | |||||||||
let relevance_vec = relevance_vec_opt.expect("Empty coverage_obj_opt"); | ||||||||||
if repo_config.comment() { | ||||||||||
// create comment text | ||||||||||
let comment = comment_text(&relevance_vec, repo_config.auto_assign()); | ||||||||||
let comment = relevant_reviewers_comment_text(&relevance_vec, repo_config.auto_assign(), excluded_files).await; | ||||||||||
// add comment | ||||||||||
if review.provider().to_string() == ProviderEnum::Bitbucket.to_string() { | ||||||||||
// TODO - add feature flag check | ||||||||||
|
@@ -184,7 +184,8 @@ async fn calculate_relevance(prhunk: &PrHunkItem, review: &mut Review) -> Option | |||||||||
return Some(relevance_vec); | ||||||||||
} | ||||||||||
|
||||||||||
fn comment_text(relevance_vec: &Vec<Relevance>, auto_assign: bool) -> String { | ||||||||||
async fn relevant_reviewers_comment_text(relevance_vec: &Vec<Relevance>, auto_assign: bool, | ||||||||||
excluded_files: &Vec<StatItem>) -> String { | ||||||||||
Comment on lines
+187
to
+188
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove unnecessary The function Apply this diff to update the function signature: -async fn relevant_reviewers_comment_text(relevance_vec: &Vec<Relevance>, auto_assign: bool,
- excluded_files: &Vec<StatItem>) -> String {
+fn relevant_reviewers_comment_text(relevance_vec: &[Relevance], auto_assign: bool,
+ excluded_files: &[StatItem]) -> String { Remember to update any calls to this function and adjust the parameter usages within the function body accordingly. 📝 Committable suggestion
Suggested change
|
||||||||||
let mut comment = "Relevant users for this PR:\n\n".to_string(); // Added two newlines | ||||||||||
comment += "| Contributor Name/Alias | Relevance |\n"; // Added a newline at the end | ||||||||||
comment += "| -------------- | --------------- |\n"; // Added a newline at the end | ||||||||||
|
@@ -208,6 +209,14 @@ fn comment_text(relevance_vec: &Vec<Relevance>, auto_assign: bool) -> String { | |||||||||
comment += &format!("Missing profile handles for {} aliases. [Go to your Vibinex settings page](https://vibinex.com/settings) to map aliases to profile handles.", unmapped_aliases.len()); | ||||||||||
} | ||||||||||
|
||||||||||
if !excluded_files.is_empty() { | ||||||||||
comment += "\n\n"; | ||||||||||
comment += "Ignoring following files due to large size: "; | ||||||||||
for file_item in excluded_files { | ||||||||||
comment += &format!("- {}\n", file_item.filepath.as_str()); | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
if auto_assign { | ||||||||||
comment += "\n\n"; | ||||||||||
comment += "Auto assigning to relevant reviewers."; | ||||||||||
|
@@ -216,7 +225,6 @@ fn comment_text(relevance_vec: &Vec<Relevance>, auto_assign: bool) -> String { | |||||||||
comment += "If you are a relevant reviewer, you can use the [Vibinex browser extension](https://chromewebstore.google.com/detail/vibinex-code-review/jafgelpkkkopeaefadkdjcmnicgpcncc) to see parts of the PR relevant to you\n"; // Added a newline at the end | ||||||||||
comment += "Relevance of the reviewer is calculated based on the git blame information of the PR. To know more, hit us up at contact@vibinex.com.\n\n"; // Added two newlines | ||||||||||
comment += "To change comment and auto-assign settings, go to [your Vibinex settings page.](https://vibinex.com/u)\n"; // Added a newline at the end | ||||||||||
|
||||||||||
return comment; | ||||||||||
} | ||||||||||
|
||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,17 +1,17 @@ | ||||||||||||||||||||||||||||||||||||||||||||
use std::env; | ||||||||||||||||||||||||||||||||||||||||||||
use std::{env, thread, time::Duration}; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace Using Apply this diff to fix the issue: -use std::{env, thread, time::Duration};
+use std::{env};
+use tokio::time::{sleep, Duration}; At line 129: - thread::sleep(Duration::from_secs(1));
+ sleep(Duration::from_secs(1)).await; Also applies to: 129-129 |
||||||||||||||||||||||||||||||||||||||||||||
use serde_json::Value; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
use crate::{ | ||||||||||||||||||||||||||||||||||||||||||||
core::{relevance::process_relevance, utils::get_access_token}, | ||||||||||||||||||||||||||||||||||||||||||||
core::{relevance::process_relevance, diff_graph::send_diff_graph, utils::get_access_token}, | ||||||||||||||||||||||||||||||||||||||||||||
db::{ | ||||||||||||||||||||||||||||||||||||||||||||
hunk::{get_hunk_from_db, store_hunkmap_to_db}, | ||||||||||||||||||||||||||||||||||||||||||||
repo::get_clone_url_clone_dir, | ||||||||||||||||||||||||||||||||||||||||||||
repo_config::save_repo_config_to_db, | ||||||||||||||||||||||||||||||||||||||||||||
review::{get_review_from_db, save_review_to_db}, | ||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||
utils::{ | ||||||||||||||||||||||||||||||||||||||||||||
gitops::{commit_exists, generate_blame, generate_diff, get_excluded_files, git_pull, process_diffmap}, | ||||||||||||||||||||||||||||||||||||||||||||
gitops::{commit_exists, generate_blame, generate_diff, get_excluded_files, git_pull, process_diffmap, StatItem}, | ||||||||||||||||||||||||||||||||||||||||||||
hunk::{HunkMap, PrHunkItem}, | ||||||||||||||||||||||||||||||||||||||||||||
repo_config::RepoConfig, | ||||||||||||||||||||||||||||||||||||||||||||
reqwest_client::get_client, | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -41,11 +41,24 @@ pub async fn process_review(message_data: &Vec<u8>) { | |||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
let access_token = access_token_opt.expect("Empty access_token_opt"); | ||||||||||||||||||||||||||||||||||||||||||||
commit_check(&review, &access_token).await; | ||||||||||||||||||||||||||||||||||||||||||||
let hunkmap_opt = process_review_changes(&review).await; | ||||||||||||||||||||||||||||||||||||||||||||
send_hunkmap(&hunkmap_opt, &review, &repo_config, &access_token, &old_review_opt).await; | ||||||||||||||||||||||||||||||||||||||||||||
process_review_changes(&review, &repo_config, &access_token, &old_review_opt).await; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
pub async fn send_hunkmap(hunkmap_opt: &Option<HunkMap>, review: &Review, | ||||||||||||||||||||||||||||||||||||||||||||
pub async fn process_review_changes(review: &Review, repo_config: &RepoConfig, access_token: &str, old_review_opt: &Option<Review>) { | ||||||||||||||||||||||||||||||||||||||||||||
log::info!("Processing changes in code..."); | ||||||||||||||||||||||||||||||||||||||||||||
if let Some((excluded_files, smallfiles)) = get_included_and_excluded_files(review) { | ||||||||||||||||||||||||||||||||||||||||||||
let hunkmap_opt = calculate_hunkmap(review, &smallfiles).await; | ||||||||||||||||||||||||||||||||||||||||||||
send_hunkmap(&hunkmap_opt, &excluded_files, review, repo_config, access_token, old_review_opt).await; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
if repo_config.diff_graph() { | ||||||||||||||||||||||||||||||||||||||||||||
send_diff_graph(review, &excluded_files, &smallfiles, access_token).await; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||
log::error!("Failed to get included and excluded files"); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+49
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Return early when failing to get included and excluded files In Apply this diff: } else {
log::error!("Failed to get included and excluded files");
+ return;
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
pub async fn send_hunkmap(hunkmap_opt: &Option<HunkMap>, excluded_files: &Vec<StatItem>, review: &Review, | ||||||||||||||||||||||||||||||||||||||||||||
repo_config: &RepoConfig, access_token: &str, old_review_opt: &Option<Review>) { | ||||||||||||||||||||||||||||||||||||||||||||
if hunkmap_opt.is_none() { | ||||||||||||||||||||||||||||||||||||||||||||
log::error!("[send_hunkmap] Empty hunkmap in send_hunkmap"); | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -58,7 +71,7 @@ pub async fn send_hunkmap(hunkmap_opt: &Option<HunkMap>, review: &Review, | |||||||||||||||||||||||||||||||||||||||||||
let hunkmap_async = hunkmap.clone(); | ||||||||||||||||||||||||||||||||||||||||||||
let review_async = review.clone(); | ||||||||||||||||||||||||||||||||||||||||||||
let mut repo_config_clone = repo_config.clone(); | ||||||||||||||||||||||||||||||||||||||||||||
process_relevance(&hunkmap_async, &review_async, | ||||||||||||||||||||||||||||||||||||||||||||
process_relevance(&hunkmap_async, &excluded_files, &review_async, | ||||||||||||||||||||||||||||||||||||||||||||
&mut repo_config_clone, access_token, old_review_opt).await; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
@@ -73,16 +86,20 @@ fn hunk_already_exists(review: &Review) -> bool { | |||||||||||||||||||||||||||||||||||||||||||
log::debug!("[hunk_already_exists] Hunk already in db!"); | ||||||||||||||||||||||||||||||||||||||||||||
return true; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
pub async fn process_review_changes(review: &Review) -> Option<HunkMap>{ | ||||||||||||||||||||||||||||||||||||||||||||
log::info!("Processing changes in code..."); | ||||||||||||||||||||||||||||||||||||||||||||
let mut prvec = Vec::<PrHunkItem>::new(); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
fn get_included_and_excluded_files(review: &Review) -> Option<(Vec<StatItem>, Vec<StatItem>)> { | ||||||||||||||||||||||||||||||||||||||||||||
let fileopt = get_excluded_files(&review); | ||||||||||||||||||||||||||||||||||||||||||||
log::debug!("[process_review_changes] fileopt = {:?}", &fileopt); | ||||||||||||||||||||||||||||||||||||||||||||
if fileopt.is_none() { | ||||||||||||||||||||||||||||||||||||||||||||
log::error!("[process_review_changes] No files to review for PR {}", review.id()); | ||||||||||||||||||||||||||||||||||||||||||||
return None; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
let (_, smallfiles) = fileopt.expect("fileopt is empty"); | ||||||||||||||||||||||||||||||||||||||||||||
let (excluded_files, smallfiles) = fileopt.expect("fileopt is empty"); | ||||||||||||||||||||||||||||||||||||||||||||
return Some(( excluded_files, smallfiles)); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
async fn calculate_hunkmap(review: &Review, smallfiles: &Vec<StatItem>) -> Option<HunkMap> { | ||||||||||||||||||||||||||||||||||||||||||||
let mut prvec = Vec::<PrHunkItem>::new(); | ||||||||||||||||||||||||||||||||||||||||||||
let diffmap = generate_diff(&review, &smallfiles); | ||||||||||||||||||||||||||||||||||||||||||||
log::debug!("[process_review_changes] diffmap = {:?}", &diffmap); | ||||||||||||||||||||||||||||||||||||||||||||
let linemap = process_diffmap(&diffmap); | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -109,6 +126,7 @@ pub async fn commit_check(review: &Review, access_token: &str) { | |||||||||||||||||||||||||||||||||||||||||||
if !commit_exists(&review.base_head_commit(), &review.clone_dir()) | ||||||||||||||||||||||||||||||||||||||||||||
|| !commit_exists(&review.pr_head_commit(), &review.clone_dir()) { | ||||||||||||||||||||||||||||||||||||||||||||
log::info!("Executing git pull on repo {}...", &review.repo_name()); | ||||||||||||||||||||||||||||||||||||||||||||
thread::sleep(Duration::from_secs(1)); | ||||||||||||||||||||||||||||||||||||||||||||
git_pull(review, access_token).await; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -213,7 +231,7 @@ fn create_and_save_github_review_object(deserialized_data: &Value) -> Option<Rev | |||||||||||||||||||||||||||||||||||||||||||
let repo_provider = ProviderEnum::Github.to_string().to_lowercase(); | ||||||||||||||||||||||||||||||||||||||||||||
let clone_opt = get_clone_url_clone_dir(&repo_provider, &repo_owner, &repo_name); | ||||||||||||||||||||||||||||||||||||||||||||
if clone_opt.is_none() { | ||||||||||||||||||||||||||||||||||||||||||||
log::error!("[create_and_save_github_review_object] Unable to get clone url and directory for bitbucket review"); | ||||||||||||||||||||||||||||||||||||||||||||
log::error!("[create_and_save_github_review_object] Unable to get clone url and directory for github review"); | ||||||||||||||||||||||||||||||||||||||||||||
return None; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
let (clone_url, clone_dir) = clone_opt.expect("Empty clone_opt"); | ||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Issue Detected with
prompts
DirectoryThe
prompts
directory does not exist in the repository, which will cause the Docker build to fail when attempting to copy it.🔗 Analysis chain
New step to copy 'prompts' directory: Approved
The addition of this step to copy the ./prompts directory into the container at /app/prompts suggests that the application now utilizes prompt files. This is likely related to new functionality, possibly involving AI or templating features.
To ensure the prompts directory exists and contains necessary files, let's run a verification script:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 113