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

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

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.

Considerations

value module

This module in scylla_cql is placed in frame module and contained multiple things:

  1. Old serialization APIs (Value and ValueList traits and their implementations)
  2. Our ser/deser related types like CqlValue, CqlTimeuuid etc

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?

Session

I removed LegacySession, and de-genericized Session, making it a simple struct again.
However I did not inline the methods implementations (like inlining do_batch into batch).
Those inlines should probably happen at some point, but it is not a blocker for 1.0 so I left it for now.
I performed de-genericization because it is a breaking change and thus a blocker for 1.0

Ser / deser tests

Those are all over scylla_cql crate. We should think about the structure for those and move them into a reasonable place.
I left it for another time because this does not affect the API

Fixes: #1167

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: e894b24

See the following report for details:

cargo semver-checks output
./scripts/semver-checks.sh --baseline-rev 448502ca1db6228ab3d1d6108db78664e1dfddb6
+ cargo semver-checks -p scylla -p scylla-cql --baseline-rev 448502ca1db6228ab3d1d6108db78664e1dfddb6
     Cloning 448502ca1db6228ab3d1d6108db78664e1dfddb6
    Building scylla v0.15.0 (current)
       Built [  22.792s] (current)
     Parsing scylla v0.15.0 (current)
      Parsed [   0.047s] (current)
    Building scylla v0.15.0 (baseline)
       Built [  23.447s] (baseline)
     Parsing scylla v0.15.0 (baseline)
      Parsed [   0.047s] (baseline)
    Checking scylla v0.15.0 -> v0.15.0 (no change)
     Checked [   0.121s] 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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/session.rs:83
  enum scylla::client::session::LegacyDeserializationApi, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/session.rs:91
  enum scylla::response::legacy_query_result::MaybeFirstRowTypedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:263
  enum scylla::response::legacy_query_result::SingleRowTypedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:203
  enum scylla::client::pager::LegacyNextRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/pager.rs:1177
  enum scylla::response::legacy_query_result::FirstRowError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:305

--- 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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/errors.rs:131
  variant BadQuery::SerializeValuesError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/errors.rs:485

--- 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:
  GenericSessionBuilder::build_legacy, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/session_builder.rs:568
  QueryPager::into_legacy, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/pager.rs:681
  QueryResult::into_legacy_result, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/pager.rs:1152
  struct scylla::client::caching_session::GenericCachingSession, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/caching_session.rs:43
  struct scylla::client::session::TypedRowIter, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:40
  struct scylla::response::legacy_query_result::RowsNotExpectedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:246
  struct scylla::response::legacy_query_result::LegacyQueryResult, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/pager.rs:1099
  struct scylla::response::legacy_query_result::RowsExpectedError, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:233

--- 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::DeserializationApiKind, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/client/session.rs:81
  trait scylla::client::session::IntoTypedRows, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla/src/response/legacy_query_result.rs:19

     Summary semver requires new major version: 6 major and 0 minor checks failed
    Finished [  47.412s] scylla
    Building scylla-cql v0.4.0 (current)
       Built [  11.282s] (current)
     Parsing scylla-cql v0.4.0 (current)
      Parsed [   0.026s] (current)
    Building scylla-cql v0.4.0 (baseline)
       Built [  11.280s] (baseline)
     Parsing scylla-cql v0.4.0 (baseline)
      Parsed [   0.035s] (baseline)
    Checking scylla-cql v0.4.0 -> v0.4.0 (no change)
     Checked [   0.124s] 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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/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-448502ca1db6228ab3d1d6108db78664e1dfddb6/65b2eff398a4ccb7c9c581eed694c6b5b77c88c7/scylla-cql/src/frame/value.rs:805

     Summary semver requires new major version: 7 major and 0 minor checks failed
    Finished [  23.461s] 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
This error is not deprecated, this directive is clearly a leftover or
mistake. It is probably caused by some merge, because I was not able
to find the commit that caused this.
It was a leftover from the PR that migrated this test to new APIs.
It is no longer necessary after the PR that refactored this error.
@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 ?

@Lorak-mmk
Copy link
Collaborator Author

Lorak-mmk commented Jan 30, 2025

Still need to move value and value_tests module.

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.

Remove legacy serialization and deserialization frameworks
3 participants