Skip to content

feat(stackable-versioned): Generate downgrade From impls #1033

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

Merged
merged 31 commits into from
May 22, 2025

Conversation

Techassi
Copy link
Member

@Techassi Techassi commented May 14, 2025

This PR adds support to downgrade CRDs.

  • The #[versioned()] macro generates From impls for downgrading.
  • Change the convert_with parameter of the changed() action accordingly to support customizing both the upgrade and downgrade conversion function. There are now two separate parameters: upgrade_with and downgrade_with.
  • Emit a status subresource to be able to track values of the resource during upgrade and downgrade operations.

@Techassi Techassi self-assigned this May 14, 2025
@Techassi Techassi force-pushed the feat/stackable-versioned-downgrade-from-impls branch from 53fe2c7 to 3fc0b82 Compare May 16, 2025 10:28
@Techassi Techassi moved this to Development: In Progress in Stackable Engineering May 16, 2025
@Techassi Techassi moved this from Development: In Progress to Development: Waiting for Review in Stackable Engineering May 16, 2025
@Techassi Techassi marked this pull request as ready for review May 16, 2025 10:36
@sbernauer sbernauer moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering May 16, 2025
@Techassi Techassi requested a review from sbernauer May 21, 2025 10:53
Copy link
Member

@sbernauer sbernauer left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my points, another round of review :)

Copy link
Member

@sbernauer sbernauer left a comment

Choose a reason for hiding this comment

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

LGTM, but there is still one leftover:

diff --git a/crates/stackable-versioned-macros/tests/trybuild.rs b/crates/stackable-versioned-macros/tests/trybuild.rs
index 891cc60..d58c32d 100644
--- a/crates/stackable-versioned-macros/tests/trybuild.rs
+++ b/crates/stackable-versioned-macros/tests/trybuild.rs
@@ -21,9 +21,9 @@ mod inputs {
             // mod attribute_enum;
             // mod attribute_struct;
             // mod basic_struct;
-            // mod convert_with;
             // mod deprecate_enum;
             // mod deprecate_struct;
+            // mod downgrade_with;
             // mod enum_data_simple;
             // mod generics_defaults;
             // mod generics_module;

@Techassi Techassi requested a review from sbernauer May 22, 2025 13:29
@Techassi Techassi requested a review from sbernauer May 22, 2025 13:43
@Techassi Techassi enabled auto-merge May 22, 2025 14:10
@Techassi Techassi added this pull request to the merge queue May 22, 2025
@Techassi Techassi moved this from Development: In Review to Development: Done in Stackable Engineering May 22, 2025
Merged via the queue into main with commit bc58ff9 May 22, 2025
7 of 8 checks passed
@Techassi Techassi deleted the feat/stackable-versioned-downgrade-from-impls branch May 22, 2025 14:17
@lfrancke lfrancke moved this from Development: Done to Done in Stackable Engineering May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants