-
Notifications
You must be signed in to change notification settings - Fork 112
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
Hygiene fixes for ser / deser macros #1176
Open
Lorak-mmk
wants to merge
18
commits into
scylladb:main
Choose a base branch
from
Lorak-mmk:migrate-higiene-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+443
−218
Conversation
This file contains 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
It contains only 2 submodules: serialize and deserialize. In order to synchronize the paths of those modules with the scylla crate, the types module is made private, and its submodules are re-exported. fixup
This is required in order to get rid of types module.
Those are virtually top-level modules after previous commits, because they are re-exported that way in lib.rs. The only thing needed is to physically move the files.
It is now empty, so can be safely removed.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Macros need to use fully qualified paths in order to maintain hygiene.
Those constructors are needed for users that want to utilize our type ser / deser functionality more directly.
There is no need to create whole PreparedMetadata in order to create RowSerializationContext.
New version of the test verifies ser / deser identity for both row and value macros.
This test was checking only the most basic scenario: a structure that is serialized / deserialized by name matching, and has no field attributes. Adding more advanced scenarios uncovered many hygiene issues in the macros - those issues were fixed in previous commits.
github-actions
bot
added
the
semver-checks-breaking
cargo-semver-checks reports that this PR introduces breaking API changes
label
Jan 22, 2025
See the following report for details: cargo semver-checks output
|
What is this failure in min_rust, why would Rust version have any impact here ?!! |
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
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.
Removing old serialization / deserialization APIs requires migrating the hygiene integration test - this is one of very few places that still uses old APIs.
This makes such migration a prerequisite for #1167
While migrating the test I found that our new macros actually have many problems with hygiene. Who could expect that if we don't test something then it won't work...
Apart from hygiene fixes in macros one more change was required: moving
types/serialize
andtypes/deserialize
modules inscylla_cql
to, respectively,serialize
anddeserialize
.In other words, inlining
types
module. Why is it required? The tests assume that required traits are exposed under the same paths inscylla
andscylla_cql
, and the ability to make suchassumption is present in the documentation of the macros.
This PR fixes all the hygiene problems that I found, inlines
types
module, and migrates the hygiene test to new APIs.Apart from that I significantly extended the test. Before it tested only most basic scenario, but our new macros have many variants and possible field attributes.
Doing this proved to be good idea, because I found and fixed even more issues in macros.
Ref: #1167
Pre-review checklist
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.