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

Serialize Deltas and BrokenUses #23

Open
KarinaMankevic opened this issue Jan 14, 2022 · 3 comments
Open

Serialize Deltas and BrokenUses #23

KarinaMankevic opened this issue Jan 14, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@KarinaMankevic
Copy link

What I would like to have:
Store Deltas and BrokenUses on disk (in the project), such that they can be reused later.

Why I need it:
My project relies on Maracas for computing API deltas and detecting broken uses on clients depending on these APIs. I analyze many cases, which means that I may encounter different clients that depend on the same API library, and where the Delta can be reused. Of course, Delta can be reused if it was stored previously. It saves some computational work.

Besides, having serialization (and storing) for broken uses is also handy in order to help generating a broken uses dataset.

How is it supposed to work?
When Delta is computed, store it in a format that can be reused later. Make this delta distinguishable by name.
Similar for Broken Uses.

@tdegueul
Copy link
Collaborator

Hi @KarinaMankevic, thanks for the issue!

This feature would make a lot of sense indeed. At first glance, it seems a bit tricky to implement as deltas and broken uses directly reference the library's and clients' ASTs, so the ASTs would probably have to be serialized too—in which case serialization/deserialization would likely take at least as much time as just re-computing the whole thing. There's probably some ways to address this issue, we'll look into it and get back to you asap.

@tdegueul tdegueul added the enhancement New feature or request label Jan 17, 2022
@tdegueul
Copy link
Collaborator

tdegueul commented Feb 1, 2022

Okay, I gave it a try and I'm encountering the issues listed above. Due to the way breaking changes and broken uses are implemented, they cannot be easily serialized without serializing the ASTs with them (or without re-computing the ASTs every time). So basically, serialization does not provide any benefit and re-computing deltas is the way to go. Of course, you can still store deltas in your own HashMap or whatever data structure to reuse them later with other clients without having to serialize them to disk!

On a side note, it would still be useful to serialize deltas and broken uses as JSON files (not the complete deltas that can be used to analyze clients, but a degraded version that would just list all breaking changes, their location, the impacted clients, etc.). This shouldn't be too hard to implement, so let's see.

@KarinaMankevic
Copy link
Author

I agree with your proposal to implement serializing deltas and broken uses to JSON files. For the project I am working on especially broken uses would be useful to have as one of the results of my analysis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants