Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat: Add a "minutely" timeline - #374

Merged
simonsan merged 4 commits into
rustic-rs:mainfrom
jullanggit:keep_minutely
Nov 30, 2024
Merged

simonsan merged 4 commits into
rustic-rs:mainfrom
jullanggit:keep_minutely

Conversation

@jullanggit

Copy link
Copy Markdown
Contributor

Disclaimer

I am not very experienced with contributing to projects like rustic, so please correct me if I make any mistakes or could improve something about this PR!
In this case, I am particularly unsure about the commit message and how to add tests, so any tips there would be appreciated 😄

Motivation

As creating a rustic snapshot can be really fast if not much has changed (less than 10s), I have started to backup-up my files every ten minutes, but noticed that rustic doesn't yet have any keep-options for sub-hourly snapshots, so I decided to add them!

@jullanggit jullanggit changed the title Add a "minutely" timeline feat: Add a "minutely" timeline Nov 28, 2024
Comment thread crates/core/src/commands/forget.rs Resolved
@simonsan

simonsan commented Nov 29, 2024 •

Copy link
Copy Markdown
Contributor

Please also add an explanation to ./config/full.toml and the ./config/Readme.md 📓 of rustic itself, when this is merged. As we need to implement the additions then also in rustic.

@jullanggit

Copy link
Copy Markdown
Contributor Author

The clippy CI shows some warnings/errors. Should I try to fix them? (most of them are not related to this PR)

@aawsome

aawsome commented Nov 29, 2024

Copy link
Copy Markdown
Member

@jullanggit Ah, I think these are due to a new Rust version. We should fix those in a separate PR before we merge this one...

@aawsome

aawsome commented Nov 29, 2024

Copy link
Copy Markdown
Member

It would be great if you could extend/adapt the unittests in forget.rs to cover the new option, @jullanggit Besides this, this PR looks good to me, just needs to wait until we fix the clippy lints in master. Thanks a lot for the contribution!

@simonsan

Copy link
Copy Markdown
Contributor

The only thing missing now for clippy is the #[allow(clippy::too_many_lines)] annotation on matches().

@simonsan
simonsan added this pull request to the merge queue Nov 30, 2024
@simonsan

Copy link
Copy Markdown
Contributor

Thank you for the contribution! 🚀 :)

Merged via the queue into rustic-rs:main with commit 534efbd Nov 30, 2024
github-merge-queue Bot pushed a commit that referenced this pull request Nov 30, 2024
## 🤖 New release
* `rustic_core`: 0.7.1 -> 0.7.2 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `rustic_core`
<blockquote>

##
[0.7.2](rustic_core-v0.7.1...rustic_core-v0.7.2)
- 2024-11-30

### Added

- Add a "minutely" timeline
([#374](#374))

### Fixed

- clippy lints
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: rustic-release-plz[bot] <182542030+rustic-release-plz[bot]@users.noreply.github.com>
simonsan added a commit to rustic-rs/rustic that referenced this pull request Nov 30, 2024
Adds documentation for the minutely timeline
(rustic-rs/rustic_core#374) in
`./config/full.toml` and `./config/README.md`

Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com>
aawsome pushed a commit that referenced this pull request Oct 31, 2026
`equal_minute` compared the half year and the minute, not the hour.
Snapshots taken at the same minute of different hours therefore counted
as one, so `keep-minutely` skipped them and spent its quota on older
snapshots with other minutes.

`equal_minute` now builds on `equal_hour`, the same way `equal_hour`
builds on `equal_day`.

Tests: `equal_minute` for the same minute, another minute, another hour
and another day, plus `KeepOptions::apply` on hourly snapshots, which
must keep the newest ones. The last one and the hour and day cases fail
on `main`.

A retention policy with `keep-minutely` that was keeping old snapshots
through this bug will now forget them.

This is a regression from #452. The first version of `equal_minute` in
#374 compared the year, the day of the year, the hour and the minute.

CI passes on the fork:
https://github.com/Akayashuu/rustic_core/actions/runs/41188560507

Closes #573
mchobbit pushed a commit to mchobbit/rustic_core that referenced this pull request Nov 5, 2026
…stic-rs#633)

`equal_minute` compared the half year and the minute, not the hour.
Snapshots taken at the same minute of different hours therefore counted
as one, so `keep-minutely` skipped them and spent its quota on older
snapshots with other minutes.

`equal_minute` now builds on `equal_hour`, the same way `equal_hour`
builds on `equal_day`.

Tests: `equal_minute` for the same minute, another minute, another hour
and another day, plus `KeepOptions::apply` on hourly snapshots, which
must keep the newest ones. The last one and the hour and day cases fail
on `main`.

A retention policy with `keep-minutely` that was keeping old snapshots
through this bug will now forget them.

This is a regression from rustic-rs#452. The first version of `equal_minute` in
rustic-rs#374 compared the year, the day of the year, the hour and the minute.

CI passes on the fork:
https://github.com/Akayashuu/rustic_core/actions/runs/41188560507

Closes rustic-rs#573

(cherry picked from commit 4c3d6fa)
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.

3 participants