yetanalytics / lrs

Protocols, specifications, and logic for building an xAPI Learning Record Store (LRS) in Clojure(Script).
https://www.yetanalytics.com/lrs
Apache License 2.0
4 stars 1 forks source link

Clean Up Reflection Warnings #48

Closed milt closed 3 years ago

milt commented 3 years ago

Per discussion on other PRs with @kelvinqian00 , lrs should not make decisions like the setting of the global var *warn-on-reflection* for implementers. There are situations where reflection might be needed, and the option to suppress the warnings without the need for careful require order is a must.

Remove all the direct sets for it and see if it can be put into user.clj or some similar. With deps + cli it is actually hard to do this in a way that works for everyone's repl. Adding it to the init namespaces of the in-memory dev LRS (and keeping it in bench) will have to do for now.

milt commented 3 years ago

Upstream warnings that will remain until we update pedestal and a few other bits:

Reflection warning, io/pedestal/log.clj:686:26 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:688:16 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:692:20 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:695:20 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:735:17 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:737:17 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:740:19 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:742:19 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:772:21 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:774:21 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:798:19 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:800:26 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:801:36 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/log.clj:802:43 - reference to field span on io.opentracing.Scope can't be resolved.
Reflection warning, io/pedestal/http/route.clj:67:3 - call to static method decode on java.net.URLDecoder can't be resolved (argument types: unknown, java.lang.String).
Reflection warning, io/pedestal/http/route.clj:73:3 - call to static method encode on java.net.URLEncoder can't be resolved (argument types: unknown, java.lang.String).
Reflection warning, ring/util/codec.clj:95:5 - call to static method encode on java.net.URLEncoder can't be resolved (argument types: java.lang.String, unknown).
Reflection warning, ring/util/codec.clj:130:6 - call to static method decode on java.net.URLDecoder can't be resolved (argument types: java.lang.String, unknown).
Reflection warning, crypto/random.clj:28:12 - call to static method encodeHex on org.apache.commons.codec.binary.Hex can't be resolved (argument types: unknown).
Reflection warning, crypto/random.clj:28:3 - call to java.lang.String ctor can't be resolved.
Reflection warning, hiccup/util.clj:78:19 - call to static method encode on java.net.URLEncoder can't be resolved (argument types: java.lang.String, unknown).
Reflection warning, io/pedestal/http/jetty.clj:106:22 - call to org.eclipse.jetty.server.ServerConnector ctor can't be resolved.
Reflection warning, io/pedestal/http/jetty.clj:183:32 - call to org.eclipse.jetty.server.ServerConnector ctor can't be resolved.
Reflection warning, io/pedestal/http/jetty.clj:189:31 - call to org.eclipse.jetty.server.ServerConnector ctor can't be resolved.
kelvinqian00 commented 3 years ago

You still have a (set! *warn-on-reflection* true) line in bench.clj. Is that intentional?

milt commented 3 years ago

Yep, it's on a dev path so I leave it alone.

milt commented 3 years ago

Retry of failed build: https://us-east-1.console.aws.amazon.com/codesuite/codebuild/376099832799/projects/lrs/build/lrs%3A53453c62-5b42-4581-a7cb-9cf554198a8c/?region=us-east-1

milt commented 3 years ago

Dunno why I thought CI was still failing (which is why I haven't approved it yet) but here you go!

As of the master merge 5 days ago, it's passing CI, am I missing something? There was actually a change merged in that improved the reliability of the conformance tests a good deal and this was an intermittent error, so I think it's good to go now.

kelvinqian00 commented 3 years ago

Since you mentioned that, I ran the conformance tests in lrsql and they work, so that's good.