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

split snapshotter #2245

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

split snapshotter #2245

wants to merge 3 commits into from

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Jan 24, 2025

Content

This PR makes the snapshotter code more manageable by:

  • moving it to services so it's no longer uncategorized at the source route
  • split the module into several files to limit amount of code to navigate and make it more cohesive.

This PR also simplify local uploaders constructors by removing their StdResult (no longer needed since #2241)

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Alenar and others added 3 commits January 24, 2025 18:39
The snapshotter has become quite big with time with more than 900 lines
and multiples structs, this split makes the code more manageable.

Co-authored-by: Damien Lachaume <[email protected]>
by removing the StdResult as they raise no errors.

Co-authored-by: Damien Lachaume <[email protected]>
@Alenar Alenar added the refactoring 🛠️ Code refactoring and enhancements label Jan 24, 2025
@Alenar Alenar requested review from sfauvel and jpraynaud January 24, 2025 17:52
GeneralError(String),
}

/// Compression algorithm and parameters of the [CompressedArchiveSnapshotter].

Check warning

Code scanning / cargo-doc

unresolved link to CompressedArchiveSnapshotter Warning

unresolved link to CompressedArchiveSnapshotter
Copy link

Test Results

    4 files  ±0     52 suites  ±0   10m 27s ⏱️ +20s
1 545 tests ±0  1 545 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 801 runs  ±0  1 801 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ec310e0. ± Comparison against base commit 693d95a.

This pull request removes 15 and adds 15 tests. Note that renamed tests count towards both.
mithril-aggregator ‑ snapshotter::tests::can_return_full_archive_path
mithril-aggregator ‑ snapshotter::tests::can_set_temp_dir_with_str_or_string
mithril-aggregator ‑ snapshotter::tests::is_snapshot_exist_return_true_when_file_exists
mithril-aggregator ‑ snapshotter::tests::should_clean_pending_snapshot_directory_if_already_exists
mithril-aggregator ‑ snapshotter::tests::should_create_a_valid_archive_with_gzip_snapshotter
mithril-aggregator ‑ snapshotter::tests::should_create_a_valid_archive_with_zstandard_snapshotter
mithril-aggregator ‑ snapshotter::tests::should_create_directory_if_does_not_exist
mithril-aggregator ‑ snapshotter::tests::should_delete_tmp_file_in_pending_snapshot_directory_if_snapshotting_fail
mithril-aggregator ‑ snapshotter::tests::snapshot_overwrite_archive_already_existing
mithril-aggregator ‑ snapshotter::tests::snapshot_subset_return_error_when_empty_entries
…
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::can_return_full_archive_path
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::can_set_temp_dir_with_str_or_string
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::is_snapshot_exist_return_true_when_file_exists
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::should_clean_pending_snapshot_directory_if_already_exists
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::should_create_a_valid_archive_with_gzip_snapshotter
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::should_create_a_valid_archive_with_zstandard_snapshotter
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::should_create_directory_if_does_not_exist
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::should_delete_tmp_file_in_pending_snapshot_directory_if_snapshotting_fail
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::snapshot_overwrite_archive_already_existing
mithril-aggregator ‑ services::snapshotter::compressed_archive_snapshotter::tests::snapshot_subset_return_error_when_empty_entries
…

@Alenar Alenar deployed to testing-preview January 24, 2025 18:01 — with GitHub Actions Active
@Alenar Alenar deployed to testing-sanchonet January 24, 2025 18:01 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring 🛠️ Code refactoring and enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants