diff --git a/.github/workflows/engine-changed-files.yml b/.github/workflows/engine-changed-files.yml new file mode 100644 index 000000000000..e35c43956d66 --- /dev/null +++ b/.github/workflows/engine-changed-files.yml @@ -0,0 +1,55 @@ +# This file is not auto-generated. Feel free to edit it. + +name: Engine Changed Files + +on: + workflow_call: + outputs: + all_changed_files: + description: "Returns all changed files" + value: ${{ jobs.engine-changed-files.outputs.all_changed_files }} + any_changed: + description: "Returns `true` when any of the filenames have changed" + value: ${{ jobs.engine-changed-files.outputs.any_changed }} + +jobs: + engine-changed-files: + runs-on: ubuntu-latest + name: Changed Files + outputs: + all_changed_files: ${{ steps.engine-changed-files.outputs.all_changed_files }} + any_changed: ${{ steps.engine-changed-files.outputs.any_changed }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Get changed files + id: engine-changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + distribution/** + engine/** + lib/** + project/** + std-bits/** + test/** + build.sbt + .cargo/** + Cargo.lock + Cargo.toml + rust-toolchain.toml + .github/workflows/engine-changed-files.yml + .github/workflows/engine-checks-optional.yml + .github/workflows/engine-checks.yml + .github/workflows/engine-pull-request.yml + - name: List all changed files + env: + ALL_CHANGED_FILES: ${{ steps.engine-changed-files.outputs.all_changed_files }} + run: | + if [[ "${{ steps.engine-changed-files.outputs.any_changed }}" == "true" ]]; then + echo "Files changed:" + fi + for file in ${ALL_CHANGED_FILES}; do + echo "$file" + done diff --git a/.github/workflows/engine-nightly.yml b/.github/workflows/engine-checks-nightly.yml similarity index 100% rename from .github/workflows/engine-nightly.yml rename to .github/workflows/engine-checks-nightly.yml diff --git a/.github/workflows/engine-checks-optional.yml b/.github/workflows/engine-checks-optional.yml new file mode 100644 index 000000000000..ad1d1eb8ea7a --- /dev/null +++ b/.github/workflows/engine-checks-optional.yml @@ -0,0 +1,179 @@ +# This file is auto-generated. Do not edit it manually! +# Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`. + +name: Engine Checks (Optional) +on: + workflow_dispatch: + inputs: + clean_build_required: + description: Clean before and after the run. + required: false + type: boolean + default: false + workflow_call: {} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-engine-checks-optional + cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} +jobs: + enso-build-ci-gen-job-ci-check-backend-graal-vm-ce-macos-amd64: + name: Engine (GraalVM CE) (macos, amd64) + runs-on: + - macos-13 + continue-on-error: true + steps: + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: v0.12.1 + - name: Expose Artifact API and context information. + uses: actions/github-script@v7 + with: + script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " + - name: Checking out the repository + uses: actions/checkout@v4 + with: + clean: false + submodules: recursive + - name: Build Script Setup + run: ./run --help || (git clean -ffdx && ./run --help) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean before + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./run backend ci-check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() && runner.os == 'Windows' + name: List files if failed (Windows) + run: Get-ChildItem -Force -Recurse + - if: failure() && runner.os != 'Windows' + name: List files if failed (non-Windows) + run: ls -lAR + - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean after + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GRAAL_EDITION: GraalVM CE + enso-build-ci-gen-job-jvm-tests-graal-vm-ce-macos-amd64: + name: JVM Tests (GraalVM CE) (macos, amd64) + runs-on: + - macos-13 + continue-on-error: true + steps: + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: v0.12.1 + - name: Expose Artifact API and context information. + uses: actions/github-script@v7 + with: + script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " + - name: Checking out the repository + uses: actions/checkout@v4 + with: + clean: false + submodules: recursive + - name: Build Script Setup + run: ./run --help || (git clean -ffdx && ./run --help) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean before + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./run backend test jvm + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + name: Engine Test Reporter + uses: dorny/test-reporter@v1 + with: + max-annotations: 50 + name: Engine Tests Report (GraalVM CE, macos, amd64) + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*.xml + path-replace-backslashes: true + reporter: java-junit + - if: failure() && runner.os == 'Windows' + name: List files if failed (Windows) + run: Get-ChildItem -Force -Recurse + - if: failure() && runner.os != 'Windows' + name: List files if failed (non-Windows) + run: ls -lAR + - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean after + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GRAAL_EDITION: GraalVM CE + permissions: + checks: write + enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-macos-amd64: + name: Standard Library Tests (GraalVM CE) (macos, amd64) + runs-on: + - macos-13 + continue-on-error: true + steps: + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: v0.12.1 + - name: Expose Artifact API and context information. + uses: actions/github-script@v7 + with: + script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " + - name: Checking out the repository + uses: actions/checkout@v4 + with: + clean: false + submodules: recursive + - name: Build Script Setup + run: ./run --help || (git clean -ffdx && ./run --help) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean before + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./run backend test standard-library + env: + ENSO_LIB_S3_AWS_ACCESS_KEY_ID: ${{ secrets.ENSO_LIB_S3_AWS_ACCESS_KEY_ID }} + ENSO_LIB_S3_AWS_REGION: ${{ secrets.ENSO_LIB_S3_AWS_REGION }} + ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY: ${{ secrets.ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + name: Standard Library Test Reporter + uses: dorny/test-reporter@v1 + with: + max-annotations: 50 + name: Standard Library Tests Report (GraalVM CE, macos, amd64) + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*/*.xml + path-replace-backslashes: true + reporter: java-junit + - if: failure() && runner.os == 'Windows' + name: List files if failed (Windows) + run: Get-ChildItem -Force -Recurse + - if: failure() && runner.os != 'Windows' + name: List files if failed (non-Windows) + run: ls -lAR + - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean after + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GRAAL_EDITION: GraalVM CE + permissions: + checks: write +env: + ENSO_BUILD_SKIP_VERSION_CHECK: "true" diff --git a/.github/workflows/scala-new.yml b/.github/workflows/engine-checks.yml similarity index 69% rename from .github/workflows/scala-new.yml rename to .github/workflows/engine-checks.yml index 0615bdee35f0..80b81ed41535 100644 --- a/.github/workflows/scala-new.yml +++ b/.github/workflows/engine-checks.yml @@ -1,12 +1,8 @@ # This file is auto-generated. Do not edit it manually! # Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`. -name: Engine CI +name: Engine Checks on: - push: - branches: - - develop - pull_request: {} workflow_dispatch: inputs: clean_build_required: @@ -14,8 +10,9 @@ on: required: false type: boolean default: false + workflow_call: {} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-engine-checks cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} jobs: enso-build-ci-gen-job-ci-check-backend-graal-vm-ce-linux-amd64: @@ -63,50 +60,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} env: GRAAL_EDITION: GraalVM CE - enso-build-ci-gen-job-ci-check-backend-graal-vm-ce-macos-amd64: - name: Engine (GraalVM CE) (macos, amd64) - runs-on: - - macos-13 - steps: - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') - name: Installing wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: v0.12.1 - - name: Expose Artifact API and context information. - uses: actions/github-script@v7 - with: - script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - name: Build Script Setup - run: ./run --help || (git clean -ffdx && ./run --help) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean before - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./run backend ci-check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: failure() && runner.os == 'Windows' - name: List files if failed (Windows) - run: Get-ChildItem -Force -Recurse - - if: failure() && runner.os != 'Windows' - name: List files if failed (non-Windows) - run: ls -lAR - - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean after - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - env: - GRAAL_EDITION: GraalVM CE enso-build-ci-gen-job-ci-check-backend-graal-vm-ce-windows-amd64: name: Engine (GraalVM CE) (windows, amd64) runs-on: @@ -208,61 +161,6 @@ jobs: GRAAL_EDITION: GraalVM CE permissions: checks: write - enso-build-ci-gen-job-jvm-tests-graal-vm-ce-macos-amd64: - name: JVM Tests (GraalVM CE) (macos, amd64) - runs-on: - - macos-13 - steps: - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') - name: Installing wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: v0.12.1 - - name: Expose Artifact API and context information. - uses: actions/github-script@v7 - with: - script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - name: Build Script Setup - run: ./run --help || (git clean -ffdx && ./run --help) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean before - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./run backend test jvm - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - name: Engine Test Reporter - uses: dorny/test-reporter@v1 - with: - max-annotations: 50 - name: Engine Tests Report (GraalVM CE, macos, amd64) - path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*.xml - path-replace-backslashes: true - reporter: java-junit - - if: failure() && runner.os == 'Windows' - name: List files if failed (Windows) - run: Get-ChildItem -Force -Recurse - - if: failure() && runner.os != 'Windows' - name: List files if failed (non-Windows) - run: ls -lAR - - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean after - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - env: - GRAAL_EDITION: GraalVM CE - permissions: - checks: write enso-build-ci-gen-job-jvm-tests-graal-vm-ce-windows-amd64: name: JVM Tests (GraalVM CE) (windows, amd64) runs-on: @@ -378,64 +276,6 @@ jobs: GRAAL_EDITION: GraalVM CE permissions: checks: write - enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-macos-amd64: - name: Standard Library Tests (GraalVM CE) (macos, amd64) - runs-on: - - macos-13 - steps: - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') - name: Installing wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: v0.12.1 - - name: Expose Artifact API and context information. - uses: actions/github-script@v7 - with: - script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - name: Build Script Setup - run: ./run --help || (git clean -ffdx && ./run --help) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean before - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./run backend test standard-library - env: - ENSO_LIB_S3_AWS_ACCESS_KEY_ID: ${{ secrets.ENSO_LIB_S3_AWS_ACCESS_KEY_ID }} - ENSO_LIB_S3_AWS_REGION: ${{ secrets.ENSO_LIB_S3_AWS_REGION }} - ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY: ${{ secrets.ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - name: Standard Library Test Reporter - uses: dorny/test-reporter@v1 - with: - max-annotations: 50 - name: Standard Library Tests Report (GraalVM CE, macos, amd64) - path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*/*.xml - path-replace-backslashes: true - reporter: java-junit - - if: failure() && runner.os == 'Windows' - name: List files if failed (Windows) - run: Get-ChildItem -Force -Recurse - - if: failure() && runner.os != 'Windows' - name: List files if failed (non-Windows) - run: ls -lAR - - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean after - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - env: - GRAAL_EDITION: GraalVM CE - permissions: - checks: write enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-windows-amd64: name: Standard Library Tests (GraalVM CE) (windows, amd64) runs-on: diff --git a/.github/workflows/engine-pull-request.yml b/.github/workflows/engine-pull-request.yml new file mode 100644 index 000000000000..a886fedc149e --- /dev/null +++ b/.github/workflows/engine-pull-request.yml @@ -0,0 +1,52 @@ +# This file is not auto-generated. Feel free to edit it. + +name: ✨ Engine + +on: + push: + branches: + - develop + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-engine-pull-request + cancel-in-progress: true + +permissions: + checks: write + +jobs: + engine-changed-files: + name: πŸ” Files Changed + uses: ./.github/workflows/engine-changed-files.yml + secrets: inherit + + engine-checks: + name: βš™οΈ Checks + uses: ./.github/workflows/engine-checks.yml + needs: [engine-changed-files] + if: needs.engine-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' + secrets: inherit + + engine-checks-optional: + name: βš™οΈ Checks (Optional) + uses: ./.github/workflows/engine-checks-optional.yml + needs: [engine-changed-files] + if: needs.engine-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' + secrets: inherit + + required-checks: + name: Required Checks + runs-on: ubuntu-latest + needs: [engine-checks] + if: always() + steps: + - name: Checks Summary + run: | + echo "Engine Checks: ${{ needs.engine-checks.result }}" + + if [[ "${{ needs.engine-checks.result }}" == "failure" ]]; then + exit 1 + fi + + echo "Success!" diff --git a/.github/workflows/gui-changed-files.yml b/.github/workflows/gui-changed-files.yml new file mode 100644 index 000000000000..d16036ae0093 --- /dev/null +++ b/.github/workflows/gui-changed-files.yml @@ -0,0 +1,57 @@ +# This file is not auto-generated. Feel free to edit it. + +name: GUI Changed Files + +on: + workflow_call: + outputs: + all_changed_files: + description: "Returns all changed files" + value: ${{ jobs.gui-changed-files.outputs.all_changed_files }} + any_changed: + description: "Returns `true` when any of the filenames have changed" + value: ${{ jobs.gui-changed-files.outputs.any_changed }} + +jobs: + gui-changed-files: + runs-on: ubuntu-latest + name: Changed Files + outputs: + all_changed_files: ${{ steps.gui-changed-files.outputs.all_changed_files }} + any_changed: ${{ steps.gui-changed-files.outputs.any_changed }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Get changed files + id: gui-changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + app/** + package.json + pnpm-lock.yaml + pnpm-workspace.yaml + eslint.config.js + .prettierrc.js + .prettierignore + vitest.workspace.ts + .github/workflows/gui-changed-files.yml + .github/workflows/gui-checks.yml + .github/workflows/gui-pull-request.yml + .github/workflows/storybook.yml + files_ignore: | + app/ide-desktop/** + app/gui/scripts/** + app/gui/.gitignore + .git-* + - name: List all changed files + env: + ALL_CHANGED_FILES: ${{ steps.gui-changed-files.outputs.all_changed_files }} + run: | + if [[ "${{ steps.gui-changed-files.outputs.any_changed }}" == "true" ]]; then + echo "Files changed:" + fi + for file in ${ALL_CHANGED_FILES}; do + echo "$file" + done diff --git a/.github/workflows/gui-checks.yml b/.github/workflows/gui-checks.yml index 5d1091df8457..730d49198748 100644 --- a/.github/workflows/gui-checks.yml +++ b/.github/workflows/gui-checks.yml @@ -1,3 +1,5 @@ +# This file is not auto-generated. Feel free to edit it. + name: GUI Checks on: workflow_call @@ -31,17 +33,6 @@ jobs: node-version-file: .node-version cache: "pnpm" - - uses: actions/cache/restore@v4 - name: Download cache - id: cache - with: - path: | - **/.eslintcache - node_modules/.cache/prettier - key: ${{ runner.os }}-gui-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-gui - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') name: Installing wasm-pack uses: jetli/wasm-pack-action@v0.4.0 @@ -51,10 +42,15 @@ jobs: - name: πŸ“¦ Install dependencies run: pnpm install --frozen-lockfile - - name: πŸ“ Prettier - id: prettier - continue-on-error: true - run: pnpm run ci:prettier + - uses: actions/cache/restore@v4 + name: Download cache + id: cache + with: + path: | + **/.eslintcache + key: ${{ runner.os }}-gui-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-gui # Next Tasks are depend on Typecheck, because we build libraries at this stage - name: 🧠 Typecheck @@ -88,7 +84,6 @@ jobs: - name: ❌ Fail if any check failed if: always() && (steps.prettier.outcome == 'failure' || steps.lint.outcome == 'failure' || steps.typecheck.outcome == 'failure' || steps.unit-tests.outcome == 'failure') run: | - echo "Prettier outcome: ${{ steps.prettier.outcome }}" echo "Lint outcome: ${{ steps.lint.outcome }}" echo "Typecheck outcome: ${{ steps.typecheck.outcome }}" echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}" @@ -102,7 +97,6 @@ jobs: key: ${{ steps.cache.outputs.cache-primary-key }} path: | **/.eslintcache - node_modules/.cache/prettier playwright: name: 🎭 Playwright Tests diff --git a/.github/workflows/gui-packaging-optional.yml b/.github/workflows/gui-packaging-optional.yml new file mode 100644 index 000000000000..4f5ab0bfd79a --- /dev/null +++ b/.github/workflows/gui-packaging-optional.yml @@ -0,0 +1,197 @@ +# This file is auto-generated. Do not edit it manually! +# Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`. + +name: GUI Packaging (Optional) +on: + workflow_dispatch: + inputs: + clean_build_required: + description: Clean before and after the run. + required: false + type: boolean + default: false + workflow_call: {} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-gui-packaging-optional + cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} +jobs: + enso-build-ci-gen-job-build-backend-macos-amd64: + name: Build Backend (macos, amd64) + runs-on: + - macos-13 + continue-on-error: true + steps: + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: v0.12.1 + - name: Expose Artifact API and context information. + uses: actions/github-script@v7 + with: + script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " + - name: Checking out the repository + uses: actions/checkout@v4 + with: + clean: false + submodules: recursive + - name: Build Script Setup + run: ./run --help || (git clean -ffdx && ./run --help) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean before + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./run backend get + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() && runner.os == 'Windows' + name: List files if failed (Windows) + run: Get-ChildItem -Force -Recurse + - if: failure() && runner.os != 'Windows' + name: List files if failed (non-Windows) + run: ls -lAR + - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean after + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + enso-build-ci-gen-job-gui-build-macos-amd64: + name: GUI build (macos, amd64) + runs-on: + - macos-13 + continue-on-error: true + steps: + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: v0.12.1 + - name: Expose Artifact API and context information. + uses: actions/github-script@v7 + with: + script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " + - name: Checking out the repository + uses: actions/checkout@v4 + with: + clean: false + submodules: recursive + - name: Build Script Setup + run: ./run --help || (git clean -ffdx && ./run --help) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean before + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./run gui build + env: + ENSO_CLOUD_API_URL: ${{ vars.ENSO_CLOUD_API_URL }} + ENSO_CLOUD_CHAT_URL: ${{ vars.ENSO_CLOUD_CHAT_URL }} + ENSO_CLOUD_COGNITO_DOMAIN: ${{ vars.ENSO_CLOUD_COGNITO_DOMAIN }} + ENSO_CLOUD_COGNITO_REGION: ${{ vars.ENSO_CLOUD_COGNITO_REGION }} + ENSO_CLOUD_COGNITO_USER_POOL_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_ID }} + ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }} + ENSO_CLOUD_ENVIRONMENT: ${{ vars.ENSO_CLOUD_ENVIRONMENT }} + ENSO_CLOUD_GOOGLE_ANALYTICS_TAG: ${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }} + ENSO_CLOUD_SENTRY_DSN: ${{ vars.ENSO_CLOUD_SENTRY_DSN }} + ENSO_CLOUD_STRIPE_KEY: ${{ vars.ENSO_CLOUD_STRIPE_KEY }} + ENSO_IDE_AG_GRID_LICENSE_KEY: ${{ vars.ENSO_AG_GRID_LICENSE_KEY }} + ENSO_IDE_MAPBOX_API_TOKEN: ${{ vars.ENSO_MAPBOX_API_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() && runner.os == 'Windows' + name: List files if failed (Windows) + run: Get-ChildItem -Force -Recurse + - if: failure() && runner.os != 'Windows' + name: List files if failed (non-Windows) + run: ls -lAR + - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean after + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + enso-build-ci-gen-job-package-ide-macos-amd64: + name: Package New IDE (macos, amd64) + needs: + - enso-build-ci-gen-job-build-backend-macos-amd64 + runs-on: + - macos-13 + continue-on-error: true + steps: + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: v0.12.1 + - name: Expose Artifact API and context information. + uses: actions/github-script@v7 + with: + script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " + - name: Checking out the repository + uses: actions/checkout@v4 + with: + clean: false + submodules: recursive + - name: Build Script Setup + run: ./run --help || (git clean -ffdx && ./run --help) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean before + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./run ide build --backend-source current-ci-run --gui-upload-artifact false + env: + APPLEID: ${{ secrets.APPLE_NOTARIZATION_USERNAME }} + APPLEIDPASS: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} + APPLETEAMID: ${{ secrets.APPLE_NOTARIZATION_TEAM_ID }} + CSC_FOR_PULL_REQUEST: "true" + CSC_IDENTITY_AUTO_DISCOVERY: "true" + CSC_KEY_PASSWORD: ${{ secrets.APPLE_CODE_SIGNING_CERT_PASSWORD }} + CSC_LINK: ${{ secrets.APPLE_CODE_SIGNING_CERT }} + ENSO_CLOUD_API_URL: ${{ vars.ENSO_CLOUD_API_URL }} + ENSO_CLOUD_CHAT_URL: ${{ vars.ENSO_CLOUD_CHAT_URL }} + ENSO_CLOUD_COGNITO_DOMAIN: ${{ vars.ENSO_CLOUD_COGNITO_DOMAIN }} + ENSO_CLOUD_COGNITO_REGION: ${{ vars.ENSO_CLOUD_COGNITO_REGION }} + ENSO_CLOUD_COGNITO_USER_POOL_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_ID }} + ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }} + ENSO_CLOUD_ENVIRONMENT: ${{ vars.ENSO_CLOUD_ENVIRONMENT }} + ENSO_CLOUD_GOOGLE_ANALYTICS_TAG: ${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }} + ENSO_CLOUD_SENTRY_DSN: ${{ vars.ENSO_CLOUD_SENTRY_DSN }} + ENSO_CLOUD_STRIPE_KEY: ${{ vars.ENSO_CLOUD_STRIPE_KEY }} + ENSO_IDE_AG_GRID_LICENSE_KEY: ${{ vars.ENSO_AG_GRID_LICENSE_KEY }} + ENSO_IDE_MAPBOX_API_TOKEN: ${{ vars.ENSO_MAPBOX_API_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: corepack pnpm -r --filter enso exec playwright test --timeout 300000 + env: + DEBUG: "pw:browser log:" + ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }} + ENSO_TEST_USER_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() + name: Upload Test Traces + uses: actions/upload-artifact@v4 + with: + compression-level: 0 + name: test-traces-macos-amd64 + path: app/ide-desktop/client/test-traces + - run: rm $HOME/.enso/credentials + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() && runner.os == 'Windows' + name: List files if failed (Windows) + run: Get-ChildItem -Force -Recurse + - if: failure() && runner.os != 'Windows' + name: List files if failed (non-Windows) + run: ls -lAR + - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" + name: Clean after + run: ./run git-clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +env: + ENSO_BUILD_SKIP_VERSION_CHECK: "true" diff --git a/.github/workflows/gui-packaging-pull-request.yml b/.github/workflows/gui-packaging-pull-request.yml new file mode 100644 index 000000000000..c379bb18b3fb --- /dev/null +++ b/.github/workflows/gui-packaging-pull-request.yml @@ -0,0 +1,54 @@ +# This file is not auto-generated. Feel free to edit it. + +name: ✨ GUI Packaging + +on: + push: + branches: + - develop + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-gui-packaging-pull-request + cancel-in-progress: true + +jobs: + gui-changed-files: + name: πŸ” GUI Files Changed + uses: ./.github/workflows/gui-changed-files.yml + secrets: inherit + + engine-changed-files: + name: πŸ” Engine Files Changed + uses: ./.github/workflows/engine-changed-files.yml + secrets: inherit + + gui-packaging: + name: πŸ“¦ Package + uses: ./.github/workflows/gui-packaging.yml + needs: [gui-changed-files, engine-changed-files] + if: needs.gui-changed-files.outputs.any_changed == 'true' || needs.engine-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' + secrets: inherit + + gui-packaging-optional: + name: πŸ“¦ Package (Optional) + uses: ./.github/workflows/gui-packaging-optional.yml + needs: [gui-changed-files, engine-changed-files] + if: needs.gui-changed-files.outputs.any_changed == 'true' || needs.engine-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' + secrets: inherit + + required-checks: + name: Required Checks + runs-on: ubuntu-latest + needs: [gui-packaging] + if: always() + steps: + - name: Checks Summary + run: | + echo "GUI Packaging: ${{ needs.gui-packaging.result }}" + + if [[ "${{ needs.gui-packaging.result }}" == "failure" ]]; then + exit 1 + fi + + echo "Success!" diff --git a/.github/workflows/gui.yml b/.github/workflows/gui-packaging.yml similarity index 66% rename from .github/workflows/gui.yml rename to .github/workflows/gui-packaging.yml index c20b8cbca980..52fcced5cb4e 100644 --- a/.github/workflows/gui.yml +++ b/.github/workflows/gui-packaging.yml @@ -3,10 +3,6 @@ name: GUI Packaging on: - push: - branches: - - develop - pull_request: {} workflow_dispatch: inputs: clean_build_required: @@ -14,8 +10,9 @@ on: required: false type: boolean default: false + workflow_call: {} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-gui-packaging cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} jobs: enso-build-ci-gen-job-build-backend-linux-amd64: @@ -61,48 +58,6 @@ jobs: run: ./run git-clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - enso-build-ci-gen-job-build-backend-macos-amd64: - name: Build Backend (macos, amd64) - runs-on: - - macos-13 - steps: - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') - name: Installing wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: v0.12.1 - - name: Expose Artifact API and context information. - uses: actions/github-script@v7 - with: - script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - name: Build Script Setup - run: ./run --help || (git clean -ffdx && ./run --help) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean before - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./run backend get - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: failure() && runner.os == 'Windows' - name: List files if failed (Windows) - run: Get-ChildItem -Force -Recurse - - if: failure() && runner.os != 'Windows' - name: List files if failed (non-Windows) - run: ls -lAR - - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean after - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} enso-build-ci-gen-job-build-backend-windows-amd64: name: Build Backend (windows, amd64) runs-on: @@ -201,60 +156,6 @@ jobs: run: ./run git-clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - enso-build-ci-gen-job-gui-build-macos-amd64: - name: GUI build (macos, amd64) - runs-on: - - macos-13 - steps: - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') - name: Installing wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: v0.12.1 - - name: Expose Artifact API and context information. - uses: actions/github-script@v7 - with: - script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - name: Build Script Setup - run: ./run --help || (git clean -ffdx && ./run --help) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean before - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./run gui build - env: - ENSO_CLOUD_API_URL: ${{ vars.ENSO_CLOUD_API_URL }} - ENSO_CLOUD_CHAT_URL: ${{ vars.ENSO_CLOUD_CHAT_URL }} - ENSO_CLOUD_COGNITO_DOMAIN: ${{ vars.ENSO_CLOUD_COGNITO_DOMAIN }} - ENSO_CLOUD_COGNITO_REGION: ${{ vars.ENSO_CLOUD_COGNITO_REGION }} - ENSO_CLOUD_COGNITO_USER_POOL_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_ID }} - ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }} - ENSO_CLOUD_ENVIRONMENT: ${{ vars.ENSO_CLOUD_ENVIRONMENT }} - ENSO_CLOUD_GOOGLE_ANALYTICS_TAG: ${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }} - ENSO_CLOUD_SENTRY_DSN: ${{ vars.ENSO_CLOUD_SENTRY_DSN }} - ENSO_CLOUD_STRIPE_KEY: ${{ vars.ENSO_CLOUD_STRIPE_KEY }} - ENSO_IDE_AG_GRID_LICENSE_KEY: ${{ vars.ENSO_AG_GRID_LICENSE_KEY }} - ENSO_IDE_MAPBOX_API_TOKEN: ${{ vars.ENSO_MAPBOX_API_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: failure() && runner.os == 'Windows' - name: List files if failed (Windows) - run: Get-ChildItem -Force -Recurse - - if: failure() && runner.os != 'Windows' - name: List files if failed (non-Windows) - run: ls -lAR - - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean after - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} enso-build-ci-gen-job-gui-build-windows-amd64: name: GUI build (windows, amd64) runs-on: @@ -384,85 +285,6 @@ jobs: run: ./run git-clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - enso-build-ci-gen-job-package-ide-macos-amd64: - name: Package New IDE (macos, amd64) - needs: - - enso-build-ci-gen-job-build-backend-macos-amd64 - runs-on: - - macos-13 - steps: - - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') - name: Installing wasm-pack - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: v0.12.1 - - name: Expose Artifact API and context information. - uses: actions/github-script@v7 - with: - script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n " - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - name: Build Script Setup - run: ./run --help || (git clean -ffdx && ./run --help) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean before - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./run ide build --backend-source current-ci-run --gui-upload-artifact false - env: - APPLEID: ${{ secrets.APPLE_NOTARIZATION_USERNAME }} - APPLEIDPASS: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} - APPLETEAMID: ${{ secrets.APPLE_NOTARIZATION_TEAM_ID }} - CSC_FOR_PULL_REQUEST: "true" - CSC_IDENTITY_AUTO_DISCOVERY: "true" - CSC_KEY_PASSWORD: ${{ secrets.APPLE_CODE_SIGNING_CERT_PASSWORD }} - CSC_LINK: ${{ secrets.APPLE_CODE_SIGNING_CERT }} - ENSO_CLOUD_API_URL: ${{ vars.ENSO_CLOUD_API_URL }} - ENSO_CLOUD_CHAT_URL: ${{ vars.ENSO_CLOUD_CHAT_URL }} - ENSO_CLOUD_COGNITO_DOMAIN: ${{ vars.ENSO_CLOUD_COGNITO_DOMAIN }} - ENSO_CLOUD_COGNITO_REGION: ${{ vars.ENSO_CLOUD_COGNITO_REGION }} - ENSO_CLOUD_COGNITO_USER_POOL_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_ID }} - ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID: ${{ vars.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }} - ENSO_CLOUD_ENVIRONMENT: ${{ vars.ENSO_CLOUD_ENVIRONMENT }} - ENSO_CLOUD_GOOGLE_ANALYTICS_TAG: ${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }} - ENSO_CLOUD_SENTRY_DSN: ${{ vars.ENSO_CLOUD_SENTRY_DSN }} - ENSO_CLOUD_STRIPE_KEY: ${{ vars.ENSO_CLOUD_STRIPE_KEY }} - ENSO_IDE_AG_GRID_LICENSE_KEY: ${{ vars.ENSO_AG_GRID_LICENSE_KEY }} - ENSO_IDE_MAPBOX_API_TOKEN: ${{ vars.ENSO_MAPBOX_API_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: corepack pnpm -r --filter enso exec playwright test --timeout 300000 - env: - DEBUG: "pw:browser log:" - ENSO_TEST_USER: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }} - ENSO_TEST_USER_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: failure() - name: Upload Test Traces - uses: actions/upload-artifact@v4 - with: - compression-level: 0 - name: test-traces-macos-amd64 - path: app/ide-desktop/client/test-traces - - run: rm $HOME/.enso/credentials - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: failure() && runner.os == 'Windows' - name: List files if failed (Windows) - run: Get-ChildItem -Force -Recurse - - if: failure() && runner.os != 'Windows' - name: List files if failed (non-Windows) - run: ls -lAR - - if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || inputs.clean_build_required)" - name: Clean after - run: ./run git-clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} enso-build-ci-gen-job-package-ide-windows-amd64: name: Package New IDE (windows, amd64) needs: diff --git a/.github/workflows/gui-pull-request.yml b/.github/workflows/gui-pull-request.yml index 650f001d2279..36d7f77faf93 100644 --- a/.github/workflows/gui-pull-request.yml +++ b/.github/workflows/gui-pull-request.yml @@ -1,6 +1,6 @@ # This file is not auto-generated. Feel free to edit it. -name: ✨ GUI Pull Request +name: ✨ GUI on: push: @@ -9,7 +9,7 @@ on: pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-gui-pull-request cancel-in-progress: true permissions: @@ -20,73 +20,85 @@ permissions: checks: write jobs: - changed-files: + gui-changed-files: + name: πŸ” Files Changed + uses: ./.github/workflows/gui-changed-files.yml + secrets: inherit + + prettier: + name: 🧹 Prettier runs-on: ubuntu-latest - name: πŸ” GUI files changed - outputs: - all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }} - any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - uses: actions/checkout@v4 + - name: πŸ“¦ Setup pnpm + uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + name: βŽ” Setup Node with: - fetch-depth: 2 - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 + node-version-file: .node-version + cache: "pnpm" + - if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent') + name: Installing wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 with: - files: | - app/** - package.json - pnpm-lock.yaml - pnpm-workspace.yaml - eslint.config.js - .prettierrc.js - .prettierignore - vitest.workspace.ts - .github/workflows/gui* - files_ignore: | - app/ide-desktop/** - app/gui/scripts/** - app/gui/.gitignore - .git-* - - - name: List all changed files - env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done + version: v0.12.1 + - name: πŸ“¦ Install dependencies + run: pnpm install --frozen-lockfile --ignore-scripts + - uses: actions/cache/restore@v4 + name: Download cache + id: cache + with: + path: | + node_modules/.cache/prettier + key: ${{ runner.os }}-gui-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-gui + - name: Run prettier + run: pnpm run ci:prettier + - name: πŸ’Ύ Save cache + uses: actions/cache/save@v4 + if: always() && steps.cache.outputs.cache-hit != 'true' + id: save-cache + with: + key: ${{ steps.cache.outputs.cache-primary-key }} + path: | + node_modules/.cache/prettier - checks: + gui-checks: name: 🧰 Checks uses: ./.github/workflows/gui-checks.yml - needs: [changed-files] - if: ${{ needs.changed-files.outputs.any_changed == 'true' }} + needs: [gui-changed-files] + if: needs.gui-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' secrets: inherit storybook: name: πŸ“š Deploy Storybook uses: ./.github/workflows/storybook.yml - needs: [changed-files] - if: ${{ needs.changed-files.outputs.any_changed == 'true' }} + needs: [gui-changed-files] + if: needs.gui-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' secrets: inherit - # This job is used to report success if the needed jobs were successful. - # This is a workaround to make optional jobs required if they run - report-success: - name: GUI Checks Success or Skipped + required-checks: + name: Required Checks runs-on: ubuntu-latest - needs: [checks, storybook] + needs: [prettier, gui-checks, storybook] if: always() steps: - - name: Report success + - name: Checks Summary run: | - echo "Checks: ${{ needs.checks.result }}" + echo "Prettier: ${{ needs.prettier.result }}" + echo "GUI Checks: ${{ needs.gui-checks.result }}" echo "Storybook: ${{ needs.storybook.result }}" - if [[ "${{ needs.checks.result }}" == "failure" || "${{ needs.storybook.result }}" == "failure" ]]; then - exit 1 - fi + declare -a checks + checks+=("${{ needs.prettier.result }}") + checks+=("${{ needs.gui-checks.result }}") + checks+=("${{ needs.storybook.result }}") + + for result in "${checks[@]}"; do + if [[ "$result" == "failure" ]]; then + exit 1 + fi + done echo "Success!" diff --git a/.github/workflows/shader-tools.yml b/.github/workflows/shader-tools.yml deleted file mode 100644 index 4f9250871d5b..000000000000 --- a/.github/workflows/shader-tools.yml +++ /dev/null @@ -1,105 +0,0 @@ -# This file is auto-generated. Do not edit it manually! -# Edit the build/shader-tools/src/ci.rs module instead and run `cargo run --package enso-build-ci-gen`. - -name: Package Tools -on: - workflow_dispatch: {} -jobs: - run-create-linux-latest: - name: Run create (LinuxLatest) - runs-on: - - ubuntu-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - id: step_0 - run: cargo run --package enso-build-shader-tools --bin create - env: - GITHUB_TOKEN: ${{ secrets.CI_PRIVATE_TOKEN }} - outputs: - ENSO_RELEASE_ID: ${{ steps.step_0.outputs.ENSO_RELEASE_ID }} - timeout-minutes: 360 - run-package-linux-latest: - name: Run package (LinuxLatest) - needs: - - run-create-linux-latest - runs-on: - - ubuntu-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - id: step_1 - run: cargo run --package enso-build-shader-tools --bin package - env: - GITHUB_TOKEN: ${{ secrets.CI_PRIVATE_TOKEN }} - env: - ENSO_RELEASE_ID: ${{ needs.run-create-linux-latest.outputs.ENSO_RELEASE_ID }} - timeout-minutes: 360 - run-package-mac-os-latest: - name: Run package (MacOSLatest) - needs: - - run-create-linux-latest - runs-on: - - macos-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - id: step_3 - run: cargo run --package enso-build-shader-tools --bin package - env: - GITHUB_TOKEN: ${{ secrets.CI_PRIVATE_TOKEN }} - env: - ENSO_RELEASE_ID: ${{ needs.run-create-linux-latest.outputs.ENSO_RELEASE_ID }} - timeout-minutes: 360 - run-package-windows-latest: - name: Run package (WindowsLatest) - needs: - - run-create-linux-latest - runs-on: - - windows-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - id: step_2 - run: cargo run --package enso-build-shader-tools --bin package - env: - GITHUB_TOKEN: ${{ secrets.CI_PRIVATE_TOKEN }} - env: - ENSO_RELEASE_ID: ${{ needs.run-create-linux-latest.outputs.ENSO_RELEASE_ID }} - timeout-minutes: 360 - run-publish-linux-latest: - name: Run publish (LinuxLatest) - needs: - - run-create-linux-latest - - run-package-linux-latest - - run-package-mac-os-latest - - run-package-windows-latest - runs-on: - - ubuntu-latest - steps: - - name: Checking out the repository - uses: actions/checkout@v4 - with: - clean: false - submodules: recursive - - id: step_4 - run: cargo run --package enso-build-shader-tools --bin publish - env: - GITHUB_TOKEN: ${{ secrets.CI_PRIVATE_TOKEN }} - env: - ENSO_RELEASE_ID: ${{ needs.run-create-linux-latest.outputs.ENSO_RELEASE_ID }} - timeout-minutes: 360 -env: - ENSO_BUILD_SKIP_VERSION_CHECK: "true" diff --git a/.github/workflows/wasm-changed-files.yml b/.github/workflows/wasm-changed-files.yml new file mode 100644 index 000000000000..fdbf1aa2b345 --- /dev/null +++ b/.github/workflows/wasm-changed-files.yml @@ -0,0 +1,51 @@ +# This file is not auto-generated. Feel free to edit it. + +name: WASM Changed Files + +on: + workflow_call: + outputs: + all_changed_files: + description: "Returns all changed files" + value: ${{ jobs.wasm-changed-files.outputs.all_changed_files }} + any_changed: + description: "Returns `true` when any of the filenames have changed" + value: ${{ jobs.wasm-changed-files.outputs.any_changed }} + +jobs: + wasm-changed-files: + runs-on: ubuntu-latest + name: Changed Files + outputs: + all_changed_files: ${{ steps.wasm-changed-files.outputs.all_changed_files }} + any_changed: ${{ steps.wasm-changed-files.outputs.any_changed }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Get changed files + id: wasm-changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + .cargo/** + app/rust-ffi/** + build/** + lib/rust/** + tools/language-server/logstat/** + tools/language-server/wstest/** + Cargo.lock + Cargo.toml + rust-toolchain.toml + rustfmt.toml + .github/workflows/wasm* + - name: List all changed files + env: + ALL_CHANGED_FILES: ${{ steps.wasm-changed-files.outputs.all_changed_files }} + run: | + if [[ "${{ steps.wasm-changed-files.outputs.any_changed }}" == "true" ]]; then + echo "Files changed:" + fi + for file in ${ALL_CHANGED_FILES}; do + echo "$file" + done diff --git a/.github/workflows/gui-tests.yml b/.github/workflows/wasm-checks.yml similarity index 93% rename from .github/workflows/gui-tests.yml rename to .github/workflows/wasm-checks.yml index 4abe8f1d23f3..246f8bb97305 100644 --- a/.github/workflows/gui-tests.yml +++ b/.github/workflows/wasm-checks.yml @@ -1,12 +1,8 @@ # This file is auto-generated. Do not edit it manually! # Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`. -name: GUI Check +name: WASM Checks on: - push: - branches: - - develop - pull_request: {} workflow_dispatch: inputs: clean_build_required: @@ -14,19 +10,11 @@ on: required: false type: boolean default: false + workflow_call: {} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-wasm-checks + cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} jobs: - enso-build-ci-gen-job-cancel-workflow-linux-amd64: - name: Cancel Previous Runs - if: github.ref != 'refs/heads/develop' - runs-on: - - ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - permissions: - actions: write enso-build-ci-gen-job-lint-linux-amd64: name: Lint (linux, amd64) runs-on: diff --git a/.github/workflows/wasm-pull-request.yml b/.github/workflows/wasm-pull-request.yml new file mode 100644 index 000000000000..16aecc6559f5 --- /dev/null +++ b/.github/workflows/wasm-pull-request.yml @@ -0,0 +1,42 @@ +# This file is not auto-generated. Feel free to edit it. + +name: ✨ WASM + +on: + push: + branches: + - develop + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-wasm-pull-request + cancel-in-progress: true + +jobs: + wasm-changed-files: + name: πŸ” Files Changed + uses: ./.github/workflows/wasm-changed-files.yml + secrets: inherit + + wasm-checks: + name: πŸ¦€ Checks + uses: ./.github/workflows/wasm-checks.yml + needs: [wasm-changed-files] + if: needs.wasm-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop' + secrets: inherit + + required-checks: + name: Required Checks + runs-on: ubuntu-latest + needs: [wasm-checks] + if: always() + steps: + - name: Checks Summary + run: | + echo "WASM Checks: ${{ needs.wasm-checks.result }}" + + if [[ "${{ needs.wasm-checks.result }}" == "failure" ]]; then + exit 1 + fi + + echo "Success!" diff --git a/.prettierignore b/.prettierignore index 709537c7f4b2..41d9adc6f8bc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -16,7 +16,6 @@ distribution/lib/Standard/*/*/manifest.yaml distribution/lib/Standard/*/*/polyglot distribution/lib/Standard/*/*/THIRD-PARTY distribution/docs-js -docs/**/*.md built-distribution/ THIRD-PARTY diff --git a/CHANGELOG.md b/CHANGELOG.md index 4df253fba6e9..b1e53b92c712 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Next Next Release +#### Enso IDE + +- [ENSO_IDE_MAPBOX_API_TOKEN environment variable should be provided to enable + GeoMap visualization][11889]. +- [Round β€˜Add component’ button under the component menu replaced by a small + button protruding from the output port.][11836]. + +[11889]: https://github.com/enso-org/enso/pull/11889 +[11836]: https://github.com/enso-org/enso/pull/11836 + #### Enso Language & Runtime - [Intersection types & type checks][11600] @@ -120,6 +130,7 @@ - [Added `Table.input` allowing creation of typed tables from vectors of data, including auto parsing text columns.][11562] - [Enhance Managed_Resource to allow implementation of in-memory caches][11577] +- [Added `add_group_number` to the in-memory database.[11818] - [The reload button clears the HTTP cache.][11673] [11235]: https://github.com/enso-org/enso/pull/11235 @@ -129,6 +140,7 @@ [11490]: https://github.com/enso-org/enso/pull/11490 [11562]: https://github.com/enso-org/enso/pull/11562 [11577]: https://github.com/enso-org/enso/pull/11577 +[11818]: https://github.com/enso-org/enso/pull/11818 [11673]: https://github.com/enso-org/enso/pull/11673 #### Enso Language & Runtime diff --git a/app/gui/env.d.ts b/app/gui/env.d.ts index f7095e04d189..2babbb394e40 100644 --- a/app/gui/env.d.ts +++ b/app/gui/env.d.ts @@ -175,6 +175,7 @@ declare global { readonly projectManagementApi?: ProjectManagementApi readonly fileBrowserApi?: FileBrowserApi readonly versionInfo?: VersionInfo + readonly mapBoxApiToken?: () => string toggleDevtools: () => void /** * If set to `true`, animations will be disabled. diff --git a/app/gui/integration-test/project-view/actions.ts b/app/gui/integration-test/project-view/actions.ts index 96743db1f575..00522b0410aa 100644 --- a/app/gui/integration-test/project-view/actions.ts +++ b/app/gui/integration-test/project-view/actions.ts @@ -66,9 +66,9 @@ export async function dragNodeByBinding(page: Page, nodeBinding: string, x: numb } /** Move mouse away to avoid random hover events and wait for any circular menus to disappear. */ -export async function ensureNoCircularMenusVisibleDueToHovering(page: Page) { +export async function ensureNoComponentMenusVisibleDueToHovering(page: Page) { await page.mouse.move(-1000, 0) - await expect(locate.circularMenu(page)).toBeHidden() + await expect(locate.componentMenu(page)).toBeHidden() } /** Ensure no nodes are selected. */ diff --git a/app/gui/integration-test/project-view/componentBrowser.spec.ts b/app/gui/integration-test/project-view/componentBrowser.spec.ts index 3e49c831d834..95607c23504e 100644 --- a/app/gui/integration-test/project-view/componentBrowser.spec.ts +++ b/app/gui/integration-test/project-view/componentBrowser.spec.ts @@ -73,25 +73,21 @@ test('Different ways of opening Component Browser', async ({ page }) => { await expectAndCancelBrowser(page, '', 'selected') }) -test('Opening Component Browser with small plus buttons', async ({ page }) => { +test('Opening Component Browser from output port buttons', async ({ page }) => { await actions.goToGraph(page) // Small (+) button shown when node is hovered - await page.keyboard.press('Escape') - await page.mouse.move(100, 80) - await expect(locate.smallPlusButton(page)).toBeHidden() - await locate.graphNodeIcon(locate.graphNodeByBinding(page, 'selected')).hover() - await expect(locate.smallPlusButton(page)).toBeVisible() - await locate.smallPlusButton(page).click() + const node = locate.graphNodeByBinding(page, 'selected') + await locate.graphNodeIcon(node).hover() + await expect(locate.createNodeFromPort(node)).toBeVisible() + await locate.createNodeFromPort(node).click({ force: true }) await expectAndCancelBrowser(page, '', 'selected') - // Small (+) button shown when node is sole selection + // Small (+) button shown when node is selected await page.keyboard.press('Escape') - await page.mouse.move(300, 300) - await expect(locate.smallPlusButton(page)).toBeHidden() - await locate.graphNodeByBinding(page, 'selected').click() - await expect(locate.smallPlusButton(page)).toBeVisible() - await locate.smallPlusButton(page).click() + await node.click() + await expect(locate.createNodeFromPort(node)).toBeVisible() + await locate.createNodeFromPort(node).click({ force: true }) await expectAndCancelBrowser(page, '', 'selected') }) diff --git a/app/gui/integration-test/project-view/graphNodeVisualization.spec.ts b/app/gui/integration-test/project-view/graphNodeVisualization.spec.ts index bf8556275791..af27ca9159c9 100644 --- a/app/gui/integration-test/project-view/graphNodeVisualization.spec.ts +++ b/app/gui/integration-test/project-view/graphNodeVisualization.spec.ts @@ -9,7 +9,7 @@ test('Node can open and load visualization', async ({ page }) => { await actions.goToGraph(page) const node = locate.graphNode(page).last() await node.click({ position: { x: 8, y: 8 } }) - await expect(locate.circularMenu(page)).toExist() + await expect(locate.componentMenu(page)).toExist() await locate.toggleVisualizationButton(page).click() await expect(locate.anyVisualization(page)).toExist() await expect(locate.loadingVisualization(page)).toHaveCount(0) diff --git a/app/gui/integration-test/project-view/locate.ts b/app/gui/integration-test/project-view/locate.ts index e57546a852a2..e8a4a04b769f 100644 --- a/app/gui/integration-test/project-view/locate.ts +++ b/app/gui/integration-test/project-view/locate.ts @@ -79,11 +79,11 @@ export const graphEditor = componentLocator('.GraphEditor') export const codeEditor = componentLocator('.CodeEditor') export const anyVisualization = componentLocator('.GraphVisualization') export const loadingVisualization = componentLocator('.LoadingVisualization') -export const circularMenu = componentLocator('.CircularMenu') +export const componentMenu = componentLocator('.ComponentMenu') export const addNewNodeButton = componentLocator('.PlusButton') export const componentBrowser = componentLocator('.ComponentBrowser') export const nodeOutputPort = componentLocator('.outputPortHoverArea') -export const smallPlusButton = componentLocator('.SmallPlusButton') +export const createNodeFromPort = componentLocator('.CreateNodeFromPortButton .plusIcon') export const editorRoot = componentLocator('.CodeMirror') export const nodeComment = componentLocator('.GraphNodeComment') export const nodeCommentContent = componentLocator('.GraphNodeComment div[contentEditable]') diff --git a/app/gui/integration-test/project-view/nodeComments.spec.ts b/app/gui/integration-test/project-view/nodeComments.spec.ts index c9e386cae4e0..d48c1f7ece7e 100644 --- a/app/gui/integration-test/project-view/nodeComments.spec.ts +++ b/app/gui/integration-test/project-view/nodeComments.spec.ts @@ -22,8 +22,8 @@ test('Start editing comment via menu', async ({ page }) => { await actions.goToGraph(page) const node = locate.graphNodeByBinding(page, 'final') await node.click() - await locate.circularMenu(node).getByRole('button', { name: 'More' }).click() - await locate.circularMenu(node).getByRole('button', { name: 'Comment' }).click() + await locate.componentMenu(node).getByRole('button', { name: 'More' }).click() + await locate.componentMenu(node).getByRole('button', { name: 'Comment' }).click() await expect(locate.nodeCommentContent(node)).toBeFocused() }) @@ -60,8 +60,8 @@ test('Add new comment via menu', async ({ page }) => { const nodeComment = locate.nodeCommentContent(node) await node.click() - await locate.circularMenu(node).getByRole('button', { name: 'More' }).click() - await locate.circularMenu(node).getByRole('button', { name: 'Comment' }).click() + await locate.componentMenu(node).getByRole('button', { name: 'More' }).click() + await locate.componentMenu(node).getByRole('button', { name: 'Comment' }).click() await expect(locate.nodeCommentContent(node)).toBeFocused() const NEW_COMMENT = 'New comment text' await nodeComment.fill(NEW_COMMENT) diff --git a/app/gui/integration-test/project-view/typesOnNodeHover.spec.ts b/app/gui/integration-test/project-view/typesOnNodeHover.spec.ts index 32811c648382..eea37fd602d7 100644 --- a/app/gui/integration-test/project-view/typesOnNodeHover.spec.ts +++ b/app/gui/integration-test/project-view/typesOnNodeHover.spec.ts @@ -15,17 +15,17 @@ async function assertTypeLabelOnNode( ) { // Ensure the visualization button won't be covered by any other parts of another node (e.g. a comment). await bringNodeToFront(page, node) - await node.hover({ position: { x: 8, y: 8 } }) - await locate.toggleVisualizationButton(node).click() + await node.hover({ position: { x: 8, y: 8 }, force: true }) + await locate.toggleVisualizationButton(node).click({ force: true }) const targetLabel = node.locator('.node-type').first() await expect(targetLabel).toHaveText(type.short) await expect(targetLabel).toHaveAttribute('title', type.full) - await locate.toggleVisualizationButton(node).click() + await locate.toggleVisualizationButton(node).click({ force: true }) await actions.deselectNodes(page) } async function bringNodeToFront(page: Page, node: Locator) { - await node.click({ position: { x: 8, y: 8 } }) + await node.click({ position: { x: 0, y: 8 }, force: true }) await page.keyboard.press('Escape') } diff --git a/app/gui/package.json b/app/gui/package.json index 8f1f2f35dc7f..4a9e45f7245f 100644 --- a/app/gui/package.json +++ b/app/gui/package.json @@ -166,7 +166,7 @@ "@types/d3": "^7.4.0", "@types/hash-sum": "^1.0.0", "@types/jsdom": "^21.1.1", - "@types/mapbox-gl": "^2.7.13", + "@types/mapbox-gl": "^3.4.1", "@types/node": "^22.9.0", "@types/papaparse": "^5.3.15", "@types/react": "^18.0.27", diff --git a/app/gui/src/project-view/components/CodeEditor/sync.ts b/app/gui/src/project-view/components/CodeEditor/sync.ts index a5b3f11cd766..88616e48d66f 100644 --- a/app/gui/src/project-view/components/CodeEditor/sync.ts +++ b/app/gui/src/project-view/components/CodeEditor/sync.ts @@ -4,7 +4,7 @@ import { changeSetToTextEdits } from '@/util/codemirror/text' import { useToast } from '@/util/toast' import { Annotation, - ChangeSet, + type ChangeSet, type EditorSelection, type Extension, type Text, @@ -12,23 +12,24 @@ import { import { EditorView } from '@codemirror/view' import { createDebouncer } from 'lib0/eventloop' import { onUnmounted, watch } from 'vue' -import { MutableModule } from 'ydoc-shared/ast' -import { SourceRangeEdit, textChangeToEdits } from 'ydoc-shared/util/data/text' +import { type SourceRangeEdit, textChangeToEdits } from 'ydoc-shared/util/data/text' import { type Origin } from 'ydoc-shared/yjsModel' // Indicates a change updating the text to correspond to the given module state. -const synchronizedModule = Annotation.define() +const synchronizedModule = Annotation.define() /** @returns A CodeMirror Extension that synchronizes the editor state with the AST of an Enso module. */ export function useEnsoSourceSync( projectStore: Pick, - graphStore: Pick, + graphStore: Pick< + GraphStore, + 'moduleSource' | 'viewModule' | 'startEdit' | 'commitEdit' | 'onBeforeEdit' + >, editorView: EditorView, ) { let pendingChanges: | { changes: ChangeSet; selectionBefore: EditorSelection; textBefore: Text } | undefined - let currentModule: MutableModule | undefined const notifyErrorToast = useToast.error() const notifyError = notifyErrorToast.show.bind(notifyErrorToast) @@ -36,12 +37,7 @@ export function useEnsoSourceSync( const debounceUpdates = createDebouncer(0) const updateListener: Extension = EditorView.updateListener.of((update) => { for (const transaction of update.transactions) { - const newModule = transaction.annotation(synchronizedModule) - if (newModule) { - // Flush the pipeline of edits that were based on the old module. - commitPendingChanges() - currentModule = newModule - } else if (transaction.docChanged && currentModule) { + if (transaction.docChanged && !transaction.annotation(synchronizedModule)) { pendingChanges = pendingChanges ? { @@ -63,29 +59,27 @@ export function useEnsoSourceSync( /** Set the editor contents to the current module state, discarding any pending editor-initiated changes. */ function resetView() { pendingChanges = undefined - currentModule = undefined const viewText = editorView.state.doc.toString() const code = graphStore.moduleSource.text const changes = textChangeToEdits(viewText, code) console.info('Resetting the editor to the module code.', changes) editorView.dispatch({ changes, - annotations: synchronizedModule.of(graphStore.startEdit()), + annotations: synchronizedModule.of(true), }) } /** Apply any pending changes to the currently-synchronized module, clearing the set of pending changes. */ function commitPendingChanges() { - if (!pendingChanges || !currentModule) return + if (!pendingChanges) return const { changes, selectionBefore, textBefore } = pendingChanges pendingChanges = undefined const edits = changeSetToTextEdits(changes) try { - const editedModule = currentModule.edit() + const editedModule = graphStore.startEdit() editedModule.applyTextEdits(edits, graphStore.viewModule) if (editedModule.root()?.code() === editorView.state.doc.toString()) { graphStore.commitEdit(editedModule, undefined, 'local:userAction:CodeEditor') - currentModule = editedModule return } } catch (error) { @@ -95,59 +89,51 @@ export function useEnsoSourceSync( editorView.dispatch({ changes: changes.invert(textBefore), selection: selectionBefore, - annotations: synchronizedModule.of(currentModule), + annotations: synchronizedModule.of(true), }) - if (currentModule.root()?.code() !== editorView.state.doc.toString()) { + if (graphStore.moduleSource.text !== editorView.state.doc.toString()) { console.warn('Unexpected: Applying inverted edit did not yield original module source') resetView() } } - let needResync = false + function beforeSourceChange({ origin }: { origin: Origin | undefined }) { + if (pendingChanges && origin !== 'local:userAction:CodeEditor') commitPendingChanges() + } + function observeSourceChange(textEdits: readonly SourceRangeEdit[], origin: Origin | undefined) { - // If we received an update from outside the Code Editor while the editor contained uncommitted changes, we cannot - // proceed incrementally; we wait for the changes to be merged as Y.Js AST updates, and then set the view to the - // resulting code. - if (needResync) { - if (!pendingChanges) { - resetView() - needResync = false - } - return - } - // When we aren't in the `needResync` state, we can ignore updates that originated in the Code Editor. - if (origin === 'local:userAction:CodeEditor') { - return - } - if (pendingChanges) { - console.info(`Deferring update (editor dirty).`) - needResync = true - return + if (origin !== 'local:userAction:CodeEditor') { + editorView.dispatch({ + changes: textEdits, + annotations: synchronizedModule.of(true), + }) } - - // If none of the above exit-conditions were reached, the transaction is applicable to our current state. - editorView.dispatch({ - changes: textEdits, - annotations: synchronizedModule.of(graphStore.startEdit()), - }) } - onUnmounted(() => graphStore.moduleSource.unobserve(observeSourceChange)) /** - * Starts synchronizing the editor with module updates. This must be called *after* installing the `updateListener` - * extension in the editor. + * Starts synchronizing the editor with module updates. This must be called (once) *after* installing the + * `updateListener` extension in the editor. */ function connectModuleListener() { + let cleanup: (() => void) | undefined = undefined watch( () => projectStore.module, (module, _oldValue, onCleanup) => { if (!module) return + const beforeEditHandler = graphStore.onBeforeEdit(beforeSourceChange) graphStore.moduleSource.observe(observeSourceChange) - onCleanup(() => graphStore.moduleSource.unobserve(observeSourceChange)) + cleanup = () => { + beforeEditHandler?.unregister() + graphStore.moduleSource.unobserve(observeSourceChange) + cleanup = undefined + } + onCleanup(cleanup) }, { immediate: true }, ) + onUnmounted(() => cleanup?.()) } + return { /** The extension to install in the editor. */ updateListener, diff --git a/app/gui/src/project-view/components/ComponentBrowser.vue b/app/gui/src/project-view/components/ComponentBrowser.vue index 29bfd8842f31..097ea1418282 100644 --- a/app/gui/src/project-view/components/ComponentBrowser.vue +++ b/app/gui/src/project-view/components/ComponentBrowser.vue @@ -378,7 +378,7 @@ const handler = componentBrowserBindings.handler({ :nodeSize="inputSize" :nodePosition="nodePosition" :scale="1" - :isCircularMenuVisible="false" + :isComponentMenuVisible="false" :isFullscreen="false" :isFullscreenAllowed="false" :isResizable="false" diff --git a/app/gui/src/project-view/components/ComponentMenu.vue b/app/gui/src/project-view/components/ComponentMenu.vue index 8911369d59ee..e40d7ceaa84b 100644 --- a/app/gui/src/project-view/components/ComponentMenu.vue +++ b/app/gui/src/project-view/components/ComponentMenu.vue @@ -13,7 +13,7 @@ const isDropdownOpened = ref(false)