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

Remove legacy serialization and deserialization APIs #1184

Merged
merged 24 commits into from
Feb 4, 2025

Conversation

Lorak-mmk
Copy link
Collaborator

@Lorak-mmk Lorak-mmk commented Jan 29, 2025

This PR finally removes both of the old APIs.
Focus in review should be on making sure that I didn't miss anything that shall be removed.

Removing old APIs makes it clear that some cleanups in scylla-cql shall be done.
Those will be described and done in a follow-up PR because this one is already big enough.

I'm delibarately not marking this as fixing #1167 - the follow-up PR that deals with the consequences of API removal will do that.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

@Lorak-mmk Lorak-mmk added this to the 0.16.0 milestone Jan 29, 2025
@Lorak-mmk Lorak-mmk self-assigned this Jan 29, 2025
@github-actions github-actions bot added the semver-checks-breaking cargo-semver-checks reports that this PR introduces breaking API changes label Jan 30, 2025
Copy link

github-actions bot commented Jan 30, 2025

cargo semver-checks detected some API incompatibilities in this PR.
Checked commit: 9cc52c9

See the following report for details:

cargo semver-checks output
./scripts/semver-checks.sh --baseline-rev 0a0480bee3930727c4d5e1b3cc382273f17336d6
+ cargo semver-checks -p scylla -p scylla-cql --baseline-rev 0a0480bee3930727c4d5e1b3cc382273f17336d6
     Cloning 0a0480bee3930727c4d5e1b3cc382273f17336d6
    Building scylla v0.15.0 (current)
       Built [  21.736s] (current)
     Parsing scylla v0.15.0 (current)
      Parsed [   0.049s] (current)
    Building scylla v0.15.0 (baseline)
       Built [  22.544s] (baseline)
     Parsing scylla v0.15.0 (baseline)
      Parsed [   0.050s] (baseline)
    Checking scylla v0.15.0 -> v0.15.0 (no change)
     Checked [   0.123s] 127 checks: 121 pass, 6 fail, 0 warn, 0 skip

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/enum_missing.ron

Failed in:
  enum scylla::client::session::CurrentDeserializationApi, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/session.rs:83
  enum scylla::response::legacy_query_result::MaybeFirstRowTypedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:286
  enum scylla::response::legacy_query_result::FirstRowTypedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:263
  enum scylla::client::session::LegacyDeserializationApi, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/session.rs:91
  enum scylla::response::legacy_query_result::SingleRowTypedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:324
  enum scylla::response::legacy_query_result::IntoLegacyQueryResultError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:203
  enum scylla::response::legacy_query_result::FirstRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:249
  enum scylla::response::legacy_query_result::SingleRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:305
  enum scylla::client::pager::LegacyNextRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/pager.rs:1177

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/enum_variant_missing.ron

Failed in:
  variant ExecutionError::IntoLegacyQueryResultError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/errors.rs:136
  variant BadQuery::SerializeValuesError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/errors.rs:503

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/inherent_method_missing.ron

Failed in:
  QueryPager::into_legacy, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/pager.rs:681
  GenericSessionBuilder::build_legacy, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/session_builder.rs:568
  QueryResult::into_legacy_result, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/query_result.rs:267

--- failure module_missing: pub module removed or renamed ---

Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/module_missing.ron

Failed in:
  mod scylla::response::legacy_query_result, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:1

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/struct_missing.ron

Failed in:
  struct scylla::client::session::GenericSession, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/session.rs:98
  struct scylla::client::pager::LegacyTypedRowIterator, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/pager.rs:1152
  struct scylla::response::legacy_query_result::RowsNotExpectedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:246
  struct scylla::client::caching_session::GenericCachingSession, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/caching_session.rs:43
  struct scylla::response::legacy_query_result::RowsExpectedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:233
  struct scylla::response::legacy_query_result::LegacyQueryResult, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:61
  struct scylla::client::pager::LegacyRowIterator, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/pager.rs:1099
  struct scylla::client::session::TypedRowIter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:40
  struct scylla::response::legacy_query_result::TypedRowIter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:40

--- failure trait_missing: pub trait removed or renamed ---

Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/trait_missing.ron

Failed in:
  trait scylla::client::session::IntoTypedRows, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:19
  trait scylla::response::legacy_query_result::IntoTypedRows, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/response/legacy_query_result.rs:19
  trait scylla::client::session::DeserializationApiKind, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla/src/client/session.rs:81

     Summary semver requires new major version: 6 major and 0 minor checks failed
    Finished [  45.372s] scylla
    Building scylla-cql v0.4.0 (current)
       Built [  10.961s] (current)
     Parsing scylla-cql v0.4.0 (current)
      Parsed [   0.028s] (current)
    Building scylla-cql v0.4.0 (baseline)
       Built [  10.960s] (baseline)
     Parsing scylla-cql v0.4.0 (baseline)
      Parsed [   0.034s] (baseline)
    Checking scylla-cql v0.4.0 -> v0.4.0 (no change)
     Checked [   0.121s] 127 checks: 120 pass, 7 fail, 0 warn, 0 skip

--- failure declarative_macro_missing: macro_rules declaration removed or renamed ---

Description:
A `macro_rules!` declarative macro cannot be invoked by its prior name. The macro may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/declarative_macro_missing.ron

Failed in:
  macro impl_serialize_value_via_value, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/value.rs:957
  macro impl_serialize_value_via_value, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/value.rs:957
  macro impl_serialize_value_via_value, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/value.rs:957
  macro impl_serialize_row_via_value_list, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/row.rs:425
  macro impl_serialize_row_via_value_list, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/row.rs:425
  macro impl_serialize_row_via_value_list, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/row.rs:425
  macro impl_from_cql_value_from_method, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:116
  macro impl_from_cql_value_from_method, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:116
  macro impl_from_cql_value_from_method, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:116

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/enum_missing.ron

Failed in:
  enum scylla_cql::frame::response::cql_to_rust::FromRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:19
  enum scylla_cql::cql_to_rust::FromRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:19
  enum scylla_cql::_macro_internal::FromRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:19
  enum scylla_cql::frame::response::cql_to_rust::FromCqlValError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:42
  enum scylla_cql::cql_to_rust::FromCqlValError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:42
  enum scylla_cql::_macro_internal::FromCqlValError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:42
  enum scylla_cql::serialize::value::ValueToSerializeValueAdapterError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/value.rs:1504
  enum scylla_cql::frame::value::SerializeValuesError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:814
  enum scylla_cql::serialize::row::ValueListToSerializeRowAdapterError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/row.rs:724

--- failure function_missing: pub fn removed or renamed ---

Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/function_missing.ron

Failed in:
  function scylla_cql::serialize::value::serialize_legacy_value, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/value.rs:1021
  function scylla_cql::serialize::row::serialize_legacy_row, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/row.rs:507

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/inherent_method_missing.ron

Failed in:
  Row::into_typed, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/result.rs:670

--- failure module_missing: pub module removed or renamed ---

Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/module_missing.ron

Failed in:
  mod scylla_cql::frame::response::cql_to_rust, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:1
  mod scylla_cql::cql_to_rust, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:1

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/struct_missing.ron

Failed in:
  struct scylla_cql::frame::value::LegacyBatchValuesFromIter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:1786
  struct scylla_cql::frame::value::LegacyBatchValuesIteratorFromIterator, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:1034
  struct scylla_cql::frame::value::ValueTooBig, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:811
  struct scylla_cql::_macro_internal::ValueTooBig, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:811
  struct scylla_cql::frame::value::LegacySerializedValues, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:828
  struct scylla_cql::_macro_internal::LegacySerializedValues, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:828
  struct scylla_cql::frame::value::LegacyBatchValuesFirstSerialized, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:1960
  struct scylla_cql::serialize::row::ValueListAdapter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/row.rs:459
  struct scylla_cql::serialize::value::ValueAdapter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/value.rs:986
  struct scylla_cql::serialize::batch::LegacyBatchValuesAdapter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/batch.rs:340
  struct scylla_cql::frame::value::LegacySerializedValuesIterator, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:968
  struct scylla_cql::serialize::batch::LegacyBatchValuesIteratorAdapter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/serialize/batch.rs:364
  struct scylla_cql::frame::value::TupleValuesIter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:1862

--- failure trait_missing: pub trait removed or renamed ---

Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.39.0/src/lints/trait_missing.ron

Failed in:
  trait scylla_cql::frame::response::cql_to_rust::FromRow, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:56
  trait scylla_cql::cql_to_rust::FromRow, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:56
  trait scylla_cql::_macro_internal::FromRow, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:56
  trait scylla_cql::FromRow, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:56
  trait scylla_cql::frame::value::LegacyBatchValues, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:992
  trait scylla_cql::frame::response::cql_to_rust::FromCqlVal, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:33
  trait scylla_cql::cql_to_rust::FromCqlVal, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:33
  trait scylla_cql::_macro_internal::FromCqlVal, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/response/cql_to_rust.rs:33
  trait scylla_cql::frame::value::ValueList, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:838
  trait scylla_cql::_macro_internal::ValueList, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:838
  trait scylla_cql::frame::value::LegacyBatchValuesIterator, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:1011
  trait scylla_cql::frame::value::Value, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:805
  trait scylla_cql::_macro_internal::Value, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-0a0480bee3930727c4d5e1b3cc382273f17336d6/1f269fa5ccb80681dcee7ec646cb5c7ced38f784/scylla-cql/src/frame/value.rs:805

     Summary semver requires new major version: 7 major and 0 minor checks failed
    Finished [  22.607s] scylla-cql
make: *** [Makefile:61: semver-rev] Error 1

@Lorak-mmk Lorak-mmk force-pushed the remove-legacy-apis branch 7 times, most recently from d0b0da8 to 52cc5c5 Compare January 30, 2025 15:50
@Lorak-mmk Lorak-mmk marked this pull request as ready for review January 30, 2025 16:03
@Lorak-mmk Lorak-mmk force-pushed the remove-legacy-apis branch 2 times, most recently from 555e7b1 to 9f20778 Compare January 30, 2025 16:17
@wprzytula
Copy link
Collaborator

After removing (1), and removing cql_to_rust module which was also in frame, I find it a bit weird
for this module to be placed in frame.
Serialization / deserialization are now a top-level modules in scylla_cql, so maybe this one should be too?

👍, let's move value.rs and value_test.rs out of frame.

scylla-cql/src/frame/value_tests.rs Outdated Show resolved Hide resolved
Comment on lines 64 to 68
# Setup Sphinx
def setup(sphinx):
lexers['rust'] = RustLexer()
lexers['rust,ignore'] = RustLexer()
lexers['toml'] = TOMLLexer()
Copy link
Collaborator

Choose a reason for hiding this comment

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

📝 I wasn't aware that there is such a place where we can configure how ```<lang> is parsed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Me neither. In general I don't know much abut how Scylla documentation building works.

docs/source/migration-guides/0.15-deserialization.md Outdated Show resolved Hide resolved
docs/source/migration-guides/0.15-deserialization.md Outdated Show resolved Hide resolved
Copy link
Contributor

@muzarski muzarski left a comment

Choose a reason for hiding this comment

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

Mainly some nits. I want to make sure that all removed tests for legacy API have their equivalent for new API (if applicable).

When it comes to the value module. I think that we should definitely make it a top-level module. Notice that deserialization tests are placed in deserialize::value_tests, while serialization tests are in frame::value_tests. So my proposition is to:

  • move value.rs to top-level (src/value.rs)
  • move frame::value_tests.rs to serialize::value_tests.rs

scylla-cql/src/frame/value_tests.rs Outdated Show resolved Hide resolved
scylla-cql/src/frame/value_tests.rs Outdated Show resolved Hide resolved
scylla-cql/src/frame/value_tests.rs Outdated Show resolved Hide resolved
scylla-cql/src/frame/value_tests.rs Show resolved Hide resolved
Comment on lines -996 to -1057
fn struct_from_row_wrong_size() {
#[derive(FromRow, PartialEq, Eq, Debug)]
struct MyRow {
a: i32,
b: Option<String>,
c: Option<Vec<i32>>,
}

let too_short_row = Row {
columns: vec![Some(CqlValue::Int(16)), None],
};

let too_large_row = Row {
columns: vec![
Some(CqlValue::Int(16)),
None,
Some(CqlValue::Set(vec![CqlValue::Int(1), CqlValue::Int(2)])),
Some(CqlValue::Set(vec![CqlValue::Int(1), CqlValue::Int(2)])),
],
};

assert_eq!(
MyRow::from_row(too_short_row),
Err(FromRowError::WrongRowSize {
expected: 3,
actual: 2
})
);

assert_eq!(
MyRow::from_row(too_large_row),
Err(FromRowError::WrongRowSize {
expected: 3,
actual: 4
})
);
}

// Enabling `expect_used` clippy lint,
// validates that `derive(FromRow)` macro definition does do not violates such rule under the hood.
// Could be removed after such rule will be applied for the whole crate.
// <https://rust-lang.github.io/rust-clippy/master/index.html#/expect_used>
#[deny(clippy::expect_used)]
#[test]
fn unnamed_struct_from_row() {
#[derive(FromRow)]
struct MyRow(i32, Option<String>, Option<Vec<i32>>);

let row = Row {
columns: vec![
Some(CqlValue::Int(16)),
None,
Some(CqlValue::Set(vec![CqlValue::Int(1), CqlValue::Int(2)])),
],
};

let my_row: MyRow = MyRow::from_row(row).unwrap();

assert_eq!(my_row.0, 16);
assert_eq!(my_row.1, None);
assert_eq!(my_row.2, Some(vec![1, 2]));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Again - please make sure that analogous tests for new API exist (if applicable for new API).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those tests test old value "deserialization" (converting from CqlValue to other types), and to a lesser degree row deserialization (converting from Row = Vec<Option> to a concrete type).
New API has its own tests, which I believe to be extensive enough. See the scylla-cql/src/deserialize/value_tests.rs and scylla-cql/src/deserialize/row_tests.rs

Copy link
Contributor

@muzarski muzarski Jan 30, 2025

Choose a reason for hiding this comment

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

Ok, that's good enough. BTW, do we support structs with unnamed fields for DeserializeRow? I remember implementing that for FromRow : #985. I'm asking since unnamed_struct_from_row test checked that it works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have no idea. @wprzytula ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, there's no support for them. See respective TODO.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Those tests test old value "deserialization" (converting from CqlValue to other types), and to a lesser degree row deserialization (converting from Row = Vec to a concrete type).

I believe that conversion of CqlValue into end types (using getters, e.g. as_bigint()) should be still well-tested, too, as it's a valid use case for, e.g., JS Driver. Is it already tested somewhere else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In serialize::value module there are some tests for CqlValue serialization, but I don't see tests for as_ method. I bielieve it is out of scope for this PR, so I'll open an issue about this.

@Lorak-mmk
Copy link
Collaborator Author

Lorak-mmk commented Jan 30, 2025

Still need to move value and value_tests module.

@Lorak-mmk
Copy link
Collaborator Author

Extracted value.rs and value_tests.rs from frame module.

Note: this was not a force push, only new commits were added, so there is no need to re-review previous commits if you already reviewed them.

Copy link
Contributor

@muzarski muzarski left a comment

Choose a reason for hiding this comment

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

Docs need to be adjusted as well

@Lorak-mmk
Copy link
Collaborator Author

Lorak-mmk commented Jan 31, 2025

no item named response in module scylla_cql

???!!!!!!

Comment on lines 153 to 155
// rustfmt wants to have each tuple inside a tuple in a separate line
// so we end up with 170 lines of tuples
// FIXME: Is there some cargo fmt flag to fix this?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm perfectly OK with such formatting. This makes the tuples more readable for me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did not write this comment, it was just part of the moved code. I dislike the formatting a bit, but no matter if we want to change it or not I think it is out of scope for this PR.

scylla-cql/src/serialize/row_tests.rs Outdated Show resolved Hide resolved
scylla-cql/src/serialize/value_tests.rs Outdated Show resolved Hide resolved
@muzarski
Copy link
Contributor

muzarski commented Feb 3, 2025

no item named response in module scylla_cql

???!!!!!!

This is because of docstrings to CqlDecimal and CqlVarint: "e.g. conversion from CqlValue". which are placed in value.rs. The link to CqlValue got broken, since we moved value module - due to the usage of relative path (super::*). This could probably be adjusted to (crate::*), so no similar issues appear in the future.

@Lorak-mmk
Copy link
Collaborator Author

no item named response in module scylla_cql

???!!!!!!

This is because of docstrings to CqlDecimal and CqlVarint: "e.g. conversion from CqlValue". which are placed in value.rs. The link to CqlValue got broken, since we moved value module - due to the usage of relative path (super::*). This could probably be adjusted to (crate::*), so no similar issues appear in the future.

Yep, I understood that a bit after posting my comment, I just didn't have time to fix the PR yey.

Lorak-mmk and others added 4 commits February 3, 2025 18:41
@Lorak-mmk
Copy link
Collaborator Author

One last thing we have to think about before 1.0 in this area: maybe CqlValue also should be moved to the new scylla_cal::values module? If so, that should be done in a follow-up PR.

Now that I think of it I might as well do it here.
Why? I noticed that frame/result.rs contains value deserialization tests, which should be moved to deserialize module - similarly to what I did with value_tests.rs and serialize module.
@wprzytula @muzarski please confirm that scylla-cql/src/value.rs is an appropriate new home for CqlValue.

@muzarski
Copy link
Contributor

muzarski commented Feb 3, 2025

One last thing we have to think about before 1.0 in this area: maybe CqlValue also should be moved to the new scylla_cal::values module? If so, that should be done in a follow-up PR.

Now that I think of it I might as well do it here. Why? I noticed that frame/result.rs contains value deserialization tests, which should be moved to deserialize module - similarly to what I did with value_tests.rs and serialize module. @wprzytula @muzarski please confirm that scylla-cql/src/value.rs is an appropriate new home for CqlValue.

value.rs contains serializable/deserializable value types introduced in the driver (e.g. CqlVarint). It makes perfect sense to put CqlValue there as well.

@Lorak-mmk
Copy link
Collaborator Author

Ok this PR is now +6k lines -11k lines and 37 commits. This is a signal that it got too big and should be split.
I'll leave this PR with the changes that remove old frameworks, and put all the resulting scylla_cql cleanups in a new PR.

@Lorak-mmk
Copy link
Collaborator Author

Removed cleanup commits. Now this PR contains only the API removal.
I'll soon open new PR with the cleanups.

@Lorak-mmk
Copy link
Collaborator Author

Opened #1198

Comment on lines +557 to 559
pub async fn build(&self) -> Result<Session, NewSessionError> {
Session::connect(self.config.clone()).await
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

📌 Why is build borrowing instead of consuming the SessionBuilder? This makes no sense, as SessionBuilder implements Clone, so it could always be cloned before building to retain it. Now there is needless cloning for the usual case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can change that in the follow-up in order to not expand the scope of this PR

@wprzytula wprzytula merged commit e66f2e3 into scylladb:main Feb 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-checks-breaking cargo-semver-checks reports that this PR introduces breaking API changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants