Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release-workspace-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Replace the items in the task lists below with the applicable Pull Requests
- [ ] Also adjust the nightly Rust toolchain version used for formatting (this should be kept in
sync across here, operator-templating and docker-images).
- `.github/workflows/pre_commit.yaml`
- `.pre-commit-config.yaml`
- `.vscode/settings.json`
- [ ] Add a changelog entry.
- [ ] Update any actions (using the Git commit hash) in the workflows. Hint: Also make sure that the
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
CARGO_PROFILE_DEV_DEBUG: '0'
RUST_TOOLCHAIN_VERSION: "1.87.0"
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
RUST_TOOLCHAIN_VERSION: "1.89.0"
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
RUST_LOG: "info"
Expand All @@ -32,16 +32,16 @@ jobs:
env:
RUSTC_BOOTSTRAP: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
with:
key: udeps
- run: cargo install --locked cargo-udeps@0.1.57
- run: cargo install --locked cargo-udeps@0.1.59
- run: cargo udeps --all-targets --all-features

run_cargodeny:
Expand All @@ -57,28 +57,28 @@ jobs:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
- uses: EmbarkStudios/cargo-deny-action@30f817c6f72275c6d54dc744fbca09ebc958599f # v2.0.12
- uses: EmbarkStudios/cargo-deny-action@f2ba7abc2abebaf185c833c3961145a3c275caad # v2.0.13
with:
command: check ${{ matrix.checks }}

run_rustdoc:
name: Run RustDoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
components: rustfmt
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
with:
key: doc
- run: cargo doc --document-private-items
Expand All @@ -89,7 +89,7 @@ jobs:
- run_rustdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
Expand All @@ -99,7 +99,7 @@ jobs:
# for our cases.
# See: https://github.com/dtolnay/trybuild/issues/236#issuecomment-1620950759
components: rust-src
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
with:
key: test
- run: cargo test --no-default-features --workspace
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily_security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Security audit

on:
schedule:
- cron: '15 4 * * *'
- cron: "15 4 * * *"
workflow_dispatch:

permissions: {}
Expand All @@ -12,7 +12,7 @@ jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998 # v2.0.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr_pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN_VERSION: "nightly-2025-05-26"
RUST_TOOLCHAIN_VERSION: "nightly-2025-10-23"

permissions: {}

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
fetch-depth: 0
- uses: stackabletech/actions/run-pre-commit@4483641a7e24057bd2ba51cb4c3f2f0010ad21b7 # v0.8.4
- uses: stackabletech/actions/run-pre-commit@75e0756966dea229d697165bfd06ba79abcda72c # v0.10.3
with:
rust: ${{ env.RUST_TOOLCHAIN_VERSION }}
# rust-src is required for trybuild stderr output comparison to work
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- crates/**

env:
RUST_TOOLCHAIN_VERSION: "1.87.0"
RUST_TOOLCHAIN_VERSION: "1.89.0"

permissions: {}

Expand All @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

Expand All @@ -37,7 +37,7 @@ jobs:
run: echo '<meta http-equiv="refresh" content="0;url=stackable_operator/index.html">' > target/doc/index.html

- name: Upload Documentation Artifacts
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: target/doc

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
name: cargo-rustfmt
language: system
# Pinning to a specific rustc version, so that we get consistent formatting
entry: cargo +nightly-2025-05-26 fmt --all -- --check
entry: cargo +nightly-2025-10-23 fmt --all -- --check
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"rust-analyzer.imports.granularity.group": "crate",
"rust-analyzer.rustfmt.overrideCommand": [
"rustfmt",
"+nightly-2025-05-26",
"+nightly-2025-10-23",
"--edition",
"2024",
"--"
Expand Down
7 changes: 0 additions & 7 deletions crates/stackable-operator/src/config/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,6 @@ mod tests {
optional: Option<WithFields>,
}

#[derive(Fragment, Debug, PartialEq, Eq)]
#[fragment(path_overrides(fragment = "super"))]
struct GenericNested<T: super::FromFragment> {
required: T,
optional: Option<T>,
}

#[test]
fn validate_empty() {
assert_eq!(validate::<Empty>(EmptyFragment {}).unwrap(), Empty {});
Expand Down
2 changes: 1 addition & 1 deletion crates/stackable-operator/src/product_logging/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ where
T: Clone + Display + Ord,
{
/// Get the logging configuration for `container`, falling back to the default.
pub fn for_container(&self, container: &T) -> Cow<ContainerLogConfig> {
pub fn for_container(&'_ self, container: &T) -> Cow<'_, ContainerLogConfig> {
self.containers
.get(container)
.map(Cow::Borrowed)
Expand Down
8 changes: 4 additions & 4 deletions crates/stackable-operator/src/utils/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub trait OptionExt<T> {
/// Compared to [`Option::unwrap_or_else`], this saves having to [`Clone::clone`] the value to make the types line up.
///
/// Consider using [`Self::as_deref_or_else`] instead if the type implements [`Deref`] (such as [`String`] or [`PathBuf`]).
fn as_ref_or_else(&self, default: impl FnOnce() -> T) -> Cow<T>
fn as_ref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, T>
where
T: Clone;

Expand All @@ -18,22 +18,22 @@ pub trait OptionExt<T> {
/// Compared to [`Option::unwrap_or_else`], this saves having to [`Clone::clone`] the value to make the types line up.
///
/// Consider using [`Self::as_ref_or_else`] instead if the type does not implement [`Deref`].
fn as_deref_or_else(&self, default: impl FnOnce() -> T) -> Cow<T::Target>
fn as_deref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, T::Target>
where
T: Deref,
T::Target: ToOwned<Owned = T>;
}

impl<T> OptionExt<T> for Option<T> {
fn as_ref_or_else(&self, default: impl FnOnce() -> T) -> Cow<T>
fn as_ref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, T>
where
T: Clone,
{
self.as_ref()
.map_or_else(|| Cow::Owned(default()), Cow::Borrowed)
}

fn as_deref_or_else(&self, default: impl FnOnce() -> T) -> Cow<<T>::Target>
fn as_deref_or_else(&'_ self, default: impl FnOnce() -> T) -> Cow<'_, <T>::Target>
where
T: Deref,
<T>::Target: ToOwned<Owned = T>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ pub struct HeaderInjector<'a>(pub(crate) &'a mut HeaderMap);

impl Injector for HeaderInjector<'_> {
fn set(&mut self, key: &str, value: String) {
if let Ok(header_name) = HeaderName::from_bytes(key.as_bytes()) {
if let Ok(header_value) = HeaderValue::from_str(&value) {
self.0.insert(header_name, header_value);
}
if let Ok(header_name) = HeaderName::from_bytes(key.as_bytes())
&& let Ok(header_value) = HeaderValue::from_str(&value)
{
self.0.insert(header_name, header_value);
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions crates/stackable-telemetry/src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,16 +570,16 @@ impl Drop for Tracing {
"shutting down opentelemetry OTLP providers"
);

if let Some(tracer_provider) = &self.tracer_provider {
if let Err(error) = tracer_provider.shutdown() {
tracing::error!(%error, "unable to shutdown TracerProvider")
}
if let Some(tracer_provider) = &self.tracer_provider
&& let Err(error) = tracer_provider.shutdown()
{
tracing::error!(%error, "unable to shutdown TracerProvider")
}

if let Some(logger_provider) = &self.logger_provider {
if let Err(error) = logger_provider.shutdown() {
tracing::error!(%error, "unable to shutdown LoggerProvider");
}
if let Some(logger_provider) = &self.logger_provider
&& let Err(error) = logger_provider.shutdown()
{
tracing::error!(%error, "unable to shutdown LoggerProvider");
}
}
}
Expand Down
46 changes: 22 additions & 24 deletions crates/stackable-versioned-macros/src/attrs/item/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ impl CommonItemAttributes {
pub fn validate_versions(&self, versions: &[VersionDefinition]) -> Result<()> {
let mut errors = Error::accumulator();

if let Some(added) = &self.added {
if !versions.iter().any(|v| v.inner == *added.since) {
errors.push(Error::custom(
if let Some(added) = &self.added
&& !versions.iter().any(|v| v.inner == *added.since)
{
errors.push(Error::custom(
"the `added` action uses a version which is not declared via `#[versioned(version)]`",
).with_span(&added.since.span()));
}
}

for change in &self.changes {
Expand All @@ -82,12 +82,12 @@ impl CommonItemAttributes {
}
}

if let Some(deprecated) = &self.deprecated {
if !versions.iter().any(|v| v.inner == *deprecated.since) {
errors.push(Error::custom(
if let Some(deprecated) = &self.deprecated
&& !versions.iter().any(|v| v.inner == *deprecated.since)
{
errors.push(Error::custom(
"the `deprecated` action uses a version which is not declared via `#[versioned(version)]`",
).with_span(&deprecated.since.span()));
}
}

errors.finish()
Expand Down Expand Up @@ -148,12 +148,11 @@ impl CommonItemAttributes {
// version.
// NOTE (@Techassi): Is this already covered by the code below?
if let (Some(added_version), Some(deprecated_version)) = (added_version, deprecated_version)
&& added_version > deprecated_version
{
if added_version > deprecated_version {
return Err(Error::custom(format!(
return Err(Error::custom(format!(
"cannot marked as `added` in version `{added_version}` while being marked as `deprecated` in an earlier version `{deprecated_version}`"
)).with_span(item_idents.original()));
}
}

// Now, iterate over all changes and ensure that their versions are
Expand Down Expand Up @@ -206,11 +205,12 @@ impl CommonItemAttributes {
/// valid.
fn validate_added_action(&self) -> Result<()> {
// NOTE (@Techassi): Can the path actually be empty?
if let Some(added) = &self.added {
if added.default_fn.segments.is_empty() {
return Err(Error::custom("`default_fn` cannot be empty")
.with_span(&added.default_fn.span()));
}
if let Some(added) = &self.added
&& added.default_fn.segments.is_empty()
{
return Err(
Error::custom("`default_fn` cannot be empty").with_span(&added.default_fn.span())
);
}

Ok(())
Expand All @@ -230,15 +230,13 @@ impl CommonItemAttributes {
}

// This ensures that `from_name` doesn't include the deprecation prefix.
if let Some(from_name) = change.from_name.as_ref() {
if from_name.starts_with(item_ident.deprecation_prefix()) {
errors.push(
Error::custom(
"the previous name must not start with the deprecation prefix",
)
if let Some(from_name) = change.from_name.as_ref()
&& from_name.starts_with(item_ident.deprecation_prefix())
{
errors.push(
Error::custom("the previous name must not start with the deprecation prefix")
.with_span(&from_name.span()),
);
}
);
}

if change.from_type.is_none() {
Expand Down
14 changes: 7 additions & 7 deletions crates/stackable-versioned-macros/src/attrs/item/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ impl VariantAttributes {

// Validate names of renames
for change in &self.common.changes {
if let Some(from_name) = &change.from_name {
if !from_name.is_case(Case::Pascal) {
errors.push(
Error::custom("renamed variant must use PascalCase")
.with_span(&from_name.span()),
)
}
if let Some(from_name) = &change.from_name
&& !from_name.is_case(Case::Pascal)
{
errors.push(
Error::custom("renamed variant must use PascalCase")
.with_span(&from_name.span()),
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.87.0"
channel = "1.89.0"
profile = "default"
Loading