-
Notifications
You must be signed in to change notification settings - Fork 198
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
Support custom derives on Request and Response #438
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Not sure if I did the CI modification correctly, please take a look. |
Addresses #436 |
Looks like one thing I still need to iron out (besides the CLA 😬) is the situation where |
Oh, this is what I meant to address by my 4th bullet of #436 (comment): only implicitly derive serialize when |
Gotcha, will work on it. |
3b9a323
to
cbf401b
Compare
Should be good now, I think I incorrectly updated the CI file though. Either way, do we wanna bikeshed the name a bit? Is |
cbf401b
to
4c3e973
Compare
Cleaned up the implementation a bit. |
4c3e973
to
5c1d3a0
Compare
Added some docs and should fix CI 🤞 |
tests-build/Cargo.toml
Outdated
@@ -0,0 +1,13 @@ | |||
[package] | |||
name = "tests-build" |
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.
Instead of adding this package, could the tests go in the existing tarpc/tests/compile_fail?
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.
Ah, assumed trybuild
tests would be in the plugins crate, my bad. Yes, I believe they can go there.
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.
Done!
e72eb0e
to
2d88b44
Compare
.github/workflows/main.yml
Outdated
${{ matrix.serde }} ${{ matrix.tokio }} ${{ matrix.serde-transport }} \ | ||
${{ matrix.serde-transport-json }} ${{ matrix.serde-transport-bincode }} \ | ||
${{ matrix.tcp }} ${{ matrix.unix }} \ | ||
cargo test --manifest-path tests-build/Cargo.toml $ {{ matrix.serde }} |
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.
this isn't needed now, right?
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.
Yup, will remove.
2d88b44
to
3d9c836
Compare
I think it's that the test matrix in CI is enabling features that bring in dependencies that provide a serialize method under a trait. Because of that, the compiler is suggesting more items, causing the output to be different. I could re-generate the stderr files with all feature enabled, but I'm not sure if that would cause CI to fail in a different spot when it toggles the feature off. I think I'll try refactoring the test to use fully qualified syntax to the serialize method so that the error message is not ambiguous. |
3d9c836
to
11c316c
Compare
That should fix it, I'm a little worried about how brittle these tests are though. Let me know if you think they're more trouble than they're worth. |
Oh looks like the CLA hasn't been signed, either? Is that something you can take a look at? |
Yeah, legal is looking at it. Should just be due diligence and not a problem. |
Forgot to overwrite the .stderr files 🤦 |
11c316c
to
3fd869c
Compare
Green! |
Re: CLA, the legal team is either at a conference or out sick, so it might be a few more days. |
Approved, just waiting for wheels to turn. |
Should be good to re-run the pipeline! |
Replace the bespoke "derive_serde" with a more flexible "derive = [<path>, <path>, ...]" form. Deprecate the old "derive_serde" form, and emit deprecation warnings.
3fd869c
to
3284220
Compare
Thanks a lot! This is a great generalization. |
Replace the bespoke "derive_serde" with a more flexible "derive = [, , ...]" form.
Deprecate the old "derive_serde" form, and emit deprecation warnings.
Add trybuild tests in a separate test crate to ensure the deprecation, features, and error messages all behave as expected. This technique of a separate trybuild test crate is borrowed from tokio/tests-build. Update CI to run this new crate's tests under the serde matrix.