From 0ba87417a9c63c48d9471a727b197302d21755fd Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Thu, 11 Dec 2025 07:00:57 +0800 Subject: [PATCH 1/4] Add a basic test to ensure that the pipe cache directory is correct --- .../elixir_lang/quoter/PipeLocationTest.kt | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tests/org/elixir_lang/quoter/PipeLocationTest.kt diff --git a/tests/org/elixir_lang/quoter/PipeLocationTest.kt b/tests/org/elixir_lang/quoter/PipeLocationTest.kt new file mode 100644 index 000000000..f22e6bd20 --- /dev/null +++ b/tests/org/elixir_lang/quoter/PipeLocationTest.kt @@ -0,0 +1,63 @@ +package org.elixir_lang.quoter + +import junit.framework.TestCase +import java.io.File + +/** + * Verifies that the quoter daemon creates pipes in cache/quoter_tmp_* + * instead of inside _build/ (which breaks Gradle caching). + */ +class PipeLocationTest : TestCase() { + + fun testPipesNotInBuildDirectory() { + val projectRoot = File(System.getProperty("user.dir")) + val cacheDir = File(projectRoot, "cache") + + // Find any _build directories in cache + val buildDirs = cacheDir.listFiles { file -> + file.isDirectory && file.name.contains("intellij_elixir") + }?.flatMap { quoterDir -> + File(quoterDir, "_build").walkTopDown() + .filter { it.name == "pipe" && it.isDirectory } + .toList() + } ?: emptyList() + + // Check no pipes exist in _build + for (pipeDir in buildDirs) { + val pipes = pipeDir.listFiles { f -> f.name.startsWith("erlang.pipe") } ?: emptyArray() + assertTrue( + "Found pipes in _build directory: ${pipeDir.absolutePath}. " + + "Pipes should be in cache/quoter_tmp_* via RELEASE_TMP.", + pipes.isEmpty() + ) + } + } + + fun testPipesInQuoterTmpDirectory() { + val projectRoot = File(System.getProperty("user.dir")) + val cacheDir = File(projectRoot, "cache") + + // Find quoter_tmp_* directories + val quoterTmpDirs = cacheDir.listFiles { file -> + file.isDirectory && file.name.startsWith("quoter_tmp_") + } ?: emptyArray() + + assertTrue( + "No quoter_tmp_* directory found in cache/. " + + "Expected RELEASE_TMP to create cache/quoter_tmp_/", + quoterTmpDirs.isNotEmpty() + ) + + // Check at least one has pipes (quoter should be running during tests) + val hasPipes = quoterTmpDirs.any { tmpDir -> + val pipeDir = File(tmpDir, "pipe") + pipeDir.exists() && (pipeDir.listFiles()?.isNotEmpty() == true) + } + + assertTrue( + "No pipes found in any quoter_tmp_*/pipe/ directory. " + + "Is the quoter daemon running?", + hasPipes + ) + } +} From eef019b5f2132c83947bc4410f949e19e0313a55 Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Thu, 11 Dec 2025 07:02:52 +0800 Subject: [PATCH 2/4] Now remove the doNotTrackState --- build.gradle.kts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b6a63b203..2d95cc4ef 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -351,9 +351,6 @@ val getQuoter by tasks.registering(Download::class) { val unzipQuoter by tasks.registering(Copy::class) { dependsOn(getQuoter) - // Prevent Gradle from snapshotting destination (may contain Erlang named pipes from previous runs) - doNotTrackState("Destination may contain named pipes from Erlang runtime") - // 1. Target the final destination directly into(quoterUnzippedPath) @@ -398,9 +395,6 @@ val getQuoterDeps by tasks.registering(Exec::class) { val releaseQuoter by tasks.registering(Exec::class) { dependsOn(getQuoterDeps) - // Prevent caching - _build directory may contain Erlang named pipes - doNotTrackState("Build directory contains Erlang named pipes that cannot be cached") - // 1. Use Directory object directly (No .asFile) workingDir(quoterUnzippedPath) From 24a872ebfc9d182cf203ba86b7c295c03b69bb45 Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Thu, 11 Dec 2025 07:11:56 +0800 Subject: [PATCH 3/4] Tweak GitHub Actions caches/settings --- .github/actions/setup-env/action.yml | 37 +++++++++++----------------- .github/workflows/publish-canary.yml | 1 - .github/workflows/release.yml | 2 -- .github/workflows/shared-test.yml | 7 +++--- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 7690e94b0..bc292eb8d 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -15,10 +15,6 @@ inputs: description: 'IntelliJ IDEA version to test against. Keep in sync with matrix-setup in shared-test.yml' required: false default: '253.28294.334' # 2025.3 - should match first version in shared-test.yml - skip-jcef: - description: 'Skip JCEF package (set to true for release/verifyPlugin jobs). Default is false.' - required: false - default: 'false' gradle-cache-read-only: description: 'Use read-only Gradle cache (for non-main branches or matrix jobs). Default is true.' required: false @@ -26,6 +22,10 @@ inputs: github-token: description: 'GitHub token for API access (required for setup-java to download JBR)' required: true + build-scan-publish: + description: 'Whether to publish Gradle build scans' + required: false + default: 'false' runs: using: composite @@ -34,15 +34,15 @@ runs: id: free-disk-space uses: jlumbroso/free-disk-space@v1.3.1 with: - tool-cache: false - large-packages: false + tool-cache: false + large-packages: false - name: Cache JetBrains JDK id: cache-jdk - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: /opt/hostedtoolcache/Java_JetBrains_* - key: jdk-${{ runner.os }}-${{ runner.arch }}-jetbrains-21-${{ inputs.skip-jcef == 'false' && 'jcef' || 'nojcef' }} + key: jdk-${{ runner.os }}-${{ runner.arch }}-jetbrains-21 - name: Setup JBR 21 id: setup-java @@ -50,30 +50,23 @@ runs: with: distribution: 'jetbrains' java-version: 21 - java-package: ${{ inputs.skip-jcef == 'false' && 'jdk+jcef' || 'jdk' }} - env: - GITHUB_TOKEN: ${{ inputs.github-token }} + java-package: 'jdk' + token: ${{ inputs.github-token }} - name: Setup Gradle id: setup-gradle uses: gradle/actions/setup-gradle@v5 with: - cache-read-only: ${{ inputs.gradle-cache-read-only == 'true' }} - cache-overwrite-existing: false - gradle-home-cache-cleanup: true + cache-read-only: true add-job-summary-as-pr-comment: 'on-failure' -# # Exclude IntelliJ IDE downloads and extractions from cache (~10GB) -# # These are fast to re-download and would bloat the cache -# gradle-home-cache-excludes: | -# caches/modules-2/files-2.1/idea -# caches/*/transforms - build-scan-publish: true + build-scan-publish: ${{ inputs.build-scan-publish }} build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service' build-scan-terms-of-use-agree: 'yes' + github-token: ${{ inputs.github-token }} - name: Restore Elixir cache id: cache-elixir-restore - uses: actions/cache/restore@v4 + uses: actions/cache/restore@v5 with: path: | cache/elixir-${{ inputs.elixir-version }}-intellij_elixir-2.1.0/_build @@ -105,7 +98,7 @@ runs: - name: Save Elixir cache id: cache-elixir-save if: always() && inputs.gradle-cache-read-only != 'true' && steps.cache-elixir-restore.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 + uses: actions/cache/save@v5 with: path: | cache/elixir-${{ inputs.elixir-version }}-intellij_elixir-2.1.0/_build diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml index 1f0305a94..028757f0b 100644 --- a/.github/workflows/publish-canary.yml +++ b/.github/workflows/publish-canary.yml @@ -15,7 +15,6 @@ jobs: id: setup-env uses: ./.github/actions/setup-env with: - skip-jcef: 'true' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download Release Asset diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99777facb..aea98dd79 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,6 @@ jobs: id: setup-env uses: ./.github/actions/setup-env with: - elixir-version: '' - skip-jcef: 'true' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build with Gradle diff --git a/.github/workflows/shared-test.yml b/.github/workflows/shared-test.yml index 2a41e6adc..dcc19071b 100644 --- a/.github/workflows/shared-test.yml +++ b/.github/workflows/shared-test.yml @@ -65,7 +65,7 @@ jobs: elixir-version: ${{ inputs.elixir-version || '1.13.4' }} otp-version: ${{ inputs.otp-version || '24.3.4.6' }} idea-version: ${{ matrix.idea-version }} - gradle-cache-read-only: ${{ github.ref != 'refs/heads/main' }} + gradle-cache-read-only: true github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run Tests @@ -111,13 +111,12 @@ jobs: uses: ./.github/actions/setup-env with: idea-version: ${{ matrix.idea-version }} - gradle-cache-read-only: ${{ github.ref != 'refs/heads/main' }} - skip-jcef: 'true' github-token: ${{ secrets.GITHUB_TOKEN }} + build-scan-publish: true - name: Run Plugin Verifier id: verify-plugin - run: ./gradlew --stacktrace verifyPlugin + run: ./gradlew verifyPlugin - name: Upload Verify Reports id: upload-verify-reports From bfe19de6d8359639f486044ccdae27fbc4c61e5f Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Fri, 12 Dec 2025 23:57:53 +0800 Subject: [PATCH 4/4] reduce dependabot --- .github/dependabot.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a71785b2e..8151b508d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,17 +6,17 @@ updates: directory: "/" schedule: interval: "daily" - cooldown: - default-days: 5 - semver-major-days: 30 - semver-minor-days: 7 - semver-patch-days: 3 +# cooldown: +# default-days: 5 +# semver-major-days: 30 +# semver-minor-days: 7 +# semver-patch-days: 3 - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" - cooldown: - default-days: 5 - semver-major-days: 30 - semver-minor-days: 7 - semver-patch-days: 3 +# cooldown: +# default-days: 5 +# semver-major-days: 30 +# semver-minor-days: 7 +# semver-patch-days: 3