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 support for human-readable duration formats #647

Merged
merged 38 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f438507
Update author constant
Techassi Sep 7, 2023
1bc051a
Add humantime Duration
Techassi Sep 7, 2023
a3f3a5e
Update changelog
Techassi Sep 7, 2023
ae18cc5
Add `from_secs` and `from_millis` helper functions
Techassi Sep 8, 2023
a524ef4
Trim trailing whitespace using pre-commit hook
Techassi Sep 8, 2023
0e5658f
Fix markdownlint errors using pre-commit hook
Techassi Sep 8, 2023
794dca8
Implement first iteration of custom parsing
Techassi Sep 8, 2023
8658713
Remove humantime dependency
Techassi Sep 8, 2023
88d4677
Add `Display` impl, add various `ops` impls
Techassi Sep 13, 2023
128eff7
Add negative tests
Techassi Sep 13, 2023
7dd912f
Merge branch 'main' into feat/humantime
Techassi Sep 13, 2023
c4d22b0
Rework `Duration` implementation based on @nightkr gist
Techassi Sep 14, 2023
cad5cfe
Add documentation
Techassi Sep 14, 2023
f63ec1a
Fix module documentation links
Techassi Sep 14, 2023
2377276
Fix bug
Techassi Sep 14, 2023
9e9257d
Update parser, add context to errors, add more tests
Techassi Sep 15, 2023
96f1600
Update src/duration/mod.rs
Techassi Sep 15, 2023
58b04c3
Re-add millisecond support, switch to Snafu
Techassi Sep 15, 2023
dbf1dce
Merge branch 'main' into feat/humantime
Techassi Sep 15, 2023
3282f9e
Fix markdown link references
Techassi Sep 15, 2023
a39af93
duration::serde_impl exports nothing
nightkr Sep 15, 2023
9fdb1b3
Split duration parsing context selectors into a submodule
nightkr Sep 15, 2023
191151a
typo: "expected character" -> "unexpected character"
nightkr Sep 15, 2023
9dbcefe
Fail if duration buffer is non-empty at the end of parsing
nightkr Sep 15, 2023
705ed1f
Use Debug impls to quote strings in errors
nightkr Sep 15, 2023
fe1911e
Non-ASCII input will be caught anyway, because it's never a valid cha…
nightkr Sep 15, 2023
8ef94a7
DurationUnit doesn't need to be public
nightkr Sep 15, 2023
e7e4718
Add check for invalid unit order and duplicate units
Techassi Sep 18, 2023
2d3d32c
Revert "Non-ASCII input will be caught anyway, because it's never a v…
Techassi Sep 18, 2023
6b882e6
Fix doc comment
Techassi Sep 18, 2023
36e8035
Impl Mul and Div
sbernauer Sep 18, 2023
dcb4dd0
Impl Mul and Div 2
sbernauer Sep 18, 2023
198ae50
impl JsonSchema for Duration
sbernauer Sep 18, 2023
6737e51
Re-order `SubAssign` impl
Techassi Sep 18, 2023
29fca80
Revert "Revert "Non-ASCII input will be caught anyway, because it's n…
nightkr Sep 18, 2023
9a5c6da
Remove `impl Div<Duration> for u32`
Techassi Sep 18, 2023
98149d7
Fix scanning of multibyte chars
nightkr Sep 18, 2023
017ca87
Merge branch 'feat/humantime' of github.com:stackabletech/operator-rs…
nightkr Sep 18, 2023
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
3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Description
# Description

*Please add a description here. This will become the commit message of the merge request later.*

Expand All @@ -7,7 +7,6 @@
- Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
- Please make sure all these things are done and tick the boxes


```[tasklist]
# Author
- [ ] Changes are OpenShift compatible
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Add `Duration` capable of parsing human-readable duration formats ([#647])

[#647]: https://github.com/stackabletech/operator-rs/pull/647

### Changed

- Bump `kube` to `0.86.0` and Kubernetes version to `1.28` ([#648]).
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ use std::{
path::{Path, PathBuf},
};

pub const AUTHOR: &str = "Stackable GmbH - info@stackable.de";
pub const AUTHOR: &str = "Stackable GmbH - info@stackable.tech";

/// Framework-standardized commands
///
Expand Down
2 changes: 1 addition & 1 deletion src/commons/authentication/static_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! The update time depends on the kubelet syncing period.
//! This would need additional functionality in restart controller to white- or blacklist certain volumes. Additionally, we would need a sidecar container that
//! periodically converts the secret contents to the required product format.
//!
//!
//! See <https://github.com/stackabletech/operator-rs/issues/494>
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion src/commons/opa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! )]
//! #[serde(rename_all = "camelCase")]
//! pub struct TestClusterSpec {
//! opa: Option<OpaConfig>
//! opa: Option<OpaConfig>
//! }
//!
//! let cluster: TestCluster = serde_yaml::from_str(
Expand Down
Loading