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(stackable-versioned): Adjust generated module and container names #797

Closed
wants to merge 3 commits into from

Conversation

Techassi
Copy link
Member

Description

Tracked by stackabletech/issues#507, follow-up of #764 and #793

Reviewer

Preview Give feedback

@Techassi Techassi self-assigned this May 24, 2024
@Techassi
Copy link
Member Author

Seems like we currently cannot use the heck crate for case conversions: withoutboats/heck#58.

@Techassi Techassi marked this pull request as ready for review May 24, 2024 09:13
@Techassi
Copy link
Member Author

The generated code now looks like this:

#[versioned(
    version(name = "v1alpha1"),
    version(name = "v1beta1"),
    version(name = "v1"),
    version(name = "v2"),
    version(name = "v3")
)]
struct Foo {
    /// My docs
    #[versioned(
        added(since = "v1alpha1"),
        renamed(since = "v1beta1", from = "jjj"),
        deprecated(since = "v2", note = "not empty")
    )]
    deprecated_bar: usize,
    baz: bool,
}

// Produces ...

#[automatically_derived]
pub mod foo {
    pub struct V1Alpha1 {
        pub jjj: usize,
        pub baz: bool,
    }
    pub struct V1Beta1 {
        pub bar: usize,
        pub baz: bool,
    }
    pub struct V1 {
        pub bar: usize,
        pub baz: bool,
    }
    pub struct V2 {
        #[deprecated = "not empty"]
        pub deprecated_bar: usize,
        pub baz: bool,
    }
    pub struct V3 {
        // Missing deprecated attribute will be fixed
        pub deprecated_bar: usize,
        pub baz: bool,
    }
}
pub type Foo = foo::V3;

NickLarsenNZ
NickLarsenNZ previously approved these changes May 24, 2024
Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

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

LGTM

crates/stackable-versioned/CHANGELOG.md Outdated Show resolved Hide resolved
crates/stackable-versioned/CHANGELOG.md Outdated Show resolved Hide resolved
@sbernauer
Copy link
Member

I guess we should also take #793 (comment) into consideration

@Techassi
Copy link
Member Author

Putting this PR on hold for now, as some more discussion is happening over at #793.

@Techassi
Copy link
Member Author

A decision in #793 was reached. We will stick with the current naming scheme and thus this PR will be closed.

@Techassi Techassi closed this May 28, 2024
@Techassi Techassi deleted the feat/crd-versioning-module-names branch May 28, 2024 08:10
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