-
Notifications
You must be signed in to change notification settings - Fork 111
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
Deprecate legacy items #1141
Deprecate legacy items #1141
Conversation
See the following report for details: cargo semver-checks output
|
semver-checks deem this PR API-breaking, but if you read its message through, you'll see that it only requires a minor version bump, not major - so it's OK to do the changes in 0.15.1 (because we consider the last number the minor version number). |
We should make message and tag different if only a minor version bump is required. Especially after 1.0 |
Please don't merge yet. I'll update thiserror after 2.0.6 got released, so that there are no unnecessary module-level `#![allow(deprecated)] attributes. |
57072e7
to
6bab921
Compare
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.
Commit: "codewide: deprecate legacy serialization API's items "
Do we strictly need this "legacy" module? Why not just deprecate the items?
If it is required for some reason, then it's creation should be a separate commit, not the same one that adds deprecation.
thiserror fixed handling of deprecated items in 2.0.6, which is crucial for the next commits introducing deprecation notice for legacy types. Note: this is not a breaking change, because thiserror does not appear in the public API.
There were some remnants from the legacy deserialization API that had not been marked with #[deprecated] attribute.
There are a huge lot of items, it would be a lot of meaningless work to attribute each of them. |
But you are also applying deprecation notices to the items inside this new module, not only to the module itself. |
To make deprecations in value.rs less invasive, as measured by the number of required changes in the next commit, a `legacy` module is extracted for all legacy items. As a bonus, the future deletion of legacy items will be clearer. I recommend viewing this commit with whitespace changes ignored.
6bab921
to
da6102a
Compare
Items constituting the legacy serialization API hadn't been marked with the #[deprecated] attribute. As we're going to remove them soon, let's warn users about that explicitly.
da6102a
to
c136255
Compare
Those notices from inside the new module were leftovers. Now there is per-module global deprecation notice. |
#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] | ||
pub enum SerializeValuesError { | ||
#[error("Too many values to add, max 65,535 values can be sent in a request")] | ||
TooManyValues, | ||
#[error("Mixing named and not named values is not allowed")] | ||
MixingNamedAndNotNamedValues, | ||
#[error(transparent)] | ||
ValueTooBig(#[from] ValueTooBig), | ||
#[error("Parsing serialized values failed")] | ||
ParseError, | ||
} | ||
|
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.
Why is this not part of the legacy module?
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.
ditto for ValueTooBig
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.
SerializeValuesError
is used in types::serialize::row::SerializedValues::add_value
, and SerializeValuesError
contains a variant for ValueTooBig
. That's why I left those not deprecated.
Deprecate legacy items (cherry picked from commit 868d86f)
The following items are now marked as deprecated:
Serialization:
scylla::impl_serialize_value_via_value
scylla::impl_serialize_row_via_value_list
scylla::ValueList
scylla::serialize::batch::LegacyBatchValuesAdapter
scylla::serialize::batch::LegacyBatchValuesIteratorAdapter
scylla::serialize::row::ValueListAdapter
scylla::serialize::row::ValueListToSerializeRowAdapterError
scylla::serialize::row::serialize_legacy_row
scylla::serialize::value::ValueAdapter
scylla::serialize::value::ValueToSerializeValueAdapterError
scylla::serialize::value::serialize_legacy_value
scylla_cql::frame::value::LegacyBatchValues
scylla_cql::frame::value::LegacyBatchValuesFirstSerialized
scylla_cql::frame::value::LegacyBatchValuesIterator
scylla_cql::frame::value::LegacyBatchValuesFromIter
scylla_cql::frame::value::LegacyBatchValuesIteratorFromIterator
scylla_cql::frame::value::TupleValuesIter
scylla_cql::frame::value::Value
Deserialization:
scylla::impl_from_cql_value_from_method
scylla::transport::iterator::LegacyNextRowError
scylla::transport::legacy_query_result::IntoLegacyQueryResultError
scylla::transport::legacy_query_result::MaybeFirstRowTypedError
scylla::transport::legacy_query_result::RowsExpectedError
scylla::transport::legacy_query_result::SingleRowError
scylla::transport::legacy_query_result::IntoTypedRows
scylla::transport::legacy_query_result::TypedRowIter
scylla_cql::cql_to_rust::FromCqlValError
scylla_cql::cql_to_rust::FromRowError
Fixes: #1139
Pre-review checklist
[ ] I added relevant tests for new features and bug fixes.[ ] I have provided docstrings for the public items that I want to introduce.[ ] I have adjusted the documentation in./docs/source/
.Fixes:
annotations to PR description.