padreati / rapaio-jupyter-kernel

Java jupyter kernel
MIT License
53 stars 7 forks source link

bug: Context should be altered via ContextOverrides #70

Closed cstamas closed 2 months ago

cstamas commented 2 months ago

What you do here is wrong: https://github.com/padreati/rapaio-jupyter-kernel/blob/main/src/main/java/org/rapaio/jupyter/kernel/core/magic/dependencies/MimaDependencyManager.java#L66

(but works still, but would not in a moment you'd use Repo authentication etc). Context "processes" repositories that are coming in via overrides.

Instead, you want to add all repositories to ContextOverrides and create it as such.

Effectively, you don't need Context for lifespan of MimaDependencyManager, just keep (and mutate) ContextOverride.

In method resolve() perform all the ops within try-with-resource with freshly created Context, and it is closeable, and Resolver 2.x WILL require you to close it.