-
Notifications
You must be signed in to change notification settings - Fork 153
Expose serialization issue with a test #1092
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
Conversation
Co-authored-by: Ben Langfeld <blangfeld@powerhrg.com>
That's weird. We're using |
|
Hum, clearly it's failing on CI, but locally it's fine for me: (I should work on 2.7 compat though). 🤔 |
|
@casperisfine You ran the one that is also passing in CI, and exists to demonstrate that the issue is not in the commit serializer itself, but in the relationship between the deployment serializer and the commit serializer. |
|
@casperisfine the commit serializer test will work in either version. The problem is with the deploy serializer. Sorry I forgot to mention, but what I tried to show is that when the commit is serialized as part of the deploy, the author is not present. But when you serialize a commit directly, it works as expected. Can you try running |
🤦 sorry. The other test indeed fail. I'm gonna dig down then. |
|
Ok, so I can repro on 2.7.1 and it does pass on 2.6.5. However I can make it fail with I'll keep digging. |
Do you have a preferred approach for a replacement @casperisfine ? |
|
Oh I know what it is! I had to fix that very same bug in shopify core a while ago. The Ruby's class lookup semantic change sligthy in 2.7 and it was somehow backported to 2.6.6. I know the workaround I'll push a fix soon.
Not really, most alternative I've seen are rather crap. The only one that looks ok is https://github.com/codenoble/cache-crispies. I meant to try it sees if it's as good as it looks, but never really got around to do it. |
|
I was looking into https://github.com/cerebris/jsonapi-resources which has a similar enough API and wouldn't require a lot of changes on the serializers that currently exists. Any thoughts @casperisfine ? |
|
Fixed as db85dce |
I'd need to audit it. The thing is there are dozens and dozens of libraries like this, and they are often opinionated in a way that doesn't fit my needs, or have absolutely terrible implementations. |
|
Ok, so |
|
Would be nice to know what the plan is, so in case we have to make some changes we don't diverge too much from it. Btw, thanks a lot for the help @casperisfine . Really appreciated. |
Long story short is that we're stuck on an old version of AMS because 0.10.x radically changed direction, it's no longer providing the feature shipit needs, and require to rewrite all serializers anyway. And it's not particularly well written. Once in a while running such an old gem cause some friction but so far we managed. So the plan is to some day™ migrate to another gem, with no change in the serialization format (no API breakage for users), and if possible little change to the serializers. That why I meant to look at cache-crispies. But really this is never urgent enough for me to prioritize. I guess I just need to do it even though there's no urgency. For you it shouldn't change anything, unless you have private extensions that rely on BTW the |
The concern @viniciusgama expressed is that while we have the capacity to contribute things like this, we need to be aligned so as not to waste our time going in the wrong direction. If you have a route you know you want to take but just can't get to it, then we can work with that and combine availability. |
Sure. Well as a general rule I'm always happy to delegate/merge some features etc. In this case it's a matter of architecture / foundations, that's not something I generally delegate. So really don't be concerned with this, I'll get around to do it eventually, in the meantime it's not really a big problem. It's not like we're actively spending hundreds of man hours maintaining the serializers, and porting them to another library is a matter of a few hours. The hard part is to select a library that doesn't suck, and that's on me. |
|
So in the end I'm likely to go with The API is extremely similar to AMS 0.9 which makes the migration very easy. |
It seems ruby 2.6.6 and 2.7.1 patch versions have broken the deploy object serialization. We have our IM system listening to deploy events and notifying users and rooms of the status of their deployments. The deploy payload used to have the entire
authorin thecommitsthat were deployed. While using these 2 versions the author object is now replaced by only theauthor_idand this broke our integration.While doing some investigation we found out this change was the patch applied that generated both versions we have problems with and coincidentally they are related to JSON serialization.
For this PR I just wrote a simple tests so we could expose the issue. The idea is to see if anyone else have run into this problem and also look from guidance from the main maintainers.