Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Migrate to SDK.v3 - protocol.v2 with decode #84

Merged
merged 13 commits into from
Jun 3, 2019

Conversation

bzz
Copy link
Contributor

@bzz bzz commented May 28, 2019

Partially addresses #83

  • new API is under org.bblfsh.client.v2
  • new SDK and libraste is used
  • decode() and root() are implemented
  • add CI profile only with things that are expected to pass at current stage
  • add 2 TODOs base on feedback
  • enable test for the latest bblfshd/sdk release
  • fix CI v2 profile
    Right now failing with java.lang.IllegalStateException: Linux build failed -> fatal error: libuast.h: No such file or directory
  • API visibility in native lib
  • A bit improved tests of .decode()
    As C++ API does not expose .Kind() for nodes, this can be done later, after .load() is implemented.

Main CI is expected to fail due to still missing native API that will be added in separate PRs.

bzz added 3 commits May 25, 2019 05:44
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz bzz self-assigned this May 28, 2019
Many tests are Ignored or are expected to fail,
due to rest of the native API not implemented yet.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Copy link
Member

@dennwc dennwc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round is done! I don't understand most of the JNI code, but at least the Scala code is clear. Not marked as approved because there are still few changes needed (like mentioned in the FIXME).

build.sbt Outdated Show resolved Hide resolved
build.sbt Outdated Show resolved Hide resolved
Copy link
Contributor

@creachadair creachadair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments in passing.

build.sbt Outdated Show resolved Hide resolved
src/main/native/jni_handle.h Outdated Show resolved Hide resolved
src/main/native/org_bblfsh_client_v2_libuast_Libuast.cc Outdated Show resolved Hide resolved
src/main/scala/org/bblfsh/client/v2/BblfshClient.scala Outdated Show resolved Hide resolved
@creachadair
Copy link
Contributor

First round is done! I don't understand most of the JNI code, but at least the Scala code is clear. Not marked as approved because there are still few changes needed (like mentioned in the FIXME).

It's funny, because I was just feeling much more comfortable with the C++ portion. Which I suppose says something about my poor life-choices. 😀

@bzz bzz mentioned this pull request May 29, 2019
17 tasks
bzz added 4 commits May 29, 2019 16:03
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
It also adds a temp job that will be kept updated and
is expected to pass for bblfsh#83
and track it's progress.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented May 29, 2019

CI is expected to have 1 profile that is passing now. Initial feedback addressed.

2 things that are left as are waiting for the feedback:

  • API visibility improvement on the native part
  • a bit more sophisticated tests for decode()

And a CI fix for fatal error: libuast.h: No such file or directory. PR description updated to include those.

@bzz bzz force-pushed the migrate-to-sdk-v3 branch 9 times, most recently from 64f96a5 to 18a67bc Compare May 31, 2019 08:54
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
bzz added 2 commits May 31, 2019 17:32
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz bzz force-pushed the migrate-to-sdk-v3 branch 13 times, most recently from 9a7ff1f to bde14f9 Compare June 3, 2019 14:19
Only tests that are passing on V2 are currently
enabled for every PR.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Jun 3, 2019

@creachadair @dennwc all feedback was addressed, CI v2-enabled profile is green and it's ready to :shipit:

Copy link
Contributor

@creachadair creachadair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions left.

.clang-format Outdated Show resolved Hide resolved
object BblfshClient {
val DEFAULT_MAX_MSG_SIZE = 100 * 1024 * 1024 // bytes

val PreOrder = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't seem to be used anywhere—are they mean to support the iterator implementation that is coming later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly - this is part of the old code that was moved forward and going to be used for iterator implementation.

extern const char *CLS_CTX;

JNIEnv *getJNIEnv();
jobject NewJavaObject(JNIEnv *, const char *, const char *, ...);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow the naming convention in use here. Google style is MixedCaseLeadingCaps for classes and functions (with a carve-out for class accessors to follow snake_case style). But we seem to be mixing that and conventional camel.

(I'm not wedded to Google style, I only mentioned that because you included a clang-format config based on that style)

Copy link
Contributor Author

@bzz bzz Jun 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old code, I belive it follow the same that was used in libuast.
TBH Google one from above was just placed randomly, to have at least something, and mostly because of 2-space indentation.

I'm not settled on this one either, but I think it's totally fine to use almost whatever in a the well-localized JNI wrappers themselves.

Will be happy to refactor it, if needed, and add a better formatter config to all the projects later on, as soon as we have something functional in scala-client. For now, I'm mostly not very worried about it because of the limited scope and no expectations for this native piece to grow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this doesn't need to be addressed right now, I just wanted to make a note of it while we're paying attention to this code. 🙂

build.sbt Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
This was referenced Jun 3, 2019
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Jun 3, 2019

Just a few questions left.

@creachadair I tried to answer all of those and address the feedback, let me know what you think!
And it's ready for another round.

@bzz bzz merged commit bc7f973 into bblfsh:master Jun 3, 2019
@bzz bzz deleted the migrate-to-sdk-v3 branch June 3, 2019 20:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants