Skip to content

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Sep 11, 2025

Pull Request Description

close #13891
close #14006
followup #13832

PR adds the rest of the project management functionality to the dashboard.

Changelog:

  • add: remaining project manager methods:
    • project/open
    • project/close
    • project/delete
    • project/duplicate
    • project/rename
  • add: dependency to npm trash package to delete the projects into the system trash bin
  • add: ProjectService.test.ts test suite checking the project management logic
  • update: initialize the project manager WebSocket connection lazily. Since all the logic is implemented in the dashboard, we only need the connection if the enableProjectService feature flag is disabled

Important Notes

How to enable the new dashboard project management

Dev Mode

Run the dev server as usual (you can skip the rest if you only develop gui)

corepack pnpm compile
corepack pnpm run dev:gui

Locate enso executable

The dev:gui script looks into the built-distribution/ directory for an enso executable (enso.exe or enso.bat on Windows). This way it will automatically pick up the dev enso version built with sbt buildEngineDistribution

app/gui dev:vite: Found enso executable: /home/dbushev/projects/luna/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso

if nothing was found, the script will download the latest nightly

app/gui dev:vite: Downloading latest Enso engine (prerelease)...
app/gui dev:vite: Downloading enso-engine-2025.3.1-nightly.2025.9.19-linux-amd64.tar.gz...
app/gui dev:vite: Extracting to /home/dbushev/projects/luna/enso/built-distribution/enso-engine-2025.3.1-nightly.2025.9.19-linux-amd64...
app/gui dev:vite: Enso engine downloaded and extracted to /home/dbushev/projects/luna/enso/built-distribution/enso-engine-2025.3.1-nightly.2025.9.19-linux-amd64
app/gui dev:vite: Found enso executable: /home/dbushev/projects/luna/enso/built-distribution/enso-engine-2025.3.1-nightly.2025.9.19-linux-amd64/enso-2025.3.1-nightly.2025.9.19/bin/enso

Override enso executable

ENSO_RUNNER_PATH environment variable can be used to set the absolute path to specific enso executable

ENSO_RUNNER_PATH=/home/dbushev/projects/luna/enso/built-distribution-1/enso-engine-2025.3.1-dev-linux-amd64/enso-2025.3.1-dev/bin/enso pnpm run dev:gui

Electron app

If you want to enable new project management logic in Electron, you have to manually edit the local storage and enable the feature flag: enableProjectService: true (run the app with --debug.dev-tools cli option)

2025-09-19-135713_2560x1362_scrot

Then set the ENSO_RUNNER_PATH environment variable and re-run the app (you can add --no-server flag to ensure no project manager process running)

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.

@4e6 4e6 self-assigned this Sep 11, 2025
@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Sep 11, 2025
@Akirathan Akirathan mentioned this pull request Sep 16, 2025
2 tasks
@4e6 4e6 force-pushed the wip/db/13891-dashboard-projects-open-close branch from 586865b to cb8fbd0 Compare September 16, 2025 16:21
@4e6 4e6 marked this pull request as ready for review September 16, 2025 19:12
Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

My a bit delayed twopenny:

Comment on lines +66 to +71
// This is a Vue function, not a React hook, so the React hooks rule doesn't apply
// eslint-disable-next-line react-hooks/rules-of-hooks
const enableProjectService = useFeatureFlag('enableProjectService')
if (!enableProjectService.value) {
this.socketPromise = this.reconnect()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't make use of Vue reactivity here, so you may just add getFeatureFlag method there with body:

    return flagsStore.getState().featureFlags[key]

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, one thing looks strange: we reconnect only when ProjectService is not enabled? I thought it should be the other way round...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, there's some confusion in the naming. The new logic is called ProjectService because there is a ProjectService.scala which I ported to TypeScript. In other words, the project service is the new logic in dashboard and the project manager is the old java process

Comment on lines +92 to +98
- name: 📥 Download Enso Engine
continue-on-error: true
working-directory: app/project-manager-shim
run: pnpm run download-engine
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a check if we're able to download engine, or we need to download engine for one of these checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need the enso executable to run the ProjectService.test.ts test suite

Comment on lines 105 to 116
// Check if the project is already running
const runningProject = this.runningProjects.get(projectId)
if (runningProject) {
// Return the existing language server sockets
return runningProject.sockets
}

// Generate a random root ID for this language server session
const rootId = crypto.randomUUID()

// Find available ports for the language server
const jsonPort = await this.findAvailablePort(DEFAULT_JSONRPC_PORT)
Copy link
Contributor

Choose a reason for hiding this comment

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

What if runningProject changes while we're searching for available port, or stuck at any other await in this function?

@JaroslavTulach
Copy link
Member

JaroslavTulach commented Sep 22, 2025

@4e6, please update https://github.com/enso-org/enso/blob/develop/docs/CONTRIBUTING.md#running-ide with the new recommended steps.

Copy link
Contributor

@somebody1234 somebody1234 left a comment

Choose a reason for hiding this comment

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

CR ✅

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Sep 26, 2025
@mergify mergify bot merged commit 408d8ca into develop Sep 26, 2025
62 checks passed
@mergify mergify bot deleted the wip/db/13891-dashboard-projects-open-close branch September 26, 2025 08:03
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. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dev server downloading engines Implement functionality to open and close projects in dashboard
5 participants