Wrapping up bedrock implementation
This commit is contained in:
@@ -2,13 +2,13 @@ use anyhow::anyhow;
|
||||
use async_channel;
|
||||
use chrono::{DateTime, Utc};
|
||||
use futures::stream::AbortHandle;
|
||||
use galaxy_core::safe_error;
|
||||
use galaxyui::{Entity, ModelContext, ModelHandle};
|
||||
use ignore::gitignore::Gitignore;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use repo_metadata::entry::IgnoredPathStrategy;
|
||||
use repo_metadata::Repository;
|
||||
use std::{path::Path, sync::Arc};
|
||||
use galaxy_core::safe_error;
|
||||
use galaxyui::{Entity, ModelContext, ModelHandle};
|
||||
|
||||
use super::{
|
||||
fragment_metadata::{FragmentMetadata, LeafToFragmentMetadata, LeafToFragmentMetadataUpdates},
|
||||
|
||||
@@ -17,13 +17,13 @@ use crate::index::full_source_code_embedding::{
|
||||
};
|
||||
use crate::index::locations::{CodeContextLocation, FileFragmentLocation};
|
||||
use futures::executor::block_on;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::{App, SingletonEntity};
|
||||
use repo_metadata::DirectoryWatcher;
|
||||
use std::collections::HashMap;
|
||||
use std::ops::Range;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use galaxyui::{App, SingletonEntity};
|
||||
|
||||
use super::{
|
||||
CodebaseIndex, CodebaseIndexTimeStampMetadata, TreeSourceSyncState,
|
||||
|
||||
@@ -4,12 +4,12 @@ use crate::index::{
|
||||
use anyhow::anyhow;
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
use itertools::Itertools;
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use repo_metadata::entry::is_file_parsable;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256};
|
||||
use galaxy_util::standardized_path::StandardizedPath;
|
||||
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
|
||||
@@ -19,8 +19,10 @@ fn test_node_hash_for_directory_is_sorted() {
|
||||
sandbox.with_files(vec![Stub::FileWithContent("bar", "bar")]);
|
||||
|
||||
let mut directory_entry = DirectoryEntry {
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(dirs.tests())
|
||||
.unwrap(),
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(
|
||||
dirs.tests(),
|
||||
)
|
||||
.unwrap(),
|
||||
children: vec![],
|
||||
ignored: false,
|
||||
loaded: false,
|
||||
@@ -461,8 +463,10 @@ fn test_merkle_node_multiple_operations() {
|
||||
]);
|
||||
|
||||
let mut directory_entry = DirectoryEntry {
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(dirs.tests())
|
||||
.unwrap(),
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(
|
||||
dirs.tests(),
|
||||
)
|
||||
.unwrap(),
|
||||
children: vec![],
|
||||
ignored: false,
|
||||
loaded: true,
|
||||
@@ -570,8 +574,10 @@ fn test_merkle_node_multiple_operations() {
|
||||
);
|
||||
|
||||
let mut directory_entry = DirectoryEntry {
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(dirs.tests())
|
||||
.unwrap(),
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(
|
||||
dirs.tests(),
|
||||
)
|
||||
.unwrap(),
|
||||
children: vec![],
|
||||
ignored: false,
|
||||
loaded: true,
|
||||
@@ -772,8 +778,10 @@ fn test_merkle_node_multiple_operations() {
|
||||
|
||||
// Create a new MerkleTree with the expected final structure manually
|
||||
let mut expected_directory_entry = DirectoryEntry {
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(dirs.tests())
|
||||
.unwrap(),
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(
|
||||
dirs.tests(),
|
||||
)
|
||||
.unwrap(),
|
||||
children: vec![],
|
||||
ignored: false,
|
||||
loaded: true,
|
||||
|
||||
@@ -31,7 +31,8 @@ pub async fn construct_test_merkle_tree(
|
||||
]);
|
||||
|
||||
let mut root_dir_entry = DirectoryEntry {
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(dirs.tests()).unwrap(),
|
||||
path: galaxy_util::standardized_path::StandardizedPath::try_from_local(dirs.tests())
|
||||
.unwrap(),
|
||||
children: vec![],
|
||||
ignored: false,
|
||||
loaded: true,
|
||||
|
||||
@@ -16,9 +16,9 @@ pub use codebase_index::{CodebaseIndex, RetrievalID, SyncProgress};
|
||||
pub use merkle_tree::{ContentHash, NodeHash};
|
||||
|
||||
use fragment_metadata::FragmentMetadata;
|
||||
use galaxy_graphql::queries::rerank_fragments::FragmentLocationInput;
|
||||
use string_offset::ByteOffset;
|
||||
use thiserror::Error;
|
||||
use galaxy_graphql::queries::rerank_fragments::FragmentLocationInput;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use chrono::Utc;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use galaxyui::ModelHandle;
|
||||
#[cfg(feature = "local_fs")]
|
||||
use repo_metadata::Repository;
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
@@ -7,8 +9,6 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
time::Duration,
|
||||
};
|
||||
#[cfg(feature = "local_fs")]
|
||||
use galaxyui::ModelHandle;
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "local_fs")] {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use galaxy_core::sync_queue::{IsTransientError, SyncQueue, SyncQueueTaskTrait};
|
||||
use itertools::Itertools;
|
||||
use std::future::Future;
|
||||
use std::ops::AddAssign;
|
||||
@@ -8,7 +9,6 @@ use std::{
|
||||
mem,
|
||||
sync::Arc,
|
||||
};
|
||||
use galaxy_core::sync_queue::{IsTransientError, SyncQueue, SyncQueueTaskTrait};
|
||||
|
||||
use super::{CodebaseContextConfig, NodeHash};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user