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

Add deleteIrCache #12161

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Add deleteIrCache #12161

wants to merge 2 commits into from

Conversation

AdRiley
Copy link
Member

@AdRiley AdRiley commented Jan 27, 2025

Pull Request Description

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@AdRiley AdRiley added the CI: No changelog needed Do not require a changelog entry for this PR. label Jan 27, 2025
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

How do you want to write a test for this functionality? E.g. how do you know you are deleting the right caches?

irCacheDirectory.getChild(ensoVersion)

It is not easy (for me) to navigate thru the code that finds the right location for a cache. However it should be somewhere around the above line.

Because the code is so convoluted, shouldn't the cleanup be part of it?

Shouldn't the --ir-caching... options be somehow simplified? Merged into a single option? --ir-cache=clean, --ir-cache=off, etc.?

def getDataDirectory(): String = {
val osName = System.getProperty("os.name").toLowerCase(java.util.Locale.ENGLISH)
val homeDir = System.getProperty("user.home")
val dataDirectory = sys.env.get("ENSO_DATA_DIRECTORY").orElse {
Copy link
Member

Choose a reason for hiding this comment

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

To avoid hardcoding these paths, I suggest to put the cleanup code into engine/runner itself. It knows exactly where the caches are and we avoid duplication of this find caches logic.

@enso-bot enso-bot bot mentioned this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants