-
Notifications
You must be signed in to change notification settings - Fork 126
Feature/new uast serialization #453
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
Feature/new uast serialization #453
Conversation
I think given this is a v0 we could actually break compatibility and just enable this mode. WDYT @ajnavarro? |
@erizocosmico yep, the idea is to use this new format as default, but provide a way to make it work with dependant applications providing the flag (the flag will be removed in next versions). |
cmd/gitbase/command/server.go
Outdated
@@ -56,6 +56,7 @@ type Server struct { | |||
DisableGit bool `long:"no-git" description:"disable the load of git standard repositories."` | |||
DisableSiva bool `long:"no-siva" description:"disable the load of siva files."` | |||
Verbose bool `short:"v" description:"Activates the verbose mode"` | |||
AltUast bool `long:"alt-uast-serialization" description:"serialize uast in a new format" env:"GITBASE_UAST_SERIALIZATION"` |
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.
could you change the flag to do the opposite? it should active old serialization format.
Signed-off-by: Manuel Carmona <[email protected]>
…old way Signed-off-by: Manuel Carmona <[email protected]>
ffe1c04
to
d14a4bf
Compare
Thank you for kind notice @ajnavarro! @carlosms thank you for taking care of it |
Instead of serialize UASTs as a JSON array of marshaled UAST nodes encoded as base64, now the list of nodes are serialized as a sequence of marshaled nodes preceded by their lengths, it is:
The node size is being encoded as an int32 in big endian to make it directly readable from the JVM just in case we will need manage it from spark. If you think there are better options just let me know and I'll change it.
Also, there is a new flag in the cli
--old-uast-serialization
and an environment variableGITBASE_UAST_SERIALIZATION
to choose if this mode or the old one. This way, we don't brake compatibility for the moment.