feat: Add legacy-states-v0 Cargo feature for backward compatibility #1076 #1135
+17
−3
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.
Description
This PR implements the
legacy-states-v0
Cargo feature to guard backward compatibility code in the Rust codebase, as requested in issue #1076.Changes Made
Cargo.toml
legacy-states-v0
feature flag, enabled by defaultSource Code Changes
src/setup/states.rs
: Guarded the deprecatedkey_schema
field with#[cfg(feature="legacy-states-v0")]
src/builder/exec_ctx.rs
: Updated backward compatibility logic to conditionally compile based on the feature flagCI/CD Changes
.github/workflows/_test.yml
: Addedcargo test --no-default-features --verbose
to ensure both code paths compile and test successfullyImplementation Details
The feature flag approach allows for:
default = []
and legacy code removedTesting
--no-default-features
(128 tests)Future Usage
This establishes a framework for managing backward compatibility. Additional legacy code can be guarded with the same feature flag pattern:
When ready to drop v0.x compatibility:
Closes #1076.