Skip to content

feat: Add JSONNET_PATH support for cli#616

Open
He-Pin wants to merge 1 commit intodatabricks:masterfrom
He-Pin:jsonnet-path
Open

feat: Add JSONNET_PATH support for cli#616
He-Pin wants to merge 1 commit intodatabricks:masterfrom
He-Pin:jsonnet-path

Conversation

@He-Pin
Copy link
Contributor

@He-Pin He-Pin commented Feb 28, 2026

refs: #608

@tmeijn would you like to test this locally?

Copilot AI review requested due to automatic review settings February 28, 2026 09:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for resolving Jsonnet imports via the JSONNET_PATH environment variable in the CLI/runtime, aligning sjsonnet behavior with other Jsonnet implementations and addressing issue #608.

Changes:

  • Extend Config to parse JSONNET_PATH and combine it with --jpath/-J values (including --reverse-jpaths-priority behavior for -J only).
  • Thread an optional jsonnetPathEnv override into SjsonnetMainBase.main0 for testability and wire it into importer search roots.
  • Add JVM and JVM-native tests covering JSONNET_PATH parsing and precedence vs -J.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sjsonnet/test/src-jvm/sjsonnet/MainTests.scala Adds integration tests for JSONNET_PATH import resolution and introduces an env-injecting test helper.
sjsonnet/test/src-jvm/sjsonnet/Example.java Updates Java example invocation to match the new main0 signature.
sjsonnet/test/src-jvm-native/sjsonnet/ConfigTests.scala Adds unit tests for JSONNET_PATH parsing and combined jpath ordering logic.
sjsonnet/src-jvm-native/sjsonnet/SjsonnetMainBase.scala Adds jsonnetPathEnv plumbing and updates CLI/help text handling.
sjsonnet/src-jvm-native/sjsonnet/Config.scala Implements JSONNET_PATH parsing and merges it into ordered import search paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tmeijn
Copy link

tmeijn commented Feb 28, 2026

Hey @He-Pin just want to clarify: are you asking me to test this branch before you merge this PR or was it more an open invitation?

If it's the former: I can do that, but I know nothing of Scala or how to build the native binary. I also could not find any repo docs on how to create a build.

I just used mise to give this a try.

Thank you for working on this and quick response! 🙏🏾.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants