Skip to content
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

Simple file import #564

Merged
merged 14 commits into from
May 21, 2024
Merged

Simple file import #564

merged 14 commits into from
May 21, 2024

Conversation

georg-schwarz
Copy link
Member

@georg-schwarz georg-schwarz commented May 14, 2024

Partially addresses #563: Introduces use functionality with wildcards to load elements from other files.

  • wildcard use use * from "relative/path/file.jv"
  • validation to ensure used files exist
  • rename the use property of block type TableTransformer to uses, otherwise the new keyword use would be ambiguous
  • for this PR, export all reusable root-level elements in a file besides pipelines
  • when using the interpreter cli, always load the whole directory of the jv file into the workspace (so they can be used)
  • For testing, introduce a helper function, parseTestFileInWorkingDir that allows loading the test files with their working directory instead of only reading the single file. This is a competing test setup with the used parseHelper function. We should discuss whether we need two separate test setups or if this one should be applied everywhere.

Future Work

I tried to keep the PR short, so here an outlook of what's next

I see the follow-up tasks before tackling further import features:

  • Auto-completion for file paths
  • Rework of the test setup (as mentioned above)
  • Check whether the import influences auto-completion functionality in general

I see the next import features to be:

  • Explicitly publish elements instead of publishing all
  • Explicitly use elements instead of using a wildcard

@georg-schwarz
Copy link
Member Author

georg-schwarz commented May 14, 2024

@rhazn @joluj I'd like to tackle this PR in a test-driven manner. I added all test scenarios that came to my mind in 9637146. Feedback on them is already very welcome ;-)

Edit: removed them from this PR in a566bc4 as I want to keep the PR short.

@georg-schwarz georg-schwarz marked this pull request as ready for review May 15, 2024 14:35
@georg-schwarz georg-schwarz requested a review from rhazn May 15, 2024 14:39
Copy link
Contributor

@joluj joluj left a comment

Choose a reason for hiding this comment

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

Looks good.

A test for transitive imports would be nice (A imports B, B imports C; Assert that A can use stuff from B).

@georg-schwarz georg-schwarz requested a review from joluj May 17, 2024 09:49
Copy link
Contributor

@rhazn rhazn left a comment

Choose a reason for hiding this comment

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

Amazing. 👍

@georg-schwarz georg-schwarz merged commit 84d9503 into main May 21, 2024
3 checks passed
@georg-schwarz georg-schwarz deleted the simple-file-import branch May 21, 2024 13:32
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2024
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