-
-
Notifications
You must be signed in to change notification settings - Fork 15
feat(stackable-versioned)!: Integrate with ConversionReviews #1050
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
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
17ff823
feat(stackable-versioned): Add flux-converter
sbernauer eb141e0
test: Add roundtrip generation via macro
sbernauer 5a1a62f
fix some tests
sbernauer 6a88cf4
Fix remaining tests
sbernauer 3de96a7
fix rest of tests
sbernauer 91e440d
Merge branch 'main' into feat/flux-converter-2
sbernauer 27b89b4
chore: Merge branch 'main' into feat/flux-converter-2
Techassi 95d2c83
chore: Merge branch 'main' into feat/flux-converter-2
Techassi 3a10e4d
refactor(k8s-version): Move darling code into module
Techassi 86a1c66
refactor(stackable-versioned): Split utils into separate files
Techassi bc7da2b
chore(stackable-versioned): Cleanup, move and improve conversion code
Techassi de8db62
chore(stackable-versioned): Move K8s related error enums
Techassi 57011ab
chore(stackable-versioned): Move code, add error handling
Techassi 51162b9
chore(stackable-versioned): Remove roundtrip tests
Techassi a6e1273
chore(crd-preview): Fix macro, add re-exports
Techassi 297f75b
chore!(stackable-versioned): Remove unused merged_crd skip flag
Techassi 15bb2a4
fix(stackable-versioned): Emit status field during conversion
Techassi cfa83ca
chore: Fix clippy lints
Techassi 510a32e
test(stackable-versioned): Adjust snapshots
Techassi ae2954a
chore: Add rust-analyzer setting
Techassi 83fec7e
chore: Allow RUSTSEC-2024-0436 advisory
Techassi 70c5367
chore(stackable-versioned): Remove unused fixtures
Techassi 37f476d
chore(stackable-versioned): Remove unused feature
Techassi 0e544dc
chore(stackable-versioned): Fix rustdoc
Techassi b004805
chore: Remove unused dependencies
Techassi ffd4db8
chore(stackable-versioned): Move Otel attributes into constants
Techassi 914b466
docs(stackable-versioned): Adjust K8s doc comments
Techassi 619a26c
test(stackable-versioned): Improve conversion_paths unit test
Techassi a432a18
chore(stackable-versioned): Update changelog
Techassi 54f4185
chore: Apply suggestions
Techassi 195b7b7
docs(stackable-versioned): Add doc comments
Techassi e1bf934
chore: Apply suggestion
Techassi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use std::str::FromStr; | ||
|
||
use darling::FromMeta; | ||
|
||
use crate::ApiVersion; | ||
|
||
impl FromMeta for ApiVersion { | ||
fn from_string(value: &str) -> darling::Result<Self> { | ||
Self::from_str(value).map_err(darling::Error::custom) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use quote::quote; | ||
use rstest::rstest; | ||
|
||
use super::*; | ||
use crate::{Level, Version}; | ||
|
||
fn parse_meta(tokens: proc_macro2::TokenStream) -> ::std::result::Result<syn::Meta, String> { | ||
let attribute: syn::Attribute = syn::parse_quote!(#[#tokens]); | ||
Ok(attribute.meta) | ||
} | ||
|
||
#[rstest] | ||
#[case(quote!(ignore = "extensions/v1beta1"), ApiVersion { group: Some("extensions".parse().unwrap()), version: Version { major: 1, level: Some(Level::Beta(1)) } })] | ||
#[case(quote!(ignore = "v1beta1"), ApiVersion { group: None, version: Version { major: 1, level: Some(Level::Beta(1)) } })] | ||
#[case(quote!(ignore = "v1"), ApiVersion { group: None, version: Version { major: 1, level: None } })] | ||
fn from_meta(#[case] input: proc_macro2::TokenStream, #[case] expected: ApiVersion) { | ||
let meta = parse_meta(input).expect("valid attribute tokens"); | ||
let api_version = ApiVersion::from_meta(&meta).expect("version must parse from attribute"); | ||
assert_eq!(api_version, expected); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: check if this is the same in our other rust repos:
There are more, but they are less used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to action here, this was just me thinking. I will check it out later.