Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ceres/src/api_service/mono_api_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ impl MonoApiService {
})
.collect();

storage.batch_save_model(save_trees)
.await
.unwrap();
storage.batch_save_model(save_trees).await.unwrap();
Ok(p_commit_id)
}

Expand Down
2 changes: 1 addition & 1 deletion ceres/src/model/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pub mod git;
pub mod mr;
pub mod mr;
4 changes: 1 addition & 3 deletions ceres/src/pack/import_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,7 @@ impl ImportRepo {
})
.collect();

storage.batch_save_model( save_trees)
.await
.unwrap();
storage.batch_save_model(save_trees).await.unwrap();

root_ref.ref_commit_hash = new_commit.id.to_string();
root_ref.ref_tree_hash = new_commit.tree_id.to_string();
Expand Down
15 changes: 6 additions & 9 deletions context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ pub struct AppContext {
impl AppContext {
/// Creates a new application context with the given configuration.
pub async fn new(config: common::config::Config) -> Self {

let config = Arc::new(config);

let storage = jupiter::storage::Storage::new(config.clone()).await;

let storage_for_vault = storage.clone();
let vault = tokio::task::spawn_blocking(move || {
vault::integration::vault_core::VaultCore::new(storage_for_vault)
}).await.expect("VaultCore::new panicked");


})
.await
.expect("VaultCore::new panicked");

#[cfg(feature = "p2p")]
let client = gemini::p2p::client::P2PClient::new(storage.clone(), vault.clone());

Expand All @@ -49,12 +49,9 @@ impl AppContext {
#[cfg(feature = "p2p")]
client,
}


}

pub fn wrapped_context(&self) -> Arc<Self> {
Arc::new(self.clone())
}
}

4 changes: 2 additions & 2 deletions extensions/rag/chat/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use chat::command::{Cli, Commands};
use chat::generation::GenerationNode;
use chat::search::SearchNode;
use chat::{GENERATION_NODE, SEARCH_NODE, vect_url, qdrant_url, llm_url};
use chat::{llm_url, qdrant_url, vect_url, GENERATION_NODE, SEARCH_NODE};
use clap::Parser;
use dagrs::utils::env::EnvVar;
use dagrs::{DefaultNode, Graph, Node, NodeTable};
Expand All @@ -10,7 +10,7 @@ use std::env;
use std::thread;

fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize logger
// Initialize logger
env::set_var("RUST_LOG", "info");
env_logger::init();

Expand Down
1 change: 0 additions & 1 deletion extensions/rag/index/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub fn llm_url() -> String {
env::var("LLM_URL").unwrap_or_else(|_| "http://ollama:11434/api/chat".to_string())
}


pub fn consumer_group() -> String {
std::env::var("CONSUMER_GROUP").unwrap_or_else(|_| "test-group".to_string())
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/rag/index/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use index::indexer::WalkDirAction;
use index::qdrant::QdrantNode;
use index::vectorization::VectClient;
use index::{broker, consumer_group, crates_path, topic};
use index::{PROCESS_ITEMS_NODE, QDRANT_NODE, VECT_CLIENT_NODE, qdrant_url, vect_url};
use index::{qdrant_url, vect_url, PROCESS_ITEMS_NODE, QDRANT_NODE, VECT_CLIENT_NODE};
use observatory::facilities::Telescope;
use observatory::model::crates::CrateMessage;
use std::env;
Expand Down Expand Up @@ -41,7 +41,7 @@ fn main() {
let rt = Runtime::new().unwrap();
rt.block_on(async {
let telescope = Telescope::new(&broker(), &consumer_group(), &topic());

// 1. Clone the Arc *before* the loop's closure.
// This clone is moved into the closure, allowing the original to remain.
let id_counter_for_loop = Arc::clone(&shared_id_counter);
Expand Down
4 changes: 1 addition & 3 deletions gemini/src/lfs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ pub async fn share_lfs(
/// This method will send a GET request to the relay to get lfs chunks info
///
pub async fn get_lfs_chunks_info(bootstrap_node: String, file_hash: String) -> Option<LFSInfoRes> {
let url = format!(
"{bootstrap_node}/api/v1/lfs_chunk?file_hash={file_hash}"
);
let url = format!("{bootstrap_node}/api/v1/lfs_chunk?file_hash={file_hash}");
let lfs_info: LFSInfoRes = match get(url.clone()).await {
Ok(response) => {
if !response.status().is_success() {
Expand Down
3 changes: 1 addition & 2 deletions jupiter/callisto/src/entity_ext/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use sea_orm::entity::prelude::*;

use crate::label::Entity;


#[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ItemLabels,
Expand All @@ -14,4 +13,4 @@ impl RelationTrait for Relation {
Self::ItemLabels => Entity::has_many(crate::item_labels::Entity).into(),
}
}
}
}
2 changes: 1 addition & 1 deletion jupiter/callisto/src/entity_ext/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod item_assignees;
pub mod item_labels;
pub mod label;
pub mod mega_conversation;
pub mod mega_issue;
pub mod mega_mr;
pub mod mega_conversation;
2 changes: 1 addition & 1 deletion jupiter/callisto/src/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.12

pub mod prelude;
pub mod entity_ext;
pub mod prelude;

pub mod access_token;
pub mod builds;
Expand Down
4 changes: 2 additions & 2 deletions jupiter/src/storage/git_db_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::sync::Arc;
use futures::{stream, Stream, StreamExt};
use sea_orm::sea_query::Expr;
use sea_orm::{
ActiveModelTrait, ColumnTrait, DbBackend, DbErr, EntityTrait,
IntoActiveModel, QueryFilter, QueryTrait, Set,
ActiveModelTrait, ColumnTrait, DbBackend, DbErr, EntityTrait, IntoActiveModel, QueryFilter,
QueryTrait, Set,
};
use sea_orm::{PaginatorTrait, QueryOrder};
use tokio::sync::Mutex;
Expand Down
5 changes: 2 additions & 3 deletions jupiter/src/storage/issue_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::collections::HashMap;
use std::ops::Deref;

use sea_orm::{
ActiveModelTrait, ColumnTrait, Condition, EntityTrait, IntoActiveModel,
JoinType, PaginatorTrait, QueryFilter, QuerySelect, RelationTrait, Set, TransactionTrait,
ActiveModelTrait, ColumnTrait, Condition, EntityTrait, IntoActiveModel, JoinType,
PaginatorTrait, QueryFilter, QuerySelect, RelationTrait, Set, TransactionTrait,
};

use callisto::sea_orm_active_enums::ConvTypeEnum;
Expand All @@ -30,7 +30,6 @@ impl Deref for IssueStorage {
}

impl IssueStorage {

pub async fn get_issue_list(
&self,
params: ListParams,
Expand Down
5 changes: 2 additions & 3 deletions jupiter/src/storage/mono_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::sync::{Arc, Mutex};

use futures::{stream, StreamExt};
use sea_orm::{
ActiveModelTrait, ColumnTrait, EntityTrait, IntoActiveModel, QueryFilter,
QueryOrder, QuerySelect,
ActiveModelTrait, ColumnTrait, EntityTrait, IntoActiveModel, QueryFilter, QueryOrder,
QuerySelect,
};

use callisto::{mega_blob, mega_commit, mega_refs, mega_tag, mega_tree, raw_blob};
Expand Down Expand Up @@ -39,7 +39,6 @@ struct GitObjects {
}

impl MonoStorage {

pub async fn save_ref(
&self,
path: &str,
Expand Down
5 changes: 2 additions & 3 deletions jupiter/src/storage/mr_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::ops::Deref;

use common::model::Pagination;
use sea_orm::{
ActiveModelTrait, ColumnTrait, Condition, EntityTrait, IntoActiveModel,
JoinType, PaginatorTrait, QueryFilter, QuerySelect, RelationTrait, Set,
ActiveModelTrait, ColumnTrait, Condition, EntityTrait, IntoActiveModel, JoinType,
PaginatorTrait, QueryFilter, QuerySelect, RelationTrait, Set,
};

use callisto::sea_orm_active_enums::MergeStatusEnum;
Expand All @@ -30,7 +30,6 @@ impl Deref for MrStorage {
}

impl MrStorage {

pub async fn get_open_mr_by_path(
&self,
path: &str,
Expand Down
8 changes: 2 additions & 6 deletions libra/src/command/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ pub async fn set_upstream(branch: &str, upstream: &str) {
)
.await;
}
println!(
"Branch '{branch}' set up to track remote branch '{upstream}'"
);
println!("Branch '{branch}' set up to track remote branch '{upstream}'");
}

pub async fn create_branch(new_branch: String, branch_or_commit: Option<String>) {
Expand Down Expand Up @@ -131,9 +129,7 @@ async fn delete_branch(branch_name: String) {

if let Head::Branch(name) = head {
if name == branch_name {
panic!(
"fatal: Cannot delete the branch '{branch_name}' which you are currently on"
);
panic!("fatal: Cannot delete the branch '{branch_name}' which you are currently on");
}
}

Expand Down
4 changes: 1 addition & 3 deletions libra/src/command/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ pub async fn execute(args: DiffArgs) {
Some(ref path) => {
let file = std::fs::File::create(path)
.map_err(|e| {
eprintln!(
"fatal: could not open to file '{path}' for writing: {e}"
);
eprintln!("fatal: could not open to file '{path}' for writing: {e}");
})
.unwrap();
Some(file)
Expand Down
4 changes: 1 addition & 3 deletions libra/src/command/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ pub async fn execute(args: FetchArgs) {
Some(remote_config) => fetch_repository(&remote_config, args.refspec).await,
None => {
tracing::error!("remote config '{}' not found", remote);
eprintln!(
"fatal: '{remote}' does not appear to be a libra repository"
);
eprintln!("fatal: '{remote}' does not appear to be a libra repository");
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions libra/src/command/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ pub async fn execute(args: LogArgs) {
if let Head::Branch(branch_name) = head.to_owned() {
let branch = Branch::find_branch(&branch_name, None).await;
if branch.is_none() {
panic!(
"fatal: your current branch '{branch_name}' does not have any commits yet "
);
panic!("fatal: your current branch '{branch_name}' does not have any commits yet ");
}
}

Expand Down
8 changes: 2 additions & 6 deletions libra/src/command/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ pub async fn execute(args: PushArgs) {
.commit
.to_string();

println!(
"pushing {branch}({commit_hash}) to {repository}({repo_url})"
);
println!("pushing {branch}({commit_hash}) to {repository}({repo_url})");

let url = Url::parse(&repo_url).unwrap();
let client = HttpsClient::from_url(&url);
Expand Down Expand Up @@ -106,9 +104,7 @@ pub async fn execute(args: PushArgs) {
let mut data = BytesMut::new();
add_pkt_line_string(
&mut data,
format!(
"{remote_hash} {commit_hash} {tracked_branch}\0report-status\n"
),
format!("{remote_hash} {commit_hash} {tracked_branch}\0report-status\n"),
);
data.extend_from_slice(b"0000");
tracing::debug!("{:?}", data);
Expand Down
4 changes: 1 addition & 3 deletions libra/src/command/switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ async fn switch_to_branch(branch_name: String) {
let target_branch = Branch::find_branch(&branch_name, None).await;
if target_branch.is_none() {
if !Branch::search_branch(&branch_name).await.is_empty() {
eprintln!(
"fatal: a branch is expected, got remote branch {branch_name}"
);
eprintln!("fatal: a branch is expected, got remote branch {branch_name}");
} else {
eprintln!("fatal: branch '{}' not found", &branch_name);
}
Expand Down
4 changes: 1 addition & 3 deletions libra/src/utils/lfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ pub fn generate_pointer_file(path: impl AsRef<Path>) -> (String, String) {
}

pub fn format_pointer_string(oid: &str, size: u64) -> String {
format!(
"version {LFS_VERSION}\noid {LFS_HASH_ALGO}:{oid}\nsize {size}\n"
)
format!("version {LFS_VERSION}\noid {LFS_HASH_ALGO}:{oid}\nsize {size}\n")
}

/// Generate LFS Server Url from repo Url.
Expand Down
4 changes: 1 addition & 3 deletions libra/tests/command/log_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ async fn test_execute_log() {
if let Head::Branch(branch_name) = head.to_owned() {
let branch = Branch::find_branch(&branch_name, None).await;
if branch.is_none() {
panic!(
"fatal: your current branch '{branch_name}' does not have any commits yet "
);
panic!("fatal: your current branch '{branch_name}' does not have any commits yet ");
}
}

Expand Down
6 changes: 1 addition & 5 deletions mercury/src/internal/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ pub trait ObjectTrait: Send + Sync + Display {
read.read_to_end(&mut content).unwrap();
let h = read.hash.clone();
let hash_str = h.finalize();
Self::from_bytes(
&content,
SHA1::from_str(&format!("{hash_str:x}")).unwrap(),
)
.unwrap()
Self::from_bytes(&content, SHA1::from_str(&format!("{hash_str:x}")).unwrap()).unwrap()
}

/// Returns the type of the object.
Expand Down
2 changes: 1 addition & 1 deletion mono/src/api/oauth/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl From<user::Model> for LoginUser {
email: value.email,
created_at: value.created_at,
campsite_user_id: String::new(),
username: String::new()
username: String::new(),
}
}
}
Loading
Loading