Skip to content
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

feat: Add methods for repairing hot/cold repositories #255

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aawsome
Copy link
Member

@aawsome aawsome commented Sep 4, 2024

No description provided.

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 13.22314% with 105 lines in your changes missing coverage. Please review.

Project coverage is 40.5%. Comparing base (22a898c) to head (7343ef5).

Files with missing lines Patch % Lines
crates/core/src/commands/repair/hotcold.rs 0.0% 83 Missing ⚠️
crates/core/src/repository.rs 38.8% 22 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
crates/core/src/commands/config.rs 25.9% <100.0%> (+1.6%) ⬆️
crates/core/src/commands/init.rs 93.7% <ø> (ø)
crates/core/src/repository.rs 41.2% <38.8%> (-0.5%) ⬇️
crates/core/src/commands/repair/hotcold.rs 0.0% <0.0%> (ø)

... and 16 files with indirect coverage changes

---- 🚨 Try these New Features:

@aawsome aawsome changed the title WIP: feat: Add methods for repairing hot/cold repositories feat: Add methods for repairing hot/cold repositories Sep 6, 2024
@aawsome aawsome force-pushed the repair-hotcold branch 2 times, most recently from 9327d83 to 1b5fb66 Compare November 19, 2024 16:41
@simonsan
Copy link
Contributor

Merged main into it, because the test coverage failure is fixed there.

@aawsome
Copy link
Member Author

aawsome commented Nov 19, 2024

The failing test is due to missing tests...

@simonsan
Copy link
Contributor

The failing test is due to missing tests...

2024-11-20 00_35_37-feat_ Add methods for repairing hot_cold repositories by aawsome · Pull Request

I meant before 😅

@aawsome aawsome marked this pull request as ready for review November 19, 2024 23:37
/// * `config` - The config to use.
/// * `repo` - The repository to save the config to
/// * `new_config` - The config to save
/// * `key` - The key to encrypt the config with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// * `key` - The key to encrypt the config with
/// * `key_opts` - The options to create the key with.

/// # Returns
/// # Errors
///
/// * [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`] - If the file could not be serialized to json.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// * [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`] - If the file could not be serialized to json.
/// * If the file could not be serialized to json.

///
/// The key used to encrypt the config.
/// [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`]: crate::error::CryptBackendErrorKind::SerializingToJsonByteVectorFailed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`]: crate::error::CryptBackendErrorKind::SerializingToJsonByteVectorFailed

@@ -1,2 +1,3 @@
pub mod hotcold;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub mod hotcold;
pub mod hot_cold;

I think two separate words value an underscore.

RusticResult, WriteBackend, ALL_FILE_TYPES,
};

pub(crate) fn repair_hotcold<P: ProgressBars, S>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub(crate) fn repair_hotcold<P: ProgressBars, S>(
pub(crate) fn repair_hot_cold<P: ProgressBars, S>(

same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of documentation for this new function would be lovely as well 🚀

Ok(())
}

pub(crate) fn get_tree_packs<P: ProgressBars, S: Open>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of documentation for this new function would be lovely as well 🚀

Ok(tree_packs)
}

pub(crate) fn get_missing_files<P: ProgressBars, S>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of documentation for this new function would be lovely as well 🚀

///
/// # Errors
///
/// * [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`] - If the file could not be serialized to json.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// * [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`] - If the file could not be serialized to json.
/// * If the file could not be serialized to json.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C&P, please check if the errors make sense

Comment on lines +965 to +966
///
/// [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`]: crate::error::CryptBackendErrorKind::SerializingToJsonByteVectorFailed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
///
/// [`CryptBackendErrorKind::SerializingToJsonByteVectorFailed`]: crate::error::CryptBackendErrorKind::SerializingToJsonByteVectorFailed

Comment on lines +950 to +960
///
/// # Type Parameters
///
/// * `P` - The progress bar type.
/// * `S` - The state the repository is in.
///
/// # Arguments
///
/// * `repo` - The repository to save the config to
/// * `new_config` - The config to save
/// * `key` - The key to encrypt the config with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
///
/// # Type Parameters
///
/// * `P` - The progress bar type.
/// * `S` - The state the repository is in.
///
/// # Arguments
///
/// * `repo` - The repository to save the config to
/// * `new_config` - The config to save
/// * `key` - The key to encrypt the config with

@simonsan
Copy link
Contributor

simonsan commented Nov 19, 2024

First read through, for raw structure. Will read through it again for typos and impl.

EDIT: Can help fix the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants