From 63786b8e473e658e21144d5dde8bb4d92929c4b8 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 12:07:51 -0400 Subject: [PATCH 01/98] feat: temp add push to test and disable fail-fast --- .github/workflows/run-all-unit-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index df7de24a..5f0d7c14 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -14,6 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] @@ -26,6 +27,6 @@ jobs: cache: 'npm' - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' - run: loginctl enable-linger admin + run: loginctl enable-linger $(whoami) - run: npm ci - run: npm run test -- ./test --no-file-parallelism --disable-console-intercept From 1e3d908dd41c6a4b73defb7495c663383b454fc5 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 12:36:16 -0400 Subject: [PATCH 02/98] feat: added circleCI config --- .circleci/config.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..d39c90fa --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,53 @@ +version: 2.1 + +jobs: + test: + parameters: + executor: + type: executor + executor: << parameters.executor >> + steps: + - checkout + - node/install: + node-version: '24' + - when: + condition: + matches: + pattern: "^linux.*" + value: << parameters.executor >> + steps: + - run: + name: Enable linger for current user (Linux only) + command: loginctl enable-linger $(whoami) + - run: + name: Install dependencies + command: npm ci + - run: + name: Run tests + command: npm run test -- ./test --no-file-parallelism --disable-console-intercept + no_output_timeout: 30m + +orbs: + node: circleci/node@6 + +executors: + linux-x86: + machine: + image: ubuntu-2404:current + resource_class: medium + linux-arm: + machine: + image: ubuntu-2404:current + resource_class: arm.medium + macos: + macos: + xcode: '16.2.0' + resource_class: macos.m1.medium.gen1 + +workflows: + test-all: + jobs: + - test: + matrix: + parameters: + executor: [linux-x86, linux-arm, macos] From 1b40b5cf06e3320a9e14259922bbe055e615e6a8 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 12:38:29 -0400 Subject: [PATCH 03/98] fix: circleCI config --- .circleci/config.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d39c90fa..fa3adf8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,15 +10,12 @@ jobs: - checkout - node/install: node-version: '24' - - when: - condition: - matches: - pattern: "^linux.*" - value: << parameters.executor >> - steps: - - run: - name: Enable linger for current user (Linux only) - command: loginctl enable-linger $(whoami) + - run: + name: Enable linger for current user (Linux only) + command: | + if [[ "$OSTYPE" == "linux"* ]]; then + loginctl enable-linger $(whoami) + fi - run: name: Install dependencies command: npm ci From fdce81cc7a6551fb5b3a395929b9b6a967d14f96 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 13:27:57 -0400 Subject: [PATCH 04/98] fix: changed macOS config and disabled github actions --- .circleci/config.yml | 20 ++++++++++---------- .github/workflows/run-all-unit-tests.yaml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa3adf8e..dd4e680f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,18 +28,18 @@ orbs: node: circleci/node@6 executors: - linux-x86: - machine: - image: ubuntu-2404:current - resource_class: medium - linux-arm: - machine: - image: ubuntu-2404:current - resource_class: arm.medium +# linux-x86: +# machine: +# image: ubuntu-2404:current +# resource_class: medium +# linux-arm: +# machine: +# image: ubuntu-2404:current +# resource_class: arm.medium macos: macos: - xcode: '16.2.0' - resource_class: macos.m1.medium.gen1 + xcode: '26.4.0' + resource_class: m4pro.medium workflows: test-all: diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 5f0d7c14..c917ee5f 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -4,7 +4,7 @@ name: Test all on Demand on: - push: +# push: # schedule: # - cron: '0 0 * * 0' # Every Sunday at midnight UTC workflow_dispatch: From fb41ce1caab6f1e2719b2d1c9a66d08560c03bf0 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 13:29:19 -0400 Subject: [PATCH 05/98] fix: circleci config --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd4e680f..b82575e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,14 +28,14 @@ orbs: node: circleci/node@6 executors: -# linux-x86: -# machine: -# image: ubuntu-2404:current -# resource_class: medium -# linux-arm: -# machine: -# image: ubuntu-2404:current -# resource_class: arm.medium + linux-x86: + machine: + image: ubuntu-2404:current + resource_class: medium + linux-arm: + machine: + image: ubuntu-2404:current + resource_class: arm.medium macos: macos: xcode: '26.4.0' @@ -47,4 +47,4 @@ workflows: - test: matrix: parameters: - executor: [linux-x86, linux-arm, macos] + executor: [macos] From 4b6bf8f572e3493b8e34d1440b9707ba066cd9ba Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 13:56:55 -0400 Subject: [PATCH 06/98] fix: on linux chowned dirs so that ubuntu can access them without root --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b82575e8..c82299a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,9 @@ jobs: command: | if [[ "$OSTYPE" == "linux"* ]]; then loginctl enable-linger $(whoami) + +# Reset file permissions + sudo chown -R ubuntu:ubuntu /usr/local /opt /var/tmp fi - run: name: Install dependencies @@ -47,4 +50,4 @@ workflows: - test: matrix: parameters: - executor: [macos] + executor: [linux-arm] From 1f9a3f8efdce9ccfbcb7fc4182481e0b18e51d1a Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 13:57:23 -0400 Subject: [PATCH 07/98] fix: on linux chowned dirs so that ubuntu can access them without root --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c82299a0..63746593 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,8 +15,6 @@ jobs: command: | if [[ "$OSTYPE" == "linux"* ]]; then loginctl enable-linger $(whoami) - -# Reset file permissions sudo chown -R ubuntu:ubuntu /usr/local /opt /var/tmp fi - run: From 05bdb3a76acdb9c3f22e5e6a806e5bceb15fabb6 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 14:45:32 -0400 Subject: [PATCH 08/98] fix: switched user for chown. Added cleanup script --- .circleci/config.yml | 8 ++++++-- scripts/cleanup-circleci.ts | 28 ++++++++++++++++++++++++++++ test/asdf/asdf.test.ts | 2 +- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 scripts/cleanup-circleci.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index 63746593..ff2d78b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,14 +15,18 @@ jobs: command: | if [[ "$OSTYPE" == "linux"* ]]; then loginctl enable-linger $(whoami) - sudo chown -R ubuntu:ubuntu /usr/local /opt /var/tmp + sudo chown -R circleci:circleci /usr/local /opt /var/tmp fi - run: name: Install dependencies command: npm ci + - run: + name: Clean up pre-installed tools + command: npx tsx scripts/cleanup-circleci.ts + no_output_timeout: 10m - run: name: Run tests - command: npm run test -- ./test --no-file-parallelism --disable-console-intercept + command: npm run test -- ./test/node/npm/npm.test.ts --no-file-parallelism --disable-console-intercept no_output_timeout: 30m orbs: diff --git a/scripts/cleanup-circleci.ts b/scripts/cleanup-circleci.ts new file mode 100644 index 00000000..119e1e9b --- /dev/null +++ b/scripts/cleanup-circleci.ts @@ -0,0 +1,28 @@ +import { PluginTester, testSpawn } from '@codifycli/plugin-test'; +import path from 'node:path'; + +const pluginPath = path.resolve('../src/index.ts'); + +// Uninstall resources that have Codify resource definitions +await PluginTester.uninstall(pluginPath, [ + { type: 'pyenv' }, + { type: 'rbenv' }, + { type: 'uv' }, +]); + +// Remove pre-installed tools that don't have Codify resources +// Go +await testSpawn('rm -rf /usr/local/go', { requiresRoot: true }); + +// Google Cloud SDK +await testSpawn('rm -rf /opt/google/google-cloud-sdk', { requiresRoot: true }); + +// Apache Maven +await testSpawn('rm -rf /usr/local/apache-maven', { requiresRoot: true }); + +// Gradle +await testSpawn('rm -rf /usr/local/gradle-*', { requiresRoot: true }); + +// Yarn (installed via ~/.yarn and ~/.config/yarn) +await testSpawn('rm -rf ~/.yarn ~/.config/yarn'); + diff --git a/test/asdf/asdf.test.ts b/test/asdf/asdf.test.ts index db9e9978..e8ffadd2 100644 --- a/test/asdf/asdf.test.ts +++ b/test/asdf/asdf.test.ts @@ -27,7 +27,7 @@ describe('Asdf tests', async () => { }, validateDestroy: async () => { expect(await testSpawn('which asdf')).toMatchObject({ status: SpawnStatus.ERROR }); - expect(await testSpawn('which go')).toMatchObject({ status: SpawnStatus.ERROR }); + // expect(await testSpawn('which go')).toMatchObject({ status: SpawnStatus.ERROR }); } }); }) From 507b873faf830f13d473495b1cbef37bea887299 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 14:47:13 -0400 Subject: [PATCH 09/98] fix: path in script --- scripts/cleanup-circleci.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup-circleci.ts b/scripts/cleanup-circleci.ts index 119e1e9b..9b81fdbb 100644 --- a/scripts/cleanup-circleci.ts +++ b/scripts/cleanup-circleci.ts @@ -1,7 +1,7 @@ import { PluginTester, testSpawn } from '@codifycli/plugin-test'; import path from 'node:path'; -const pluginPath = path.resolve('../src/index.ts'); +const pluginPath = path.resolve('./src/index.ts'); // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ From 0db262086b4e5b38d6d50b6ec9038d255c84fb58 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 14:50:34 -0400 Subject: [PATCH 10/98] fix updated rbenv --- src/resources/ruby/rbenv/rbenv.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resources/ruby/rbenv/rbenv.ts b/src/resources/ruby/rbenv/rbenv.ts index 7918620b..5a2d5c52 100644 --- a/src/resources/ruby/rbenv/rbenv.ts +++ b/src/resources/ruby/rbenv/rbenv.ts @@ -95,7 +95,8 @@ async function uninstallOnMacOS(): Promise { async function uninstallOnLinux(): Promise { const $ = getPty(); - await $.spawn(`rm -rf ${RBENV_ROOT}`); + await $.spawnSafe(`rm -rf ${RBENV_ROOT}`); + await $.spawnSafe('rm -f /usr/bin/rbenv'); await removeRbenvFromShellRc([RBENV_PATH_EXPORT, RBENV_INIT]); } From 22adcec03131e4083550ca8bf16e7c21abfdd6ec Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 14:52:08 -0400 Subject: [PATCH 11/98] fix added requires root --- src/resources/ruby/rbenv/rbenv.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/resources/ruby/rbenv/rbenv.ts b/src/resources/ruby/rbenv/rbenv.ts index 5a2d5c52..28d9fa3a 100644 --- a/src/resources/ruby/rbenv/rbenv.ts +++ b/src/resources/ruby/rbenv/rbenv.ts @@ -96,7 +96,9 @@ async function uninstallOnMacOS(): Promise { async function uninstallOnLinux(): Promise { const $ = getPty(); await $.spawnSafe(`rm -rf ${RBENV_ROOT}`); - await $.spawnSafe('rm -f /usr/bin/rbenv'); + if (await FileUtils.fileExists('/usr/bin/rbenv')) { + await $.spawn('rm -f /usr/bin/rbenv', { requiresRoot: true }); + } await removeRbenvFromShellRc([RBENV_PATH_EXPORT, RBENV_INIT]); } From 08a63398a99fddfbaa35333ec3b2b1763a7906d7 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 14:53:31 -0400 Subject: [PATCH 12/98] fix remove uv from cleanup --- scripts/cleanup-circleci.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/cleanup-circleci.ts b/scripts/cleanup-circleci.ts index 9b81fdbb..2eed5d4f 100644 --- a/scripts/cleanup-circleci.ts +++ b/scripts/cleanup-circleci.ts @@ -7,7 +7,6 @@ const pluginPath = path.resolve('./src/index.ts'); await PluginTester.uninstall(pluginPath, [ { type: 'pyenv' }, { type: 'rbenv' }, - { type: 'uv' }, ]); // Remove pre-installed tools that don't have Codify resources From 62fabaa426a9a691ef95a53f4f04d66b6ad23d03 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 15:02:39 -0400 Subject: [PATCH 13/98] feat: enable all linux tests again --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff2d78b9..d1e54b44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ jobs: no_output_timeout: 10m - run: name: Run tests - command: npm run test -- ./test/node/npm/npm.test.ts --no-file-parallelism --disable-console-intercept + command: npm run test -- ./test --no-file-parallelism --disable-console-intercept no_output_timeout: 30m orbs: From 19ec5ac4a099b37be4a962aae34234d579d644fd Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 15:47:59 -0400 Subject: [PATCH 14/98] feat: switch back to github actions --- .circleci/config.yml | 14 +++++++------- .github/workflows/run-all-unit-tests.yaml | 6 ++++-- src/resources/ollama/models-parameter.ts | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1e54b44..01664a4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,10 +46,10 @@ executors: xcode: '26.4.0' resource_class: m4pro.medium -workflows: - test-all: - jobs: - - test: - matrix: - parameters: - executor: [linux-arm] +#workflows: +# test-all: +# jobs: +# - test: +# matrix: +# parameters: +# executor: [linux-arm] diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index c917ee5f..e3849d79 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -4,7 +4,7 @@ name: Test all on Demand on: -# push: + push: # schedule: # - cron: '0 0 * * 0' # Every Sunday at midnight UTC workflow_dispatch: @@ -16,7 +16,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] + os: [ubuntu-latest] +# os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] steps: - uses: actions/checkout@v4 @@ -29,4 +30,5 @@ jobs: if: runner.os == 'Linux' run: loginctl enable-linger $(whoami) - run: npm ci + - run: npx tsx scripts/cleanup-circleci.ts - run: npm run test -- ./test --no-file-parallelism --disable-console-intercept diff --git a/src/resources/ollama/models-parameter.ts b/src/resources/ollama/models-parameter.ts index b3ed3820..07a55196 100644 --- a/src/resources/ollama/models-parameter.ts +++ b/src/resources/ollama/models-parameter.ts @@ -16,7 +16,7 @@ async function ensureOllamaServerRunning(): Promise { if (Utils.isMacOS()) { await $.spawn('brew services start ollama', { interactive: true }); } else { - await $.spawn('sudo systemctl start ollama', { interactive: true }); + await $.spawn('systemctl start ollama', { interactive: true, requiresRoot: true }); } // Give the server a moment to become ready From 3ac1f188bb5e547c0cdb6926ab9b13bab5bc87bf Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 15:50:02 -0400 Subject: [PATCH 15/98] feat: add ssh --- .github/workflows/run-all-unit-tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index e3849d79..d536ef64 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -26,6 +26,8 @@ jobs: with: node-version: '24.x' cache: 'npm' + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' run: loginctl enable-linger $(whoami) From a0429bc11ace6c5f37c49bfafae209f962a3826d Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 16:01:05 -0400 Subject: [PATCH 16/98] feat: add github actions cleanup --- .github/workflows/run-all-unit-tests.yaml | 8 +++-- scripts/cleanup-github-actions.ts | 39 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 scripts/cleanup-github-actions.ts diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index d536ef64..fc1cea0e 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -26,11 +26,13 @@ jobs: with: node-version: '24.x' cache: 'npm' - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' run: loginctl enable-linger $(whoami) - run: npm ci - - run: npx tsx scripts/cleanup-circleci.ts + - run: npx tsx scripts/cleanup-github-actions.ts + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - run: npm run test -- ./test --no-file-parallelism --disable-console-intercept diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts new file mode 100644 index 00000000..ee0631d9 --- /dev/null +++ b/scripts/cleanup-github-actions.ts @@ -0,0 +1,39 @@ +import { PluginTester, testSpawn } from '@codifycli/plugin-test'; +import path from 'node:path'; + +const pluginPath = path.resolve('./src/index.ts'); + +// Uninstall resources that have Codify resource definitions +await PluginTester.uninstall(pluginPath, [ + { type: 'docker' } +]); + +// Remove pre-installed tools that don't have Codify resources +// Python — remove all python-related binaries and symlinks +await testSpawn('bash -c \'rm -f /usr/bin/python* /usr/local/bin/python*\'', { requiresRoot: true }); + + +// Go +await testSpawn('bash -c \'rm -f /usr/bin/go* /usr/local/bin/go* && rm -rf /usr/local/go\'', { requiresRoot: true }); + +// Ruby — remove binaries and gems +await testSpawn('bash -c \'rm -f /usr/bin/ruby* /usr/local/bin/ruby* /usr/bin/gem* /usr/local/bin/gem*\'', { requiresRoot: true }); + +// Zig +await testSpawn('bash -c \'rm -f /usr/bin/zig* /usr/local/bin/zig*\'', { requiresRoot: true }); + +// Google Cloud SDK +await testSpawn('rm -rf /opt/google/google-cloud-sdk', { requiresRoot: true }); + +// Apache Maven +await testSpawn('rm -rf /usr/local/apache-maven', { requiresRoot: true }); + +// Gradle +await testSpawn('rm -rf /usr/local/gradle-*', { requiresRoot: true }); + +// Yarn (installed via ~/.yarn and ~/.config/yarn) +await testSpawn('rm -rf ~/.yarn ~/.config/yarn'); + +// Docker — remove user-level config and data directories +await testSpawn('rm -rf ~/.docker'); + From 22297286e599921fcb81724c053fd590a5229aeb Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 21:23:30 -0400 Subject: [PATCH 17/98] feat: add github actions cleanup --- scripts/cleanup-github-actions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index ee0631d9..6dfc3b2d 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -5,7 +5,11 @@ const pluginPath = path.resolve('./src/index.ts'); // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ - { type: 'docker' } + { + type: 'apt', + install: ['go', 'docker', 'python', 'rust'] + }, + { type: 'docker' }, ]); // Remove pre-installed tools that don't have Codify resources From 83fbffaafd0be07861920662f6a7cdc7cb66b04b Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 21:28:54 -0400 Subject: [PATCH 18/98] feat: add github actions cleanup --- scripts/cleanup-github-actions.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 6dfc3b2d..855487ac 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -5,13 +5,11 @@ const pluginPath = path.resolve('./src/index.ts'); // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ - { - type: 'apt', - install: ['go', 'docker', 'python', 'rust'] - }, { type: 'docker' }, ]); +await testSpawn('apt-get autoremove -y golang docker-ce python rust ruby rpm python3 python php', { requiresRoot: true }) + // Remove pre-installed tools that don't have Codify resources // Python — remove all python-related binaries and symlinks await testSpawn('bash -c \'rm -f /usr/bin/python* /usr/local/bin/python*\'', { requiresRoot: true }); From 51f6e75e6b145e9104e76427e696038f2b88067f Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 21:31:23 -0400 Subject: [PATCH 19/98] feat: add github actions cleanup --- .github/workflows/run-all-unit-tests.yaml | 6 +++--- scripts/cleanup-github-actions.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index fc1cea0e..e17d9fe5 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -31,8 +31,8 @@ jobs: run: loginctl enable-linger $(whoami) - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - run: npm run test -- ./test --no-file-parallelism --disable-console-intercept diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 855487ac..66e17db2 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -8,7 +8,7 @@ await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, ]); -await testSpawn('apt-get autoremove -y golang docker-ce python rust ruby rpm python3 python php', { requiresRoot: true }) +await testSpawn('apt-get autoremove -y golang ruby rpm python3 php zig', { requiresRoot: true }) // Remove pre-installed tools that don't have Codify resources // Python — remove all python-related binaries and symlinks From f80516ddb6cb5eaea27cf377d23a004f25d49fff Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 21:34:19 -0400 Subject: [PATCH 20/98] feat: add github actions cleanup --- scripts/cleanup-github-actions.ts | 32 +------------------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 66e17db2..24819cb7 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -8,34 +8,4 @@ await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, ]); -await testSpawn('apt-get autoremove -y golang ruby rpm python3 php zig', { requiresRoot: true }) - -// Remove pre-installed tools that don't have Codify resources -// Python — remove all python-related binaries and symlinks -await testSpawn('bash -c \'rm -f /usr/bin/python* /usr/local/bin/python*\'', { requiresRoot: true }); - - -// Go -await testSpawn('bash -c \'rm -f /usr/bin/go* /usr/local/bin/go* && rm -rf /usr/local/go\'', { requiresRoot: true }); - -// Ruby — remove binaries and gems -await testSpawn('bash -c \'rm -f /usr/bin/ruby* /usr/local/bin/ruby* /usr/bin/gem* /usr/local/bin/gem*\'', { requiresRoot: true }); - -// Zig -await testSpawn('bash -c \'rm -f /usr/bin/zig* /usr/local/bin/zig*\'', { requiresRoot: true }); - -// Google Cloud SDK -await testSpawn('rm -rf /opt/google/google-cloud-sdk', { requiresRoot: true }); - -// Apache Maven -await testSpawn('rm -rf /usr/local/apache-maven', { requiresRoot: true }); - -// Gradle -await testSpawn('rm -rf /usr/local/gradle-*', { requiresRoot: true }); - -// Yarn (installed via ~/.yarn and ~/.config/yarn) -await testSpawn('rm -rf ~/.yarn ~/.config/yarn'); - -// Docker — remove user-level config and data directories -await testSpawn('rm -rf ~/.docker'); - +await testSpawn('apt-get autoremove -y golang ruby rpm python3 php', { requiresRoot: true }) From 7d1d33e0dc268fa4c4efd4ad4e1aac8901f1cc2e Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 22:02:23 -0400 Subject: [PATCH 21/98] feat: add github actions cleanup --- .github/workflows/run-all-unit-tests.yaml | 6 +++--- scripts/cleanup-github-actions.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index e17d9fe5..fc1cea0e 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -31,8 +31,8 @@ jobs: run: loginctl enable-linger $(whoami) - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts -# -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - run: npm run test -- ./test --no-file-parallelism --disable-console-intercept diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 24819cb7..9c7c4b21 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -8,4 +8,4 @@ await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, ]); -await testSpawn('apt-get autoremove -y golang ruby rpm python3 php', { requiresRoot: true }) +await testSpawn('apt-get autoremove -y ruby rpm python3 rustc golang', { requiresRoot: true }) From 8523250c3a467968d3d4dd9727906705d05ab658 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 22:21:24 -0400 Subject: [PATCH 22/98] feat: add github actions cleanup --- scripts/cleanup-github-actions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 9c7c4b21..14c17e48 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -6,6 +6,10 @@ const pluginPath = path.resolve('./src/index.ts'); // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, + { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby rpm python3 rustc golang', { requiresRoot: true }) +await testSpawn('apt-get autoremove -y ruby* rpm python*', { requiresRoot: true }); +await testSpawn('rustup self uninstall -y'); + +await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) From b8358c9e0e9d5ad195d0cf2e011fe628ef8b6382 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 22:25:25 -0400 Subject: [PATCH 23/98] feat: add github actions cleanup --- scripts/cleanup-github-actions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 14c17e48..b5ad8c00 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -9,7 +9,9 @@ await PluginTester.uninstall(pluginPath, [ { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby* rpm python*', { requiresRoot: true }); +await testSpawn('apt-get autoremove -y ruby rpm python', { requiresRoot: true }); await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) +await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) +await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) From b7d0f5a4184150e17ebcd8bf11d0199ecc5792f8 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 23:53:15 -0400 Subject: [PATCH 24/98] feat: improve aws cleanup --- .github/workflows/run-all-unit-tests.yaml | 6 +++--- scripts/cleanup-github-actions.ts | 1 + src/resources/aws-cli/cli/aws-cli.ts | 14 +++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index fc1cea0e..1e9c1671 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -32,7 +32,7 @@ jobs: - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - - run: npm run test -- ./test --no-file-parallelism --disable-console-intercept + - run: npm run test -- ./test/aws-cli --no-file-parallelism --silent=passed-only diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index b5ad8c00..287cc7cc 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -14,4 +14,5 @@ await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) +await testSpawn('rm -rf /usr/bin/python3', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) diff --git a/src/resources/aws-cli/cli/aws-cli.ts b/src/resources/aws-cli/cli/aws-cli.ts index 7ad09a2a..3519894c 100644 --- a/src/resources/aws-cli/cli/aws-cli.ts +++ b/src/resources/aws-cli/cli/aws-cli.ts @@ -109,9 +109,17 @@ softwareupdate --install-rosetta return; } - await $.spawnSafe(`rm ${installLocation}`, { requiresRoot: true }); - await $.spawnSafe(`rm ${installLocation}_completer`, { requiresRoot: true }); - await $.spawnSafe('rm -rf $HOME/.aws/'); + if (Utils.isLinux()) { + // Remove symlinks from bin dir + await $.spawnSafe('rm -f /usr/local/bin/aws', { requiresRoot: true }); + await $.spawnSafe('rm -f /usr/local/bin/aws_completer', { requiresRoot: true }); + + // Remove the install directory (always /usr/local/aws-cli for the standalone installer) + await $.spawnSafe('rm -rf /usr/local/aws-cli', { requiresRoot: true }); + } else { + await $.spawnSafe(`rm ${installLocation}`, { requiresRoot: true }); + await $.spawnSafe(`rm ${installLocation}_completer`, { requiresRoot: true }); + } } private async findInstallLocation(): Promise { From 2fd87a4df6a784cf1fbaf4062df4e7f74c929a52 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Tue, 21 Apr 2026 23:56:28 -0400 Subject: [PATCH 25/98] feat: enable all tests once more --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 1e9c1671..340260d3 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -35,4 +35,4 @@ jobs: # - name: Setup tmate session # uses: mxschmitt/action-tmate@v3 - - run: npm run test -- ./test/aws-cli --no-file-parallelism --silent=passed-only + - run: npm run test -- ./test --no-file-parallelism --silent=passed-only From 7f7f3016421522aed78832cd786bb9b94c45f6ce Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 00:24:32 -0400 Subject: [PATCH 26/98] feat: enable all tests once more --- .github/workflows/run-all-unit-tests.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 340260d3..e756ac0a 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -28,7 +28,9 @@ jobs: cache: 'npm' - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' - run: loginctl enable-linger $(whoami) + run: + loginctl enable-linger $(whoami) + sudo rm -f /etc/apt/apt.conf.d/50command-not-found - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts From 5dc6e5842ec170531b166d20bf2092ed90203599 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:18:43 -0400 Subject: [PATCH 27/98] feat: added command not found --- .github/workflows/run-all-unit-tests.yaml | 7 +++---- scripts/cleanup-github-actions.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index e756ac0a..98503ae5 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -29,12 +29,11 @@ jobs: - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' run: - loginctl enable-linger $(whoami) - sudo rm -f /etc/apt/apt.conf.d/50command-not-found + loginctl enable-linger $(whoami - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - run: npm run test -- ./test --no-file-parallelism --silent=passed-only diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 287cc7cc..0bdc15ee 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -9,7 +9,7 @@ await PluginTester.uninstall(pluginPath, [ { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby rpm python', { requiresRoot: true }); +await testSpawn('apt-get autoremove -y ruby rpm python command-not-found', { requiresRoot: true }); await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) From 71b6a736be6a0b7edfac5098239a38d9c67b21ad Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:19:39 -0400 Subject: [PATCH 28/98] feat: added command not found --- .github/workflows/run-all-unit-tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 98503ae5..2c6f5918 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -28,8 +28,7 @@ jobs: cache: 'npm' - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' - run: - loginctl enable-linger $(whoami + run: loginctl enable-linger $(whoami) - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts From 820b7b70d45299832b08eed4d4928a220bb0199f Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:37:21 -0400 Subject: [PATCH 29/98] feat: added command not found --- scripts/cleanup-github-actions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 0bdc15ee..7d5c5eb3 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -9,10 +9,14 @@ await PluginTester.uninstall(pluginPath, [ { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby rpm python command-not-found', { requiresRoot: true }); +await testSpawn('apt-get autoremove -y ruby rpm python', { requiresRoot: true }); await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python3', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) + +await testSpawn('rm -rf /var/lib/command-not-found/*', { requiresRoot: true }); +await testSpawn('apt update', { requiresRoot: true }); +await testSpawn('/usr/lib/cnf-update-db', { requiresRoot: true }) From e5e21065b2896affb8b47d209e8b8ec674248721 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:40:21 -0400 Subject: [PATCH 30/98] feat: added command not found --- scripts/cleanup-github-actions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 7d5c5eb3..5deb3125 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -17,6 +17,6 @@ await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python3', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) -await testSpawn('rm -rf /var/lib/command-not-found/*', { requiresRoot: true }); -await testSpawn('apt update', { requiresRoot: true }); -await testSpawn('/usr/lib/cnf-update-db', { requiresRoot: true }) +// await testSpawn('rm -rf /var/lib/command-not-found/*', { requiresRoot: true }); +// await testSpawn('apt update', { requiresRoot: true }); +// await testSpawn('/usr/lib/cnf-update-db', { requiresRoot: true }) From d5976b95bd766a62c7d740893234a73aec38a4e9 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:41:54 -0400 Subject: [PATCH 31/98] feat: added command not found --- scripts/cleanup-github-actions.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 5deb3125..44cebc7d 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -17,6 +17,4 @@ await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python3', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) -// await testSpawn('rm -rf /var/lib/command-not-found/*', { requiresRoot: true }); -// await testSpawn('apt update', { requiresRoot: true }); -// await testSpawn('/usr/lib/cnf-update-db', { requiresRoot: true }) +await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true }); From eb42ea04910eb6ef1f95e0ec866c6cc685e94473 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:45:26 -0400 Subject: [PATCH 32/98] feat: added command not found --- scripts/cleanup-github-actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 44cebc7d..272df3d6 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -6,7 +6,7 @@ const pluginPath = path.resolve('./src/index.ts'); // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, - { type: 'aws-cli'} + // { type: 'aws-cli'} ]); await testSpawn('apt-get autoremove -y ruby rpm python', { requiresRoot: true }); @@ -17,4 +17,4 @@ await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python3', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) -await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true }); +// await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true }); From 131ddf53ee16becc413b34841652bef1589e7185 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:48:25 -0400 Subject: [PATCH 33/98] feat: added command not found --- .github/workflows/run-all-unit-tests.yaml | 5 +++-- scripts/cleanup-github-actions.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 2c6f5918..86193787 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -29,10 +29,11 @@ jobs: - name: Enable linger for admin user (Linux only) if: runner.os == 'Linux' run: loginctl enable-linger $(whoami) - - run: npm ci - - run: npx tsx scripts/cleanup-github-actions.ts - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + - run: npm ci + - run: npx tsx scripts/cleanup-github-actions.ts + - run: npm run test -- ./test --no-file-parallelism --silent=passed-only diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 272df3d6..cf1842a7 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -6,10 +6,10 @@ const pluginPath = path.resolve('./src/index.ts'); // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, - // { type: 'aws-cli'} + { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby rpm python', { requiresRoot: true }); +await testSpawn('apt-get autoremove -y ruby rpm python command-not-found', { requiresRoot: true }); await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) From 77f9b219770503b7adcf3284695c5131087888c4 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:57:45 -0400 Subject: [PATCH 34/98] feat: keep system python3 --- scripts/cleanup-github-actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index cf1842a7..4249a688 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -3,18 +3,18 @@ import path from 'node:path'; const pluginPath = path.resolve('./src/index.ts'); +await testSpawn('apt-get autoremove -y ruby rpm python awscli', { requiresRoot: true }); + // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby rpm python command-not-found', { requiresRoot: true }); await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) -await testSpawn('rm -rf /usr/bin/python3', { requiresRoot: true }) await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) // await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true }); From 8217f65b1512b69da251dde0202b635f4777acb2 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 08:58:58 -0400 Subject: [PATCH 35/98] feat: remove ssh --- .github/workflows/run-all-unit-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 86193787..c6e3b89b 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -30,8 +30,8 @@ jobs: if: runner.os == 'Linux' run: loginctl enable-linger $(whoami) - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts From 3f98f2c1a36701da99a9c51a384753b65b917736 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 09:01:13 -0400 Subject: [PATCH 36/98] feat: move apt autoremove down --- scripts/cleanup-github-actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 4249a688..9f67613d 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -3,14 +3,14 @@ import path from 'node:path'; const pluginPath = path.resolve('./src/index.ts'); -await testSpawn('apt-get autoremove -y ruby rpm python awscli', { requiresRoot: true }); - // Uninstall resources that have Codify resource definitions await PluginTester.uninstall(pluginPath, [ { type: 'docker' }, { type: 'aws-cli'} ]); +await testSpawn('apt-get autoremove -y ruby rpm python awscli', { requiresRoot: true }); + await testSpawn('rustup self uninstall -y'); await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) From 80b2eb579c310d65ef0cd378cc25149913af198a Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 09:24:48 -0400 Subject: [PATCH 37/98] feat: add both ubuntus --- .github/workflows/run-all-unit-tests.yaml | 2 +- vitest.config.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index c6e3b89b..257ec128 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, ubuntu-24.04-arm] # os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] steps: diff --git a/vitest.config.ts b/vitest.config.ts index 1e0a1015..7111816e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,7 +4,9 @@ export default defineConfig({ test: { pool: 'forks', onConsoleLog: (log) => { - process.stdout.write(log); + if (!process.env.CI) { + process.stdout.write(log); + } }, watch: false, setupFiles: ['./test/setup.ts'], From bdf7e9633194ea1f46f70bf35b0155088b396649 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:30:11 -0400 Subject: [PATCH 38/98] feat: enable macOS --- .github/workflows/run-all-unit-tests.yaml | 8 ++++---- scripts/cleanup-github-actions.ts | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 257ec128..10cc9265 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-24.04-arm] + os: [macos-latest] # os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] steps: @@ -30,10 +30,10 @@ jobs: if: runner.os == 'Linux' run: loginctl enable-linger $(whoami) -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 - - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - run: npm run test -- ./test --no-file-parallelism --silent=passed-only diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 9f67613d..dd903652 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -1,5 +1,6 @@ import { PluginTester, testSpawn } from '@codifycli/plugin-test'; import path from 'node:path'; +import { Utils } from '@codifycli/plugin-core'; const pluginPath = path.resolve('./src/index.ts'); @@ -9,12 +10,20 @@ await PluginTester.uninstall(pluginPath, [ { type: 'aws-cli'} ]); -await testSpawn('apt-get autoremove -y ruby rpm python awscli', { requiresRoot: true }); +if (Utils.isLinux()) { + await testSpawn('apt-get autoremove -y ruby rpm python awscli needrestart', { requiresRoot: true }); // remove needrestart to keep logs clean. -await testSpawn('rustup self uninstall -y'); + await testSpawn('rustup self uninstall -y'); -await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) -await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) -await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) + await testSpawn('rm -rf /usr/bin/go', { requiresRoot: true }) + await testSpawn('rm -rf /usr/bin/python', { requiresRoot: true }) + await testSpawn('rm -rf /usr/bin/ruby', { requiresRoot: true }) // await testSpawn('apt install --reinstall command-not-found', { requiresRoot: true }); + + // MacOS +} else { + await PluginTester.uninstall(pluginPath, [ + { type: 'brew', formulae: ['chrome', 'python', 'ruby', 'awscli'] }, + ]); +} From e20846b276139963fa7333f8b65589601063d9b7 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:31:22 -0400 Subject: [PATCH 39/98] feat: enable macOS --- scripts/cleanup-github-actions.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index dd903652..e25bfa07 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -4,13 +4,14 @@ import { Utils } from '@codifycli/plugin-core'; const pluginPath = path.resolve('./src/index.ts'); -// Uninstall resources that have Codify resource definitions -await PluginTester.uninstall(pluginPath, [ - { type: 'docker' }, - { type: 'aws-cli'} -]); if (Utils.isLinux()) { + // Uninstall resources that have Codify resource definitions + await PluginTester.uninstall(pluginPath, [ + { type: 'docker' }, + { type: 'aws-cli'} + ]); + await testSpawn('apt-get autoremove -y ruby rpm python awscli needrestart', { requiresRoot: true }); // remove needrestart to keep logs clean. await testSpawn('rustup self uninstall -y'); @@ -24,6 +25,7 @@ if (Utils.isLinux()) { // MacOS } else { await PluginTester.uninstall(pluginPath, [ + { type: 'aws-cli' }, { type: 'brew', formulae: ['chrome', 'python', 'ruby', 'awscli'] }, ]); } From 549e2811fa13ceb6c068601d74466489cdd90b89 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:35:17 -0400 Subject: [PATCH 40/98] feat: enable macOS --- src/resources/aws-cli/cli/aws-cli.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/resources/aws-cli/cli/aws-cli.ts b/src/resources/aws-cli/cli/aws-cli.ts index 3519894c..1d8e71db 100644 --- a/src/resources/aws-cli/cli/aws-cli.ts +++ b/src/resources/aws-cli/cli/aws-cli.ts @@ -104,21 +104,24 @@ softwareupdate --install-rosetta return; } - if (installLocation.includes('homebrew')) { - await $.spawn('brew uninstall awscli', { interactive: true, env: { HOMEBREW_NO_AUTO_UPDATE: 1 } }); - return; - } + // if (installLocation.includes('homebrew')) { + // await $.spawn('brew uninstall awscli', { interactive: true, env: { HOMEBREW_NO_AUTO_UPDATE: 1 } }); + // return; + // } if (Utils.isLinux()) { // Remove symlinks from bin dir - await $.spawnSafe('rm -f /usr/local/bin/aws', { requiresRoot: true }); - await $.spawnSafe('rm -f /usr/local/bin/aws_completer', { requiresRoot: true }); + await $.spawnSafe(`rm -f ${installLocation}`, { requiresRoot: true }); + await $.spawnSafe(`rm -f ${installLocation}_completer`, { requiresRoot: true }); // Remove the install directory (always /usr/local/aws-cli for the standalone installer) await $.spawnSafe('rm -rf /usr/local/aws-cli', { requiresRoot: true }); } else { await $.spawnSafe(`rm ${installLocation}`, { requiresRoot: true }); await $.spawnSafe(`rm ${installLocation}_completer`, { requiresRoot: true }); + + // Remove the install directory (always /usr/local/aws-cli for the standalone installer) + await $.spawnSafe('rm -rf /usr/local/aws-cli', { requiresRoot: true }); } } From 04f7cb8e6b1688ff1bcc1c83846bb1d07a769e52 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:37:13 -0400 Subject: [PATCH 41/98] feat: enable macOS --- src/resources/aws-cli/cli/aws-cli.ts | 8 ++++---- src/resources/homebrew/homebrew.ts | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/resources/aws-cli/cli/aws-cli.ts b/src/resources/aws-cli/cli/aws-cli.ts index 1d8e71db..3cfe4b88 100644 --- a/src/resources/aws-cli/cli/aws-cli.ts +++ b/src/resources/aws-cli/cli/aws-cli.ts @@ -104,10 +104,10 @@ softwareupdate --install-rosetta return; } - // if (installLocation.includes('homebrew')) { - // await $.spawn('brew uninstall awscli', { interactive: true, env: { HOMEBREW_NO_AUTO_UPDATE: 1 } }); - // return; - // } + if (installLocation.includes('homebrew')) { + await $.spawn('brew uninstall awscli', { interactive: true, env: { HOMEBREW_NO_AUTO_UPDATE: 1 } }); + return; + } if (Utils.isLinux()) { // Remove symlinks from bin dir diff --git a/src/resources/homebrew/homebrew.ts b/src/resources/homebrew/homebrew.ts index caabf64f..53ad9903 100644 --- a/src/resources/homebrew/homebrew.ts +++ b/src/resources/homebrew/homebrew.ts @@ -112,6 +112,12 @@ export class HomebrewResource extends Resource { override async destroy(): Promise { const $ = getPty(); + + const { status } = await $.spawnSafe('which brew'); + if (status === SpawnStatus.ERROR) { + return; + } + const homebrewInfo = await $.spawn('brew config', { interactive: true }); const homebrewDirectory = this.getCurrentLocation(homebrewInfo.data) From a5da97c93c9e8934a9d1546d46d6c51582820078 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:38:21 -0400 Subject: [PATCH 42/98] feat: enable macOS --- scripts/cleanup-github-actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index e25bfa07..0a0d1210 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -26,6 +26,6 @@ if (Utils.isLinux()) { } else { await PluginTester.uninstall(pluginPath, [ { type: 'aws-cli' }, - { type: 'brew', formulae: ['chrome', 'python', 'ruby', 'awscli'] }, + { type: 'homebrew', formulae: ['chrome', 'python', 'ruby', 'awscli'] }, ]); } From 9584c72084200dfbf514669d49a5b8bb54e9f7e9 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:45:58 -0400 Subject: [PATCH 43/98] feat: enable macOS --- scripts/cleanup-github-actions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 0a0d1210..1cc7da17 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -26,6 +26,8 @@ if (Utils.isLinux()) { } else { await PluginTester.uninstall(pluginPath, [ { type: 'aws-cli' }, - { type: 'homebrew', formulae: ['chrome', 'python', 'ruby', 'awscli'] }, ]); + + await testSpawn('brew uninstall chrome python ruby awscli rust rustup git-lfs', { interactive: true }); + } From c03e96b639580165a983640a28df35b9c4ef851c Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:54:47 -0400 Subject: [PATCH 44/98] feat: enable macOS --- scripts/cleanup-github-actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 1cc7da17..6e477438 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -28,6 +28,6 @@ if (Utils.isLinux()) { { type: 'aws-cli' }, ]); - await testSpawn('brew uninstall chrome python ruby awscli rust rustup git-lfs', { interactive: true }); + await testSpawn('brew uninstall chrome pipx python ruby awscli rust rustup git-lfs', { interactive: true }); } From 45bc61962fd5a01e3d5e23c95a248fa03bb6f5b2 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 11:59:02 -0400 Subject: [PATCH 45/98] feat: enable macOS --- scripts/cleanup-github-actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 6e477438..2b4ff027 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -28,6 +28,6 @@ if (Utils.isLinux()) { { type: 'aws-cli' }, ]); - await testSpawn('brew uninstall chrome pipx python ruby awscli rust rustup git-lfs', { interactive: true }); + await testSpawn('brew uninstall chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') rustup git-lfs', { interactive: true }); } From b4fd9a06867e0ca1c386ef4c5e2cf73fb3ac6c50 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 12:00:27 -0400 Subject: [PATCH 46/98] feat: enable macOS --- scripts/cleanup-github-actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 2b4ff027..17b27d51 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -28,6 +28,6 @@ if (Utils.isLinux()) { { type: 'aws-cli' }, ]); - await testSpawn('brew uninstall chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') rustup git-lfs', { interactive: true }); + await testSpawn('brew uninstall chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs', { interactive: true }); } From e1c52cb531fdf4b7976828dce32fc471a5ddfde9 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 12:01:53 -0400 Subject: [PATCH 47/98] feat: enable macOS --- .github/workflows/run-all-unit-tests.yaml | 4 ++-- scripts/cleanup-github-actions.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 10cc9265..3c1d4de8 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -33,7 +33,7 @@ jobs: - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - run: npm run test -- ./test --no-file-parallelism --silent=passed-only diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 17b27d51..220223b2 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -28,6 +28,6 @@ if (Utils.isLinux()) { { type: 'aws-cli' }, ]); - await testSpawn('brew uninstall chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs', { interactive: true }); + await testSpawn('brew uninstall google-chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs', { interactive: true }); } From c1334b8355da537ef7a7f9fb13631c5043aee7b9 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 12:46:14 -0400 Subject: [PATCH 48/98] feat: switch to zsh --- .github/workflows/run-all-unit-tests.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 3c1d4de8..60029e76 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -31,9 +31,18 @@ jobs: run: loginctl enable-linger $(whoami) - run: npm ci - - run: npx tsx scripts/cleanup-github-actions.ts + + - name: Run tests + if: runner.os == 'Linux' + run: npx tsx scripts/cleanup-github-actions.ts # - name: Setup tmate session # uses: mxschmitt/action-tmate@v3 - - run: npm run test -- ./test --no-file-parallelism --silent=passed-only + - name: Run tests (macOS - zsh login shell) + if: runner.os == 'macOS' + run: zsh -l -c 'npm run test -- ./test/shell --no-file-parallelism --silent=passed-only' + + - name: Run tests (Linux) + if: runner.os == 'Linux' + run: npm run test -- ./test --no-file-parallelism --silent=passed-only From 60d9afb474019642deff21d2231907cdb62a46f9 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 12:50:49 -0400 Subject: [PATCH 49/98] feat: add ssh --- .github/workflows/run-all-unit-tests.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 60029e76..4fcd0612 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -31,13 +31,7 @@ jobs: run: loginctl enable-linger $(whoami) - run: npm ci - - - name: Run tests - if: runner.os == 'Linux' - run: npx tsx scripts/cleanup-github-actions.ts - -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 + - run: npx tsx scripts/cleanup-github-actions.ts - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' @@ -46,3 +40,7 @@ jobs: - name: Run tests (Linux) if: runner.os == 'Linux' run: npm run test -- ./test --no-file-parallelism --silent=passed-only + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + From 09f69b71a4455d880532687e464381916c9afe18 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:19:13 -0400 Subject: [PATCH 50/98] fix: migrated to the Utils from @codifycli/plugin-core. Supports non-login shells --- package-lock.json | 8 +- package.json | 2 +- src/resources/android/android-studio.ts | 2 +- src/resources/asdf/asdf.ts | 3 +- src/resources/docker/docker.ts | 10 +- .../git/repository/git-repository.ts | 4 +- .../java/jenv/java-versions-parameter.ts | 3 +- src/resources/java/jenv/jenv.ts | 3 +- src/resources/javascript/nvm/nvm.ts | 3 +- src/resources/javascript/pnpm/pnpm.ts | 3 +- src/resources/macports/macports.ts | 12 +- src/resources/ollama/models-parameter.ts | 3 +- src/resources/ollama/ollama.ts | 5 +- src/resources/shell/alias/alias-resource.ts | 4 +- .../shell/aliases/aliases-resource.ts | 4 +- src/resources/shell/path/path-resource.ts | 4 +- src/resources/syncthing/syncthing.ts | 2 +- src/utils/codify-spawn.ts | 4 +- src/utils/file-utils.ts | 2 +- src/utils/index.ts | 123 +----------------- 20 files changed, 35 insertions(+), 169 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00e8cba1..969ba88c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.1.0", "license": "ISC", "dependencies": { - "@codifycli/plugin-core": "1.1.0-beta6", + "@codifycli/plugin-core": "1.1.0-beta7", "@codifycli/schemas": "1.0.0", "ajv": "^8.18.0", "ajv-formats": "^2.1.1", @@ -171,9 +171,9 @@ } }, "node_modules/@codifycli/plugin-core": { - "version": "1.1.0-beta6", - "resolved": "https://registry.npmjs.org/@codifycli/plugin-core/-/plugin-core-1.1.0-beta6.tgz", - "integrity": "sha512-0fBRph5UWjipx0hpiusTE4rkZ7Wh1SqwvyRazj2jRrPIJc5PLuStxowD0xxU+EvS7O71bjIVNp/yHM1HRWsFSg==", + "version": "1.1.0-beta7", + "resolved": "https://registry.npmjs.org/@codifycli/plugin-core/-/plugin-core-1.1.0-beta7.tgz", + "integrity": "sha512-Z4lILl6HijnMWN57/8G0gveEu9MAxh5EDqd4nru46jdTZ89RyTX9///JzzBRei6+LTVaMhKzReJLWhv4Kz75HQ==", "license": "ISC", "dependencies": { "@codifycli/schemas": "1.1.0-beta3", diff --git a/package.json b/package.json index dcffe806..4d6a433a 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "license": "ISC", "type": "module", "dependencies": { - "@codifycli/plugin-core": "1.1.0-beta6", + "@codifycli/plugin-core": "1.1.0-beta7", "@codifycli/schemas": "1.0.0", "ajv": "^8.18.0", "ajv-formats": "^2.1.1", diff --git a/src/resources/android/android-studio.ts b/src/resources/android/android-studio.ts index f69dafae..3af17a38 100644 --- a/src/resources/android/android-studio.ts +++ b/src/resources/android/android-studio.ts @@ -135,7 +135,7 @@ export class AndroidStudioResource extends Resource { throw new Error(`Unable to find desired version: ${plan.desiredConfig.version}`); } - const isArm = await LocalUtils.isArmArch(); + const isArm = await Utils.isArmArch(); const downloadLink = isArm ? versionToDownload.download.find((v) => v.link.includes('mac_arm.dmg'))! : versionToDownload.download.find((v) => v.link.includes('mac.dmg'))! diff --git a/src/resources/asdf/asdf.ts b/src/resources/asdf/asdf.ts index ac75b2d7..c6f931f5 100644 --- a/src/resources/asdf/asdf.ts +++ b/src/resources/asdf/asdf.ts @@ -1,10 +1,9 @@ -import { CreatePlan, ExampleConfig, FileUtils, Resource, ResourceSettings, SpawnStatus, Utils as CoreUtils, getPty, z } from '@codifycli/plugin-core'; +import { CreatePlan, ExampleConfig, FileUtils, Resource, ResourceSettings, SpawnStatus, Utils as CoreUtils, getPty, z, Utils } from '@codifycli/plugin-core'; import { OS } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; -import { Utils } from '../../utils/index.js'; import { AsdfPluginsParameter } from './plugins-parameter.js'; const schema = z.object({ diff --git a/src/resources/docker/docker.ts b/src/resources/docker/docker.ts index 99d43e5f..866dfecb 100644 --- a/src/resources/docker/docker.ts +++ b/src/resources/docker/docker.ts @@ -1,12 +1,10 @@ -import { CreatePlan, DestroyPlan, Resource, ResourceSettings, getPty } from '@codifycli/plugin-core'; +import { CreatePlan, DestroyPlan, Resource, ResourceSettings, getPty, Utils, FileUtils } from '@codifycli/plugin-core'; import { OS, StringIndexedObject } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import { SpawnStatus } from '../../utils/codify-spawn.js'; -import { FileUtils } from '../../utils/file-utils.js'; -import { Utils } from '../../utils/index.js'; import Schema from './docker-schema.json'; export interface DockerConfig extends StringIndexedObject { @@ -74,7 +72,7 @@ export class DockerResource extends Resource { const downloadLink = await Utils.isArmArch() ? ARM_DOWNLOAD_LINK : INTEL_DOWNLOAD_LINK; const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'codify-docker')) - await Utils.downloadUrlIntoFile(path.join(tmpDir, 'Docker.dmg'), downloadLink); + await FileUtils.downloadFile(path.join(tmpDir, 'Docker.dmg'), downloadLink); const user = Utils.getUser(); try { @@ -93,7 +91,7 @@ export class DockerResource extends Resource { } await $.spawn('xattr -r -d com.apple.quarantine /Applications/Docker.app', { requiresRoot: true }); - await FileUtils.addPathToPrimaryShellRc('/Applications/Docker.app/Contents/Resources/bin', false); + await FileUtils.addPathToShellRc('/Applications/Docker.app/Contents/Resources/bin', true); } else if (Utils.isLinux()) { // Detect Linux distribution const isDebianBased = await this.isDebianBased($); @@ -121,7 +119,7 @@ export class DockerResource extends Resource { await fs.rm(path.join(os.homedir(), '.docker'), { recursive: true, force: true }); await $.spawn('rm -rf /Applications/Docker.app') - await FileUtils.removeLineFromStartupFile('/Applications/Docker.app/Contents/Resources/bin') + await FileUtils.removeLineFromShellRc('/Applications/Docker.app/Contents/Resources/bin') } else if (Utils.isLinux()) { const isDebianBased = await this.isDebianBased($); const isRedHatBased = await this.isRedHatBased($); diff --git a/src/resources/git/repository/git-repository.ts b/src/resources/git/repository/git-repository.ts index 2014e9bd..85f2268a 100644 --- a/src/resources/git/repository/git-repository.ts +++ b/src/resources/git/repository/git-repository.ts @@ -58,11 +58,11 @@ export class GitRepositoryResource extends Resource { allowMultiple: { matcher: (desired, current) => { const desiredPath = desired.parentDirectory - ? path.resolve(desired.parentDirectory, this.extractBasename(desired.repository)!) + ? path.resolve(desired.parentDirectory, this.extractBasename(desired.repository!)!) : path.resolve(desired.directory!); const currentPath = current.parentDirectory - ? path.resolve(current.parentDirectory, this.extractBasename(current.repository)!) + ? path.resolve(current.parentDirectory, this.extractBasename(current.repository!)!) : path.resolve(current.directory!); if (process.platform === 'darwin') { diff --git a/src/resources/java/jenv/java-versions-parameter.ts b/src/resources/java/jenv/java-versions-parameter.ts index 86841748..26a07eca 100644 --- a/src/resources/java/jenv/java-versions-parameter.ts +++ b/src/resources/java/jenv/java-versions-parameter.ts @@ -1,9 +1,8 @@ -import { ArrayParameterSetting, ArrayStatefulParameter, getPty, SpawnStatus } from '@codifycli/plugin-core'; +import { ArrayParameterSetting, ArrayStatefulParameter, getPty, SpawnStatus, Utils } from '@codifycli/plugin-core'; import fs from 'node:fs/promises'; import semver from 'semver'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import { JenvConfig } from './jenv.js'; import { nanoid } from 'nanoid'; diff --git a/src/resources/java/jenv/jenv.ts b/src/resources/java/jenv/jenv.ts index ce4fd15d..b0d4fe92 100644 --- a/src/resources/java/jenv/jenv.ts +++ b/src/resources/java/jenv/jenv.ts @@ -1,9 +1,8 @@ -import { Resource, ResourceSettings, SpawnStatus, getPty } from '@codifycli/plugin-core'; +import { Resource, ResourceSettings, SpawnStatus, getPty, Utils } from '@codifycli/plugin-core'; import { OS, ResourceConfig } from '@codifycli/schemas'; import * as fs from 'node:fs'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import { JenvGlobalParameter } from './global-parameter.js'; import { JenvAddParameter, diff --git a/src/resources/javascript/nvm/nvm.ts b/src/resources/javascript/nvm/nvm.ts index ef75c263..41822cb5 100644 --- a/src/resources/javascript/nvm/nvm.ts +++ b/src/resources/javascript/nvm/nvm.ts @@ -1,9 +1,8 @@ -import { ExampleConfig, getPty, Resource, ResourceSettings, SpawnStatus } from '@codifycli/plugin-core'; +import { ExampleConfig, getPty, Resource, ResourceSettings, SpawnStatus, Utils } from '@codifycli/plugin-core'; import { OS, ResourceConfig } from '@codifycli/schemas'; import * as os from 'node:os'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import { NvmGlobalParameter } from './global-parameter.js'; import { NvmNodeVersionsParameter } from './node-versions-parameter.js'; import Schema from './nvm-schema.json'; diff --git a/src/resources/javascript/pnpm/pnpm.ts b/src/resources/javascript/pnpm/pnpm.ts index 147dbff9..9a99ec83 100644 --- a/src/resources/javascript/pnpm/pnpm.ts +++ b/src/resources/javascript/pnpm/pnpm.ts @@ -1,11 +1,10 @@ -import { CreatePlan, DestroyPlan, ExampleConfig, RefreshContext, Resource, ResourceSettings, getPty } from '@codifycli/plugin-core'; +import { CreatePlan, DestroyPlan, ExampleConfig, RefreshContext, Resource, ResourceSettings, getPty, Utils } from '@codifycli/plugin-core'; import { OS, ResourceConfig } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import { PnpmGlobalEnvStatefulParameter } from './pnpm-global-env-stateful-parameter.js'; import schema from './pnpm-schema.json'; diff --git a/src/resources/macports/macports.ts b/src/resources/macports/macports.ts index 580dcd89..dd3b0ee9 100644 --- a/src/resources/macports/macports.ts +++ b/src/resources/macports/macports.ts @@ -1,11 +1,9 @@ -import { CreatePlan, Resource, ResourceSettings, SpawnStatus, getPty } from '@codifycli/plugin-core'; +import { CreatePlan, Resource, ResourceSettings, SpawnStatus, getPty, Utils, FileUtils } from '@codifycli/plugin-core'; import { OS, ResourceConfig } from '@codifycli/schemas'; import * as fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; -import { FileUtils } from '../../utils/file-utils.js'; -import { Utils } from '../../utils/index.js'; import { MacportsInstallParameter, PortPackage } from './install-parameter.js'; import schema from './macports-schema.json'; @@ -67,12 +65,12 @@ export class MacportsResource extends Resource { const installerPath = path.join(tmpDir, 'installer.pkg') console.log(`Downloading macports installer ${installerUrl}`) - await Utils.downloadUrlIntoFile(installerPath, installerUrl); + await FileUtils.downloadFile(installerPath, installerUrl); await $.spawn(`installer -pkg "${installerPath}" -target /;`, { requiresRoot: true }) - await FileUtils.addToStartupFile('') - await FileUtils.addToStartupFile('export PATH=/opt/local/bin:/opt/local/sbin:$PATH') + await FileUtils.addToShellRc('') + await FileUtils.addToShellRc('export PATH=/opt/local/bin:/opt/local/sbin:$PATH') } override async destroy(): Promise { @@ -92,7 +90,7 @@ export class MacportsResource extends Resource { ' /Library/Tcl/macports1.0 \\\n' + ' ~/.macports', { requiresRoot: true }) - await FileUtils.removeLineFromStartupFile('export PATH=/opt/local/bin:/opt/local/sbin:$PATH'); + await FileUtils.removeLineFromShellRc('export PATH=/opt/local/bin:/opt/local/sbin:$PATH'); } diff --git a/src/resources/ollama/models-parameter.ts b/src/resources/ollama/models-parameter.ts index 07a55196..af93683a 100644 --- a/src/resources/ollama/models-parameter.ts +++ b/src/resources/ollama/models-parameter.ts @@ -1,6 +1,5 @@ -import { ArrayStatefulParameter, getPty, Plan, SpawnStatus } from '@codifycli/plugin-core'; +import { ArrayStatefulParameter, getPty, Plan, SpawnStatus, Utils } from '@codifycli/plugin-core'; -import { Utils } from '../../utils/index.js'; import { OllamaConfig } from './ollama.js'; async function ensureOllamaServerRunning(): Promise { diff --git a/src/resources/ollama/ollama.ts b/src/resources/ollama/ollama.ts index 50f42ce6..55ae7faa 100644 --- a/src/resources/ollama/ollama.ts +++ b/src/resources/ollama/ollama.ts @@ -5,13 +5,12 @@ import { Resource, ResourceSettings, SpawnStatus, - Utils as CoreUtils, + Utils, getPty, z, } from '@codifycli/plugin-core'; import { OS } from '@codifycli/schemas'; -import { Utils } from '../../utils/index.js'; import { ModelsParameter } from './models-parameter.js'; const schema = z @@ -136,7 +135,7 @@ export class OllamaResource extends Resource { const curlCheck = await $.spawnSafe('which curl'); if (curlCheck.status === SpawnStatus.ERROR) { - await CoreUtils.installViaPkgMgr('curl'); + await Utils.installViaPkgMgr('curl'); } // The official install script installs the binary, creates the `ollama` diff --git a/src/resources/shell/alias/alias-resource.ts b/src/resources/shell/alias/alias-resource.ts index ea65c07b..771644e3 100644 --- a/src/resources/shell/alias/alias-resource.ts +++ b/src/resources/shell/alias/alias-resource.ts @@ -7,13 +7,13 @@ import { ParameterChange, Resource, ResourceSettings, - SpawnStatus + SpawnStatus, + Utils } from '@codifycli/plugin-core'; import { OS, StringIndexedObject } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import Schema from './alias-schema.json'; export interface AliasConfig extends StringIndexedObject { diff --git a/src/resources/shell/aliases/aliases-resource.ts b/src/resources/shell/aliases/aliases-resource.ts index 6d85c2c0..b66fa849 100644 --- a/src/resources/shell/aliases/aliases-resource.ts +++ b/src/resources/shell/aliases/aliases-resource.ts @@ -9,13 +9,13 @@ import { ResourceSettings, SpawnStatus, getPty, - z + z, + Utils } from '@codifycli/plugin-core'; import { OS } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import os from 'node:os'; import path from 'node:path'; diff --git a/src/resources/shell/path/path-resource.ts b/src/resources/shell/path/path-resource.ts index 1aab5654..7912f9a6 100644 --- a/src/resources/shell/path/path-resource.ts +++ b/src/resources/shell/path/path-resource.ts @@ -8,14 +8,14 @@ import { RefreshContext, resolvePathWithVariables, Resource, - ResourceSettings + ResourceSettings, + Utils } from '@codifycli/plugin-core'; import { OS, StringIndexedObject } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import path from 'node:path'; import { FileUtils } from '../../../utils/file-utils.js'; -import { Utils } from '../../../utils/index.js'; import { untildify } from '../../../utils/untildify.js'; import Schema from './path-schema.json'; diff --git a/src/resources/syncthing/syncthing.ts b/src/resources/syncthing/syncthing.ts index 62b35486..1430891a 100644 --- a/src/resources/syncthing/syncthing.ts +++ b/src/resources/syncthing/syncthing.ts @@ -9,10 +9,10 @@ import { SpawnStatus, getPty, z, + Utils } from '@codifycli/plugin-core'; import { OS } from '@codifycli/schemas'; -import { Utils } from '../../utils/index.js'; import { exampleSyncthingConfigs } from './examples.js'; import { getCliConfigBool, diff --git a/src/utils/codify-spawn.ts b/src/utils/codify-spawn.ts index b9ccff1f..e51f14b2 100644 --- a/src/utils/codify-spawn.ts +++ b/src/utils/codify-spawn.ts @@ -1,5 +1,5 @@ import { Ajv } from 'ajv'; -import { SudoError, VerbosityLevel } from '@codifycli/plugin-core'; +import { SudoError, VerbosityLevel, Utils } from '@codifycli/plugin-core'; import { CommandRequestResponseData, CommandRequestResponseDataSchema, IpcMessageV2, @@ -9,8 +9,6 @@ import { nanoid } from 'nanoid'; import { SpawnOptions, spawn } from 'node:child_process'; import stripAnsi from 'strip-ansi'; -import { Utils } from './index.js'; - const ajv = new Ajv({ strict: true, }); diff --git a/src/utils/file-utils.ts b/src/utils/file-utils.ts index b99577c5..52d2f897 100644 --- a/src/utils/file-utils.ts +++ b/src/utils/file-utils.ts @@ -3,7 +3,7 @@ import * as fs from 'node:fs/promises'; import os, { homedir } from 'node:os'; import path from 'node:path'; -import { Utils } from './index.js'; +import { Utils } from '@codifycli/plugin-core'; const SPACE_REGEX = /^\s*$/ diff --git a/src/utils/index.ts b/src/utils/index.ts index 4f11cf1e..00ee73c1 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,4 @@ -import { getPty } from '@codifycli/plugin-core'; +import { getPty, Utils as CoreUtils } from '@codifycli/plugin-core'; import * as fsSync from 'node:fs'; import * as fs from 'node:fs/promises'; import os from 'node:os'; @@ -73,136 +73,15 @@ export const Utils = { return query.data.trim(); }, - async isArmArch(): Promise { - if (!Utils.isMacOS()) { - // On Linux, check uname -m - const query = await codifySpawn('uname -m'); - return query.data.trim() === 'aarch64' || query.data.trim() === 'arm64'; - } - const query = await codifySpawn('sysctl -n machdep.cpu.brand_string'); - return /M(\d)/.test(query.data); - }, - async isDirectoryOnPath(directory: string): Promise { const $ = getPty(); const { data: pathQuery } = await $.spawn('echo $PATH', { interactive: true }); const lines = pathQuery.split(':'); return lines.includes(directory); }, - - async isHomebrewInstalled(): Promise { - const query = await codifySpawn('which brew', { throws: false }); - return query.status === SpawnStatus.SUCCESS; - }, - - async isRosetta2Installed(): Promise { - const query = await codifySpawn('arch -x86_64 /usr/bin/true 2> /dev/null', { throws: false }); - return query.status === SpawnStatus.SUCCESS; - }, shellEscape(arg: string): string { if (/[^\w/:=-]/.test(arg)) return arg.replaceAll(/([ !"#$%&'()*;<>?@[\\\]`{}~])/g, '\\$1') return arg; }, - - async downloadUrlIntoFile(filePath: string, url: string): Promise { - const { body } = await fetch(url) - - const dirname = path.dirname(filePath); - if (!await fs.stat(dirname).then((s) => s.isDirectory()).catch(() => false)) { - await fs.mkdir(dirname, { recursive: true }); - } - - const ws = fsSync.createWriteStream(filePath) - // Different type definitions here for readable stream (NodeJS vs DOM). Small hack to fix that - await finished(Readable.fromWeb(body as never).pipe(ws)); - }, - - getUser(): string { - return os.userInfo().username; - }, - - isMacOS(): boolean { - return os.platform() === 'darwin'; - }, - - isLinux(): boolean { - return os.platform() === 'linux'; - }, - - async getShell(): Promise<'bash' | 'unknown' | 'zsh'> { - const shell = process.env.SHELL || ''; - - if (shell.includes('bash')) { - return 'bash'; - } - - if (shell.includes('zsh')) { - return 'zsh'; - } - - return 'unknown'; - }, - - getShellRcFiles(): string[] { - const shell = process.env.SHELL || ''; - const homeDir = os.homedir(); - - if (shell.includes('bash')) { - // Linux typically uses .bashrc, macOS uses .bash_profile - if (Utils.isLinux()) { - return [ - path.join(homeDir, '.bashrc'), - path.join(homeDir, '.bash_profile'), - path.join(homeDir, '.profile'), - ]; - } - return [ - path.join(homeDir, '.bash_profile'), - path.join(homeDir, '.bashrc'), - path.join(homeDir, '.profile'), - ]; - } - - if (shell.includes('zsh')) { - return [ - path.join(homeDir, '.zshrc'), - path.join(homeDir, '.zprofile'), - path.join(homeDir, '.zshenv'), - ]; - } - - // Default to bash-style files - return [ - path.join(homeDir, '.bashrc'), - path.join(homeDir, '.bash_profile'), - path.join(homeDir, '.profile'), - ]; - }, - - async installViaPkgMgr(pkg: string): Promise { - const $ = getPty(); - if (Utils.isLinux()) { - await $.spawn(`sudo apt-get install -y ${pkg}`, { interactive: true, requiresRoot: true }); - } - }, - - getPrimaryShellRc(): string { - const shell = process.env.SHELL || ''; - const homeDir = os.homedir(); - - if (shell.includes('bash')) { - // Linux typically uses .bashrc as primary, macOS uses .bash_profile - return Utils.isLinux() - ? path.join(homeDir, '.bashrc') - : path.join(homeDir, '.bash_profile'); - } - - if (shell.includes('zsh')) { - return path.join(homeDir, '.zshrc'); - } - - // Default to .bashrc - return path.join(homeDir, '.bashrc'); - } }; From 0b42ca1c56a840636cb5be08d10c73e41a3803df Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:21:54 -0400 Subject: [PATCH 51/98] fix: make zsh run a login shell --- .github/workflows/run-all-unit-tests.yaml | 2 +- src/resources/shell/path/path-resource.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 4fcd0612..833b0af6 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -35,7 +35,7 @@ jobs: - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' - run: zsh -l -c 'npm run test -- ./test/shell --no-file-parallelism --silent=passed-only' + run: zsh -l -i -c 'npm run test -- ./test/shell --no-file-parallelism --silent=passed-only' - name: Run tests (Linux) if: runner.os == 'Linux' diff --git a/src/resources/shell/path/path-resource.ts b/src/resources/shell/path/path-resource.ts index 7912f9a6..7e4a3c4f 100644 --- a/src/resources/shell/path/path-resource.ts +++ b/src/resources/shell/path/path-resource.ts @@ -9,13 +9,13 @@ import { resolvePathWithVariables, Resource, ResourceSettings, - Utils + Utils, + FileUtils } from '@codifycli/plugin-core'; import { OS, StringIndexedObject } from '@codifycli/schemas'; import fs from 'node:fs/promises'; import path from 'node:path'; -import { FileUtils } from '../../../utils/file-utils.js'; import { untildify } from '../../../utils/untildify.js'; import Schema from './path-schema.json'; From 3c41cfc13a073f054091571b31e3258588a406f4 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:24:39 -0400 Subject: [PATCH 52/98] Added logging for shell info --- src/resources/shell/path/path-resource.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resources/shell/path/path-resource.ts b/src/resources/shell/path/path-resource.ts index 7e4a3c4f..62b7ce96 100644 --- a/src/resources/shell/path/path-resource.ts +++ b/src/resources/shell/path/path-resource.ts @@ -18,6 +18,7 @@ import path from 'node:path'; import { untildify } from '../../../utils/untildify.js'; import Schema from './path-schema.json'; +import os from 'node:os'; export interface PathConfig extends StringIndexedObject { path: string; @@ -188,6 +189,9 @@ export class PathResource extends Resource { if (pc.name !== 'paths') { return; } + + console.log('My shell', process.env.SHELL); + console.log('Other shell method', os.userInfo().shell) const pathsToAdd = pc.newValue.filter((p: string) => !pc.previousValue.includes(p)); const pathsToRemove = pc.previousValue.filter((p: string) => !pc.newValue.includes(p)); @@ -216,7 +220,7 @@ export class PathResource extends Resource { private async addPath(path: string, prepend = false): Promise { // Escaping is done within file utils - await FileUtils.addPathToPrimaryShellRc(path, prepend); + await FileUtils.addPathToShellRc(path, prepend); } private async removePath(pathValue: string): Promise { From 8e0c78b79e4ede0086cdedb55da735a7d7b60e98 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:26:40 -0400 Subject: [PATCH 53/98] Moved logging --- src/resources/shell/path/path-resource.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resources/shell/path/path-resource.ts b/src/resources/shell/path/path-resource.ts index 62b7ce96..92f6de47 100644 --- a/src/resources/shell/path/path-resource.ts +++ b/src/resources/shell/path/path-resource.ts @@ -94,6 +94,9 @@ export class PathResource extends Resource { } override async refresh(parameters: Partial, context: RefreshContext): Promise | null> { + console.log('My shell', process.env.SHELL); + console.log('Other shell method', os.userInfo().shell) + // If declarations only, we only look into files to find potential paths if (parameters.declarationsOnly || context.isStateful) { const pathsResult = new Set(); @@ -189,9 +192,6 @@ export class PathResource extends Resource { if (pc.name !== 'paths') { return; } - - console.log('My shell', process.env.SHELL); - console.log('Other shell method', os.userInfo().shell) const pathsToAdd = pc.newValue.filter((p: string) => !pc.previousValue.includes(p)); const pathsToRemove = pc.previousValue.filter((p: string) => !pc.newValue.includes(p)); From af5b6ad4824df9d299dd0e01000767b6acef09d7 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:29:40 -0400 Subject: [PATCH 54/98] Moved logging --- .github/workflows/run-all-unit-tests.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 833b0af6..76c71b2f 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -35,7 +35,10 @@ jobs: - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' - run: zsh -l -i -c 'npm run test -- ./test/shell --no-file-parallelism --silent=passed-only' + shell: zsh {0} + run: | + echo $ZSH_NAME $ZSH_VERSION + npm run test -- ./test/shell --no-file-parallelism --silent=passed-only - name: Run tests (Linux) if: runner.os == 'Linux' From 7f9519e6db3e1389ed547c4826b38e92576cccf1 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:32:53 -0400 Subject: [PATCH 55/98] Trying to change to zsh shell --- .github/workflows/run-all-unit-tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 76c71b2f..80ac5bf1 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -37,6 +37,8 @@ jobs: if: runner.os == 'macOS' shell: zsh {0} run: | + chsh -s bash + echo $0 echo $ZSH_NAME $ZSH_VERSION npm run test -- ./test/shell --no-file-parallelism --silent=passed-only From 78b1b77264729d049ec8933ec08812e6a0320668 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:36:03 -0400 Subject: [PATCH 56/98] Trying to change to zsh shell --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 80ac5bf1..cb15f9f2 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -37,7 +37,7 @@ jobs: if: runner.os == 'macOS' shell: zsh {0} run: | - chsh -s bash + sudo chsh -s $(which zsh) $USER echo $0 echo $ZSH_NAME $ZSH_VERSION npm run test -- ./test/shell --no-file-parallelism --silent=passed-only From bc5197b55f3690427236c176d52e6ed56bb0fc5a Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:39:47 -0400 Subject: [PATCH 57/98] Trying to change to zsh shell --- .github/workflows/run-all-unit-tests.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index cb15f9f2..d7e222c6 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -37,9 +37,10 @@ jobs: if: runner.os == 'macOS' shell: zsh {0} run: | - sudo chsh -s $(which zsh) $USER +# sudo chsh -s $(which zsh) $USER echo $0 - echo $ZSH_NAME $ZSH_VERSION + echo $ZSH_NAME $ZSH_VERSION + export SHELL=/bin/zsh npm run test -- ./test/shell --no-file-parallelism --silent=passed-only - name: Run tests (Linux) From 4a5f73e6a9dc5657e41c37cb08cdfa24383faba5 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 13:40:45 -0400 Subject: [PATCH 58/98] Trying to change to zsh shell --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index d7e222c6..63eb84f8 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -37,7 +37,7 @@ jobs: if: runner.os == 'macOS' shell: zsh {0} run: | -# sudo chsh -s $(which zsh) $USER + sudo chsh -s $(which zsh) $USER echo $0 echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh From e2a4fbf428a5a28c702730a86d1eb4497d711bce Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:03:39 -0400 Subject: [PATCH 59/98] Fix path tests --- ... -- $FilePathRelativeToProjectRoot$.run.xml | 2 +- src/resources/shell/path/path-resource.ts | 3 --- test/shell/path.test.ts | 18 +++++++++--------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.run/test_integration_dev -- $FilePathRelativeToProjectRoot$.run.xml b/.run/test_integration_dev -- $FilePathRelativeToProjectRoot$.run.xml index b5953607..e0d69262 100644 --- a/.run/test_integration_dev -- $FilePathRelativeToProjectRoot$.run.xml +++ b/.run/test_integration_dev -- $FilePathRelativeToProjectRoot$.run.xml @@ -1,5 +1,5 @@ - + diff --git a/src/resources/shell/path/path-resource.ts b/src/resources/shell/path/path-resource.ts index 92f6de47..b833fed5 100644 --- a/src/resources/shell/path/path-resource.ts +++ b/src/resources/shell/path/path-resource.ts @@ -94,9 +94,6 @@ export class PathResource extends Resource { } override async refresh(parameters: Partial, context: RefreshContext): Promise | null> { - console.log('My shell', process.env.SHELL); - console.log('Other shell method', os.userInfo().shell) - // If declarations only, we only look into files to find potential paths if (parameters.declarationsOnly || context.isStateful) { const pathsResult = new Set(); diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index e8dece92..093d40b5 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -18,10 +18,10 @@ describe('Path resource integration tests', async () => { } ], { validateApply: async () => { - expect((await testSpawn(TestUtils.getShellCommand('echo $PATH'))).data).to.include(tempDir1); + expect((await testSpawn('echo $PATH', { interactive: true })).data).to.include(tempDir1); }, validateDestroy: async () => { - expect((await testSpawn(TestUtils.getShellCommand('echo $PATH'))).data).to.not.include(tempDir1); + expect((await testSpawn('echo $PATH', { interactive: true })).data).to.not.include(tempDir1); } }); }) @@ -40,12 +40,12 @@ describe('Path resource integration tests', async () => { console.log(JSON.stringify(plan, null, 2)); }, validateApply: async () => { - const { data: path } = await testSpawn('echo $PATH'); + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); }, validateDestroy: async () => { - const { data: path } = await testSpawn('echo $PATH') + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.not.include(tempDir1); expect(path).to.not.include(tempDir2); } @@ -64,12 +64,12 @@ describe('Path resource integration tests', async () => { } ], { validateApply: async () => { - const { data: path } = await testSpawn('echo $PATH') + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); }, validateDestroy: async () => { - const { data: path } = await testSpawn('echo $PATH') + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.not.include(tempDir1); expect(path).to.not.include(tempDir2); } @@ -90,7 +90,7 @@ describe('Path resource integration tests', async () => { } ], { validateApply: async () => { - const { data: path } = await testSpawn('echo $PATH'); + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); }, @@ -111,7 +111,7 @@ describe('Path resource integration tests', async () => { })]) }) - const { data: path } = await testSpawn('echo $PATH'); + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); expect(path).to.include(tempDir3); @@ -119,7 +119,7 @@ describe('Path resource integration tests', async () => { } }, validateDestroy: async () => { - const { data: path } = await testSpawn('echo $PATH'); + const { data: path } = await testSpawn('echo $PATH', { interactive: true }) expect(path).to.not.include(tempDir1); expect(path).to.not.include(tempDir2); expect(path).to.not.include(tempDir3); From 5944d31eec67c934933eb3e488cf4c1b2599f86b Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:07:47 -0400 Subject: [PATCH 60/98] Add logging --- test/shell/path.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index 093d40b5..8ef85b84 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -64,7 +64,12 @@ describe('Path resource integration tests', async () => { } ], { validateApply: async () => { - const { data: path } = await testSpawn('echo $PATH', { interactive: true }) + const { data: path } = await testSpawn('echo $PATH', { interactive: true }); + + console.log('My path', path); + console.log('Temp dir 1', tempDir1); + console.log('Temp dir 2', tempDir2); + expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); }, From db5b75e6b1432b2cdce72c64e15a399edc57db61 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:10:50 -0400 Subject: [PATCH 61/98] Add logging --- test/shell/path.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index 8ef85b84..4191dd38 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -70,8 +70,8 @@ describe('Path resource integration tests', async () => { console.log('Temp dir 1', tempDir1); console.log('Temp dir 2', tempDir2); - expect(path).to.include(tempDir1); - expect(path).to.include(tempDir2); + // expect(path).to.include(tempDir1); + // expect(path).to.include(tempDir2); }, validateDestroy: async () => { const { data: path } = await testSpawn('echo $PATH', { interactive: true }) From 7d537accd705a3ee344c8560c74e4f32b7100377 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:15:53 -0400 Subject: [PATCH 62/98] Add logging --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 63eb84f8..8fa0a58e 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -41,7 +41,7 @@ jobs: echo $0 echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh - npm run test -- ./test/shell --no-file-parallelism --silent=passed-only + npm run test -- ./test/shell --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' From 8f6a87788f342b656f0b6c48b84cf6d1f781aaae Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:22:26 -0400 Subject: [PATCH 63/98] Print out zshrc as well --- test/shell/path.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index 4191dd38..60142dc8 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -69,6 +69,7 @@ describe('Path resource integration tests', async () => { console.log('My path', path); console.log('Temp dir 1', tempDir1); console.log('Temp dir 2', tempDir2); + console.log('Zshrc', fs.readFile(`${os.homedir()}/.zshrc`)) // expect(path).to.include(tempDir1); // expect(path).to.include(tempDir2); From 3ad9f4a451e75374bd3d66fd65d7085f0eb716b4 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:25:04 -0400 Subject: [PATCH 64/98] Print out zshrc as well --- test/shell/path.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index 60142dc8..225bf1bb 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -69,10 +69,10 @@ describe('Path resource integration tests', async () => { console.log('My path', path); console.log('Temp dir 1', tempDir1); console.log('Temp dir 2', tempDir2); - console.log('Zshrc', fs.readFile(`${os.homedir()}/.zshrc`)) + console.log('Zshrc', await fs.readFile(`${os.homedir()}/.zshrc`)) - // expect(path).to.include(tempDir1); - // expect(path).to.include(tempDir2); + expect(path).to.include(tempDir1); + expect(path).to.include(tempDir2); }, validateDestroy: async () => { const { data: path } = await testSpawn('echo $PATH', { interactive: true }) From 8517842659dd2941fbbd4f4297d10819da00a3ab Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:26:27 -0400 Subject: [PATCH 65/98] Print out zshrc as well --- test/shell/path.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index 225bf1bb..1ce8bfe8 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -69,7 +69,7 @@ describe('Path resource integration tests', async () => { console.log('My path', path); console.log('Temp dir 1', tempDir1); console.log('Temp dir 2', tempDir2); - console.log('Zshrc', await fs.readFile(`${os.homedir()}/.zshrc`)) + console.log('Zshrc', await fs.readFile(`${os.homedir()}/.zshrc`, 'utf-8')) expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); From a6364f7cfdaf8d1ca05f531cc168bf2c13b7cd2a Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:35:02 -0400 Subject: [PATCH 66/98] Added empty zshrc file --- .github/workflows/run-all-unit-tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 8fa0a58e..c8024243 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -41,6 +41,8 @@ jobs: echo $0 echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh + touch ~/.zshrc + npm run test -- ./test/shell --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) From 5f5a1b8745960326373bc62adf152c3d8fcc4132 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 14:57:52 -0400 Subject: [PATCH 67/98] Disable wrapping for test spawn --- package-lock.json | 8 ++++---- package.json | 2 +- scripts/build.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 969ba88c..c4f867bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "devDependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.97", "@apidevtools/json-schema-ref-parser": "^11.7.2", - "@codifycli/plugin-test": "^1.0.0", + "@codifycli/plugin-test": "1.1.0-beta1", "@fastify/merge-json-schemas": "^0.2.0", "@oclif/prettier-config": "^0.2.1", "@oclif/test": "^3", @@ -213,9 +213,9 @@ } }, "node_modules/@codifycli/plugin-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@codifycli/plugin-test/-/plugin-test-1.0.0.tgz", - "integrity": "sha512-+8EP/Jw1mZi60aEIY2Lq/mcXxdJOMFr6OS6p43vDecyGJKUEHdq7OU71D1lLlT5vJ/0Gk325cu64mLVxjfSR+Q==", + "version": "1.1.0-beta1", + "resolved": "https://registry.npmjs.org/@codifycli/plugin-test/-/plugin-test-1.1.0-beta1.tgz", + "integrity": "sha512-PrHuM0ub1JOIMj5NmlG2yx/XhdCqX8B2c6Xx1nc6YM354OJSQb1Gq0UPXEKHmQrWw7HvdMz9zDAkwW2k1M0x6g==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 4d6a433a..e4db4a9d 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "devDependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.97", "@apidevtools/json-schema-ref-parser": "^11.7.2", - "@codifycli/plugin-test": "^1.0.0", + "@codifycli/plugin-test": "1.1.0-beta1", "@fastify/merge-json-schemas": "^0.2.0", "@oclif/prettier-config": "^0.2.1", "@oclif/test": "^3", diff --git a/scripts/build.ts b/scripts/build.ts index 59dc874d..9424f18f 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -2,7 +2,7 @@ import { JSONSchema } from '@apidevtools/json-schema-ref-parser'; import { createRequire } from 'node:module'; import { Ajv } from 'ajv'; import { VerbosityLevel } from '@codifycli/plugin-core'; -import { SequentialPty } from '@codifycli/plugin-core/dist/pty/seqeuntial-pty'; +import { SequentialPty } from '@codifycli/plugin-core'; import { IpcMessage, IpcMessageSchema, MessageStatus, ResourceSchema } from '@codifycli/schemas'; import mergeJsonSchemas from 'merge-json-schemas'; import { ChildProcess, fork } from 'node:child_process'; From 7dba6564e5cae5aa9ed7d9563ebcd13e339c0914 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 15:08:00 -0400 Subject: [PATCH 68/98] Bump test library version --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4f867bf..2f6930e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "devDependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.97", "@apidevtools/json-schema-ref-parser": "^11.7.2", - "@codifycli/plugin-test": "1.1.0-beta1", + "@codifycli/plugin-test": "1.1.0-beta2", "@fastify/merge-json-schemas": "^0.2.0", "@oclif/prettier-config": "^0.2.1", "@oclif/test": "^3", @@ -213,9 +213,9 @@ } }, "node_modules/@codifycli/plugin-test": { - "version": "1.1.0-beta1", - "resolved": "https://registry.npmjs.org/@codifycli/plugin-test/-/plugin-test-1.1.0-beta1.tgz", - "integrity": "sha512-PrHuM0ub1JOIMj5NmlG2yx/XhdCqX8B2c6Xx1nc6YM354OJSQb1Gq0UPXEKHmQrWw7HvdMz9zDAkwW2k1M0x6g==", + "version": "1.1.0-beta2", + "resolved": "https://registry.npmjs.org/@codifycli/plugin-test/-/plugin-test-1.1.0-beta2.tgz", + "integrity": "sha512-8Qfuc1Zpq/o3ViY7L4IlOOyQwU/jWfYmKoBZxVBm6vTyOIIRBBt0qWp3LPDYDPs1bJwXS5C8LZ1GPo7wYam4yg==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index e4db4a9d..3dbc7f70 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "devDependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.97", "@apidevtools/json-schema-ref-parser": "^11.7.2", - "@codifycli/plugin-test": "1.1.0-beta1", + "@codifycli/plugin-test": "1.1.0-beta2", "@fastify/merge-json-schemas": "^0.2.0", "@oclif/prettier-config": "^0.2.1", "@oclif/test": "^3", From dc772d09a7281997e52900b5edc048eb83b274a9 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 15:13:46 -0400 Subject: [PATCH 69/98] Bump library version --- .github/workflows/run-all-unit-tests.yaml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index c8024243..3d96842f 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -43,7 +43,7 @@ jobs: export SHELL=/bin/zsh touch ~/.zshrc - npm run test -- ./test/shell --no-file-parallelism --disable-console-intercept + npm run test -- ./test --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' diff --git a/package.json b/package.json index 3dbc7f70..6fa7d4b0 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "license": "ISC", "type": "module", "dependencies": { - "@codifycli/plugin-core": "1.1.0-beta7", + "@codifycli/plugin-core": "1.1.0-beta9", "@codifycli/schemas": "1.0.0", "ajv": "^8.18.0", "ajv-formats": "^2.1.1", From 1735a8b1da9121b92a43e152b6e34f45c7b1cb2d Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 15:14:31 -0400 Subject: [PATCH 70/98] Bump library version --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f6930e7..3f9dd1ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.1.0", "license": "ISC", "dependencies": { - "@codifycli/plugin-core": "1.1.0-beta7", + "@codifycli/plugin-core": "1.1.0-beta9", "@codifycli/schemas": "1.0.0", "ajv": "^8.18.0", "ajv-formats": "^2.1.1", @@ -171,9 +171,9 @@ } }, "node_modules/@codifycli/plugin-core": { - "version": "1.1.0-beta7", - "resolved": "https://registry.npmjs.org/@codifycli/plugin-core/-/plugin-core-1.1.0-beta7.tgz", - "integrity": "sha512-Z4lILl6HijnMWN57/8G0gveEu9MAxh5EDqd4nru46jdTZ89RyTX9///JzzBRei6+LTVaMhKzReJLWhv4Kz75HQ==", + "version": "1.1.0-beta9", + "resolved": "https://registry.npmjs.org/@codifycli/plugin-core/-/plugin-core-1.1.0-beta9.tgz", + "integrity": "sha512-DP740hLc4vOTHRO/EDittQuKByV97wTNBmemYE8Sz0wm8BONFplzIuP1ELpwEaaASh1RseEaswUQd4/cKwXQpA==", "license": "ISC", "dependencies": { "@codifycli/schemas": "1.1.0-beta3", From 267a4dc1dc450789aca75fa43ede48514bc63976 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:11:10 -0400 Subject: [PATCH 71/98] Remove java --- .github/workflows/run-all-unit-tests.yaml | 6 +++--- package-lock.json | 8 ++++---- package.json | 2 +- scripts/cleanup-github-actions.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 3d96842f..08661492 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -33,6 +33,9 @@ jobs: - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' shell: zsh {0} @@ -49,6 +52,3 @@ jobs: if: runner.os == 'Linux' run: npm run test -- ./test --no-file-parallelism --silent=passed-only - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - diff --git a/package-lock.json b/package-lock.json index 3f9dd1ab..fc7a9509 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "devDependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.97", "@apidevtools/json-schema-ref-parser": "^11.7.2", - "@codifycli/plugin-test": "1.1.0-beta2", + "@codifycli/plugin-test": "1.1.0-beta3", "@fastify/merge-json-schemas": "^0.2.0", "@oclif/prettier-config": "^0.2.1", "@oclif/test": "^3", @@ -213,9 +213,9 @@ } }, "node_modules/@codifycli/plugin-test": { - "version": "1.1.0-beta2", - "resolved": "https://registry.npmjs.org/@codifycli/plugin-test/-/plugin-test-1.1.0-beta2.tgz", - "integrity": "sha512-8Qfuc1Zpq/o3ViY7L4IlOOyQwU/jWfYmKoBZxVBm6vTyOIIRBBt0qWp3LPDYDPs1bJwXS5C8LZ1GPo7wYam4yg==", + "version": "1.1.0-beta3", + "resolved": "https://registry.npmjs.org/@codifycli/plugin-test/-/plugin-test-1.1.0-beta3.tgz", + "integrity": "sha512-17vJo9rQpkNJQOn8Mexw+okHcSntHQQXlrnoX567Sl1w3iCQfvjkENakctrTAW4YFX3+obDwQOKOo4Hq6KEhPg==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 6fa7d4b0..eaeaf924 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "devDependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.97", "@apidevtools/json-schema-ref-parser": "^11.7.2", - "@codifycli/plugin-test": "1.1.0-beta2", + "@codifycli/plugin-test": "1.1.0-beta3", "@fastify/merge-json-schemas": "^0.2.0", "@oclif/prettier-config": "^0.2.1", "@oclif/test": "^3", diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 220223b2..18970c98 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -28,6 +28,6 @@ if (Utils.isLinux()) { { type: 'aws-cli' }, ]); - await testSpawn('brew uninstall google-chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs', { interactive: true }); + await testSpawn('brew uninstall google-chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs $(brew list | grep -E \'^openjdk(@|$)\')', { interactive: true }); } From 7bb6ba452c79aadbf2832eef13f357c1a2d36f8f Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:12:52 -0400 Subject: [PATCH 72/98] Remove java --- scripts/cleanup-github-actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cleanup-github-actions.ts b/scripts/cleanup-github-actions.ts index 18970c98..aa670268 100644 --- a/scripts/cleanup-github-actions.ts +++ b/scripts/cleanup-github-actions.ts @@ -28,6 +28,6 @@ if (Utils.isLinux()) { { type: 'aws-cli' }, ]); - await testSpawn('brew uninstall google-chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs $(brew list | grep -E \'^openjdk(@|$)\')', { interactive: true }); + await testSpawn('brew uninstall ant gradle kotlin maven selenium-server google-chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs $(brew list | grep -E \'^openjdk(@|$)\')', { interactive: true }); } From b35c6e0eaa442e0990dd5124d3bcabf2d69bb236 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:17:35 -0400 Subject: [PATCH 73/98] Test java --- .github/workflows/run-all-unit-tests.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 08661492..693db696 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -33,8 +33,8 @@ jobs: - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' @@ -45,8 +45,9 @@ jobs: echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh touch ~/.zshrc + unset JAVA_HOME - npm run test -- ./test --no-file-parallelism --disable-console-intercept + npm run test -- ./test/java --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' From cadcb216ca6efe0774d38f807f3eb6b855dcf1f5 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:27:08 -0400 Subject: [PATCH 74/98] Test java --- .github/workflows/run-all-unit-tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 693db696..0e13f9c3 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -46,6 +46,8 @@ jobs: export SHELL=/bin/zsh touch ~/.zshrc unset JAVA_HOME + export PATH=/usr/bin:/bin:/usr/sbin:/sbin + npm run test -- ./test/java --no-file-parallelism --disable-console-intercept From 3d01bb85236adc672ac2436d678ca50979879aee Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:32:02 -0400 Subject: [PATCH 75/98] Test java --- .github/workflows/run-all-unit-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 0e13f9c3..833273e2 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -46,7 +46,8 @@ jobs: export SHELL=/bin/zsh touch ~/.zshrc unset JAVA_HOME - export PATH=/usr/bin:/bin:/usr/sbin:/sbin + export PATH=/Users/runner/work/default-plugin/default-plugin/node_modules/.bin:/Users/runner/work/default-plugin/node_modules/.bin:/Users/runner/work/node_modules/.bin:/Users/runner/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/runner/hostedtoolcache/node/24.15.0/arm64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/Users/runner/hostedtoolcache/node/24.15.0/arm64/bin:/opt/homebrew/lib/ruby/gems/3.3.0/bin:/opt/homebrew/opt/ruby@3.3/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin + npm run test -- ./test/java --no-file-parallelism --disable-console-intercept From 7a7a48ba00e5afa22acc46d2dd8545c4ea1c5d39 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:40:14 -0400 Subject: [PATCH 76/98] Improve path and added logging --- .github/workflows/run-all-unit-tests.yaml | 4 +--- src/resources/java/jenv/jenv.ts | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 833273e2..8a1bd30c 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -46,9 +46,7 @@ jobs: export SHELL=/bin/zsh touch ~/.zshrc unset JAVA_HOME - export PATH=/Users/runner/work/default-plugin/default-plugin/node_modules/.bin:/Users/runner/work/default-plugin/node_modules/.bin:/Users/runner/work/node_modules/.bin:/Users/runner/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/runner/hostedtoolcache/node/24.15.0/arm64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/Users/runner/hostedtoolcache/node/24.15.0/arm64/bin:/opt/homebrew/lib/ruby/gems/3.3.0/bin:/opt/homebrew/opt/ruby@3.3/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin - - + export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin npm run test -- ./test/java --no-file-parallelism --disable-console-intercept diff --git a/src/resources/java/jenv/jenv.ts b/src/resources/java/jenv/jenv.ts index b0d4fe92..fddc4ddf 100644 --- a/src/resources/java/jenv/jenv.ts +++ b/src/resources/java/jenv/jenv.ts @@ -55,6 +55,8 @@ export class JenvResource extends Resource { return null } + console.log('Zshrc', fs.readFileSync('~/.zshrc', 'utf8')); + // For some reason jenv doctor will return with a non-zero status code even // if it's successful. We can ignore the status code and only check for the text const jenvDoctor = await $.spawnSafe('jenv doctor') From 032f76abcf444737e56d0dae6641a4ea02feb4a5 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:46:03 -0400 Subject: [PATCH 77/98] Improve path and added logging --- src/resources/java/jenv/jenv.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/resources/java/jenv/jenv.ts b/src/resources/java/jenv/jenv.ts index fddc4ddf..85a16e70 100644 --- a/src/resources/java/jenv/jenv.ts +++ b/src/resources/java/jenv/jenv.ts @@ -9,6 +9,7 @@ import { JAVA_VERSION_INTEGER, } from './java-versions-parameter.js'; import Schema from './jenv-schema.json'; +import os from 'node:os'; export interface JenvConfig extends ResourceConfig { add?: string[], @@ -50,13 +51,15 @@ export class JenvResource extends Resource { override async refresh(): Promise | null> { const $ = getPty(); + console.log('Zshrc', fs.readFileSync(`${os.homedir}/.zshrc`, 'utf8')); + console.log('Path', (await $.spawnSafe('echo $PATH')).data); + + const jenvQuery = await $.spawnSafe('which jenv') if (jenvQuery.status === SpawnStatus.ERROR) { return null } - console.log('Zshrc', fs.readFileSync('~/.zshrc', 'utf8')); - // For some reason jenv doctor will return with a non-zero status code even // if it's successful. We can ignore the status code and only check for the text const jenvDoctor = await $.spawnSafe('jenv doctor') From 4bc3c69bffefec64bcbb8cfda5d6d6e6ff438c1e Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 16:52:06 -0400 Subject: [PATCH 78/98] Enable ssh --- .github/workflows/run-all-unit-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 8a1bd30c..f65594a3 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -33,8 +33,8 @@ jobs: - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' From 2c6ad85d85f0c628115cf8f1b743b95eb5286f73 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:04:30 -0400 Subject: [PATCH 79/98] Fix jenv destroy --- .github/workflows/run-all-unit-tests.yaml | 6 ++++-- src/resources/java/jenv/jenv.ts | 14 +++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index f65594a3..afd8fc88 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -33,8 +33,8 @@ jobs: - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - name: Run tests (macOS - zsh login shell) if: runner.os == 'macOS' @@ -42,6 +42,8 @@ jobs: run: | sudo chsh -s $(which zsh) $USER echo $0 + +# Clean up the residue from the bashrc file echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh touch ~/.zshrc diff --git a/src/resources/java/jenv/jenv.ts b/src/resources/java/jenv/jenv.ts index 85a16e70..9fed6e72 100644 --- a/src/resources/java/jenv/jenv.ts +++ b/src/resources/java/jenv/jenv.ts @@ -102,7 +102,19 @@ export class JenvResource extends Resource { override async destroy(): Promise { const $ = getPty(); - await $.spawn('rm -rf $HOME/.jenv'); + + if (Utils.isMacOS()) { + const brewPrefix = await $.spawnSafe('brew --prefix', { interactive: true }); + if (brewPrefix.status === SpawnStatus.SUCCESS) { + const jenvPath = await $.spawnSafe('which jenv', { interactive: true }); + if (jenvPath.status === SpawnStatus.SUCCESS && jenvPath.data.trim().startsWith(brewPrefix.data.trim())) { + await $.spawn('brew uninstall jenv', { interactive: true }); + } + } + await $.spawnSafe('rm -rf $HOME/.jenv'); + } else { + await $.spawnSafe('rm -rf $HOME/.jenv'); + } await FileUtils.removeLineFromStartupFile('export PATH="$HOME/.jenv/bin:$PATH"') await FileUtils.removeLineFromStartupFile('eval "$(jenv init -)"') From a4a555804db365754da0f58d2582fd4f05f5eceb Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:05:04 -0400 Subject: [PATCH 80/98] Fix comment --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index afd8fc88..cd2cf735 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -43,7 +43,7 @@ jobs: sudo chsh -s $(which zsh) $USER echo $0 -# Clean up the residue from the bashrc file +# Clean up the residue from the bashrc file echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh touch ~/.zshrc From ad27052202b2525bff7d795225898c799c0818cb Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:05:39 -0400 Subject: [PATCH 81/98] Fix comment --- .github/workflows/run-all-unit-tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index cd2cf735..389698ab 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -43,7 +43,6 @@ jobs: sudo chsh -s $(which zsh) $USER echo $0 -# Clean up the residue from the bashrc file echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh touch ~/.zshrc From 3546ea4efb0549b5d33e5bb4776c5d544b28660d Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:11:35 -0400 Subject: [PATCH 82/98] Fix jenv uninstall --- src/resources/java/jenv/jenv.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/resources/java/jenv/jenv.ts b/src/resources/java/jenv/jenv.ts index 9fed6e72..0fb40ada 100644 --- a/src/resources/java/jenv/jenv.ts +++ b/src/resources/java/jenv/jenv.ts @@ -104,10 +104,9 @@ export class JenvResource extends Resource { const $ = getPty(); if (Utils.isMacOS()) { - const brewPrefix = await $.spawnSafe('brew --prefix', { interactive: true }); - if (brewPrefix.status === SpawnStatus.SUCCESS) { - const jenvPath = await $.spawnSafe('which jenv', { interactive: true }); - if (jenvPath.status === SpawnStatus.SUCCESS && jenvPath.data.trim().startsWith(brewPrefix.data.trim())) { + if (await Utils.isHomebrewInstalled()) { + const isHomebrewInstall = await $.spawnSafe('brew list jenv', { interactive: true }); + if (isHomebrewInstall.status === SpawnStatus.SUCCESS) { await $.spawn('brew uninstall jenv', { interactive: true }); } } From 920e243bc00c9c2be3eeb4ee315cb27dfb7baedd Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:18:18 -0400 Subject: [PATCH 83/98] Run xcode-tools vscode macports --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 389698ab..5bc38a5a 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -53,5 +53,5 @@ jobs: - name: Run tests (Linux) if: runner.os == 'Linux' - run: npm run test -- ./test --no-file-parallelism --silent=passed-only + run: npm run test -- ./test/xcode-tools ./test/vscode ./test/macports --no-file-parallelism --silent=passed-only From 6e78a8afec4c738b319cf2381bc02300dd169477 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:20:03 -0400 Subject: [PATCH 84/98] Run xcode-tools vscode macports --- .github/workflows/run-all-unit-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 5bc38a5a..be3a597e 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -49,9 +49,9 @@ jobs: unset JAVA_HOME export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin - npm run test -- ./test/java --no-file-parallelism --disable-console-intercept + npm run test -- ./test/xcode-tools ./test/vscode ./test/macports --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' - run: npm run test -- ./test/xcode-tools ./test/vscode ./test/macports --no-file-parallelism --silent=passed-only + run: npm run test -- ./test --no-file-parallelism --silent=passed-only From 255e97ac314fbf635b113ef39f542b83d5f3466d Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:33:29 -0400 Subject: [PATCH 85/98] Fix downloads --- .github/workflows/run-all-unit-tests.yaml | 3 ++- src/resources/docker/docker.ts | 2 +- src/resources/macports/macports.ts | 2 +- test/xcode-tools/xcode-tools.test.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index be3a597e..ca27dbee 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -48,8 +48,9 @@ jobs: touch ~/.zshrc unset JAVA_HOME export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin + export CI=true - npm run test -- ./test/xcode-tools ./test/vscode ./test/macports --no-file-parallelism --disable-console-intercept + npm run test -- ./test/xcode-tools ./test/vscode ./test/macports ./test/docker --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' diff --git a/src/resources/docker/docker.ts b/src/resources/docker/docker.ts index 866dfecb..64ca858f 100644 --- a/src/resources/docker/docker.ts +++ b/src/resources/docker/docker.ts @@ -72,7 +72,7 @@ export class DockerResource extends Resource { const downloadLink = await Utils.isArmArch() ? ARM_DOWNLOAD_LINK : INTEL_DOWNLOAD_LINK; const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'codify-docker')) - await FileUtils.downloadFile(path.join(tmpDir, 'Docker.dmg'), downloadLink); + await FileUtils.downloadFile(downloadLink, path.join(tmpDir, 'Docker.dmg')); const user = Utils.getUser(); try { diff --git a/src/resources/macports/macports.ts b/src/resources/macports/macports.ts index dd3b0ee9..e3da6056 100644 --- a/src/resources/macports/macports.ts +++ b/src/resources/macports/macports.ts @@ -65,7 +65,7 @@ export class MacportsResource extends Resource { const installerPath = path.join(tmpDir, 'installer.pkg') console.log(`Downloading macports installer ${installerUrl}`) - await FileUtils.downloadFile(installerPath, installerUrl); + await FileUtils.downloadFile(installerUrl, installerPath); await $.spawn(`installer -pkg "${installerPath}" -target /;`, { requiresRoot: true }) diff --git a/test/xcode-tools/xcode-tools.test.ts b/test/xcode-tools/xcode-tools.test.ts index 7487789f..8ad294ae 100644 --- a/test/xcode-tools/xcode-tools.test.ts +++ b/test/xcode-tools/xcode-tools.test.ts @@ -5,7 +5,7 @@ import { Utils } from '@codifycli/plugin-core'; const pluginPath = path.resolve('./src/index.ts'); -describe('XCode tools install tests', { skip: !Utils.isMacOS() }, async () => { +describe('XCode tools install tests', { skip: !Utils.isMacOS() || process.env.CI }, async () => { it('Can uninstall xcode tools', { timeout: 300_000 }, async () => { await PluginTester.uninstall(pluginPath, [{ type: 'xcode-tools' From 438f3aa878b762772311b811f6aed03c47e9572e Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:39:46 -0400 Subject: [PATCH 86/98] Test asdf --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index ca27dbee..f614d382 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -50,7 +50,7 @@ jobs: export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin export CI=true - npm run test -- ./test/xcode-tools ./test/vscode ./test/macports ./test/docker --no-file-parallelism --disable-console-intercept + npm run test -- ./test/asdf --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' From 3855905a37787078f371dbcd310647c81d792cc3 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 17:49:56 -0400 Subject: [PATCH 87/98] Test adnroid homebrew custom install --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index f614d382..68ef56dd 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -50,7 +50,7 @@ jobs: export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin export CI=true - npm run test -- ./test/asdf --no-file-parallelism --disable-console-intercept + npm run test -- ./test/android ./test/homebrew/custom-install.test.ts --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' From a59e86a401dc4993b038204bb44c71c1d97032b5 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 18:03:01 -0400 Subject: [PATCH 88/98] Hard code mount point --- .github/workflows/run-all-unit-tests.yaml | 2 +- src/resources/android/android-studio.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 68ef56dd..51f2b653 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -50,7 +50,7 @@ jobs: export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin export CI=true - npm run test -- ./test/android ./test/homebrew/custom-install.test.ts --no-file-parallelism --disable-console-intercept + npm run test -- ./test/android --no-file-parallelism --disable-console-intercept - name: Run tests (Linux) if: runner.os == 'Linux' diff --git a/src/resources/android/android-studio.ts b/src/resources/android/android-studio.ts index 3af17a38..6168b595 100644 --- a/src/resources/android/android-studio.ts +++ b/src/resources/android/android-studio.ts @@ -144,15 +144,16 @@ export class AndroidStudioResource extends Resource { try { await $.spawn(`curl -fsSL ${downloadLink.link} -o android-studio.dmg`, { cwd: temporaryDir }); + const mountedDir = '/Volumes/android-studio' - const { data } = await $.spawn('hdiutil attach android-studio.dmg', { cwd: temporaryDir }); - const mountedDir = data.split(/\n/) + const { data } = await $.spawn('hdiutil attach android-studio.dmg -mountpoint "/Volumes/android-studio"', { cwd: temporaryDir }); + const mountData = data.split(/\n/) .find((l) => l.includes('/Volumes/')) ?.split(' ') ?.at(-1) ?.trim() - if (!mountedDir) { + if (!mountData) { throw new Error('Unable to mount dmg or find the mounted volume') } From 59bcc92193234bc50e06cf2536cbaad70aff9c87 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 18:08:08 -0400 Subject: [PATCH 89/98] Enable all tests except homebrew --- .github/workflows/run-all-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 51f2b653..086a5f60 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -50,7 +50,7 @@ jobs: export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin export CI=true - npm run test -- ./test/android --no-file-parallelism --disable-console-intercept + npm run test -- ./test --no-file-parallelism --disable-console-intercept --exclude ./test/homebrew - name: Run tests (Linux) if: runner.os == 'Linux' From 57dfb6157357ede6e2c714c0c808104f93068cf4 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:00:06 -0400 Subject: [PATCH 90/98] Added sharding --- .github/workflows/run-all-unit-tests.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests.yaml index 086a5f60..b9e16d75 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests.yaml @@ -18,6 +18,7 @@ jobs: matrix: os: [macos-latest] # os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] + shard: ["1/5", "2/5", "3/5", "4/5", "5/5"] steps: - uses: actions/checkout@v4 @@ -43,16 +44,16 @@ jobs: sudo chsh -s $(which zsh) $USER echo $0 - echo $ZSH_NAME $ZSH_VERSION + echo $ZSH_NAME $ZSH_VERSION export SHELL=/bin/zsh touch ~/.zshrc unset JAVA_HOME export PATH=/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/usr/bin:/bin:/usr/sbin:/sbin export CI=true - - npm run test -- ./test --no-file-parallelism --disable-console-intercept --exclude ./test/homebrew + + npm run test -- ./test --no-file-parallelism --disable-console-intercept --exclude ./test/homebrew --shard ${{ matrix.shard }} - name: Run tests (Linux) if: runner.os == 'Linux' - run: npm run test -- ./test --no-file-parallelism --silent=passed-only + run: npm run test -- ./test --no-file-parallelism --silent=passed-only --shard ${{ matrix.shard }} From 9a3f6eb2fb30eb8719ddb51cac9fb3b34df6f12b Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:19:12 -0400 Subject: [PATCH 91/98] Added sharding for linux. Enable linux. Split MacOS and Linux tests --- .../workflows/run-all-unit-tests-linux.yaml | 43 +++++++++++++++++++ ...sts.yaml => run-all-unit-tests-macos.yaml} | 9 +--- 2 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/run-all-unit-tests-linux.yaml rename .github/workflows/{run-all-unit-tests.yaml => run-all-unit-tests-macos.yaml} (82%) diff --git a/.github/workflows/run-all-unit-tests-linux.yaml b/.github/workflows/run-all-unit-tests-linux.yaml new file mode 100644 index 00000000..936e3a3a --- /dev/null +++ b/.github/workflows/run-all-unit-tests-linux.yaml @@ -0,0 +1,43 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Test all on Demand (Linux) + +on: + push: +# schedule: +# - cron: '0 0 * * 0' # Every Sunday at midnight UTC + workflow_dispatch: + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] +# os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] + shard: ["1/20", "2/20", "3/20", "4/20", "5/20", "6/20", "7/20", "8/20", "9/20", "10/20", "11/20", "12/20", "13/20", "14/20", "15/20", "16/20", "17/20", "18/20", "19/20", "20/20"] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 24 + uses: actions/setup-node@v4 + with: + node-version: '24.x' + cache: 'npm' + - name: Enable linger for admin user (Linux only) + if: runner.os == 'Linux' + run: loginctl enable-linger $(whoami) + + - run: npm ci + - run: npx tsx scripts/cleanup-github-actions.ts + +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 + + - name: Run tests (Linux) + if: runner.os == 'Linux' + run: npm run test -- ./test --no-file-parallelism --silent=passed-only --shard ${{ matrix.shard }} + diff --git a/.github/workflows/run-all-unit-tests.yaml b/.github/workflows/run-all-unit-tests-macos.yaml similarity index 82% rename from .github/workflows/run-all-unit-tests.yaml rename to .github/workflows/run-all-unit-tests-macos.yaml index b9e16d75..b56eee8d 100644 --- a/.github/workflows/run-all-unit-tests.yaml +++ b/.github/workflows/run-all-unit-tests-macos.yaml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs -name: Test all on Demand +name: Test all on Demand (MacOS) on: push: @@ -27,9 +27,6 @@ jobs: with: node-version: '24.x' cache: 'npm' - - name: Enable linger for admin user (Linux only) - if: runner.os == 'Linux' - run: loginctl enable-linger $(whoami) - run: npm ci - run: npx tsx scripts/cleanup-github-actions.ts @@ -53,7 +50,3 @@ jobs: npm run test -- ./test --no-file-parallelism --disable-console-intercept --exclude ./test/homebrew --shard ${{ matrix.shard }} - - name: Run tests (Linux) - if: runner.os == 'Linux' - run: npm run test -- ./test --no-file-parallelism --silent=passed-only --shard ${{ matrix.shard }} - From f7e3fd62e9651d011ac50cb704cb846205478dfd Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:28:19 -0400 Subject: [PATCH 92/98] Remove errorenous logging --- src/resources/java/jenv/jenv.ts | 4 ---- test/shell/path.test.ts | 6 ------ vitest.config.ts | 4 +--- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/resources/java/jenv/jenv.ts b/src/resources/java/jenv/jenv.ts index 0fb40ada..663c2e00 100644 --- a/src/resources/java/jenv/jenv.ts +++ b/src/resources/java/jenv/jenv.ts @@ -51,10 +51,6 @@ export class JenvResource extends Resource { override async refresh(): Promise | null> { const $ = getPty(); - console.log('Zshrc', fs.readFileSync(`${os.homedir}/.zshrc`, 'utf8')); - console.log('Path', (await $.spawnSafe('echo $PATH')).data); - - const jenvQuery = await $.spawnSafe('which jenv') if (jenvQuery.status === SpawnStatus.ERROR) { return null diff --git a/test/shell/path.test.ts b/test/shell/path.test.ts index 1ce8bfe8..ec25c855 100644 --- a/test/shell/path.test.ts +++ b/test/shell/path.test.ts @@ -65,12 +65,6 @@ describe('Path resource integration tests', async () => { ], { validateApply: async () => { const { data: path } = await testSpawn('echo $PATH', { interactive: true }); - - console.log('My path', path); - console.log('Temp dir 1', tempDir1); - console.log('Temp dir 2', tempDir2); - console.log('Zshrc', await fs.readFile(`${os.homedir()}/.zshrc`, 'utf-8')) - expect(path).to.include(tempDir1); expect(path).to.include(tempDir2); }, diff --git a/vitest.config.ts b/vitest.config.ts index 7111816e..1e0a1015 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,9 +4,7 @@ export default defineConfig({ test: { pool: 'forks', onConsoleLog: (log) => { - if (!process.env.CI) { - process.stdout.write(log); - } + process.stdout.write(log); }, watch: false, setupFiles: ['./test/setup.ts'], From c943d198f85b664538e16c11625d030b875436a5 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:35:03 -0400 Subject: [PATCH 93/98] Test jenv --- .github/workflows/run-all-unit-tests-linux.yaml | 4 ++-- .github/workflows/run-all-unit-tests-macos.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-all-unit-tests-linux.yaml b/.github/workflows/run-all-unit-tests-linux.yaml index 936e3a3a..08078a47 100644 --- a/.github/workflows/run-all-unit-tests-linux.yaml +++ b/.github/workflows/run-all-unit-tests-linux.yaml @@ -18,7 +18,7 @@ jobs: matrix: os: [ubuntu-latest] # os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] - shard: ["1/20", "2/20", "3/20", "4/20", "5/20", "6/20", "7/20", "8/20", "9/20", "10/20", "11/20", "12/20", "13/20", "14/20", "15/20", "16/20", "17/20", "18/20", "19/20", "20/20"] +# shard: ["1/20", "2/20", "3/20", "4/20", "5/20", "6/20", "7/20", "8/20", "9/20", "10/20", "11/20", "12/20", "13/20", "14/20", "15/20", "16/20", "17/20", "18/20", "19/20", "20/20"] steps: - uses: actions/checkout@v4 @@ -39,5 +39,5 @@ jobs: - name: Run tests (Linux) if: runner.os == 'Linux' - run: npm run test -- ./test --no-file-parallelism --silent=passed-only --shard ${{ matrix.shard }} + run: npm run test -- ./test/java --no-file-parallelism --disable-console-intercept --shard ${{ matrix.shard }} diff --git a/.github/workflows/run-all-unit-tests-macos.yaml b/.github/workflows/run-all-unit-tests-macos.yaml index b56eee8d..d872e9fd 100644 --- a/.github/workflows/run-all-unit-tests-macos.yaml +++ b/.github/workflows/run-all-unit-tests-macos.yaml @@ -4,7 +4,7 @@ name: Test all on Demand (MacOS) on: - push: +# push: # schedule: # - cron: '0 0 * * 0' # Every Sunday at midnight UTC workflow_dispatch: From 909e99bf943b2c2110ee035057ed6932a1d8e320 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:36:21 -0400 Subject: [PATCH 94/98] Test jenv --- .github/workflows/run-all-unit-tests-linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-all-unit-tests-linux.yaml b/.github/workflows/run-all-unit-tests-linux.yaml index 08078a47..730c5a4f 100644 --- a/.github/workflows/run-all-unit-tests-linux.yaml +++ b/.github/workflows/run-all-unit-tests-linux.yaml @@ -39,5 +39,5 @@ jobs: - name: Run tests (Linux) if: runner.os == 'Linux' - run: npm run test -- ./test/java --no-file-parallelism --disable-console-intercept --shard ${{ matrix.shard }} + run: npm run test -- ./test/java --no-file-parallelism --disable-console-intercept # --shard ${{ matrix.shard }} From 6aee4179761b01da0d23e27475de6be16c007dc4 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:49:11 -0400 Subject: [PATCH 95/98] Fixes in the library --- package-lock.json | 8 ++++---- package.json | 2 +- src/resources/java/jenv/java-versions-parameter.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc7a9509..1e832d75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.1.0", "license": "ISC", "dependencies": { - "@codifycli/plugin-core": "1.1.0-beta9", + "@codifycli/plugin-core": "1.1.0-beta10", "@codifycli/schemas": "1.0.0", "ajv": "^8.18.0", "ajv-formats": "^2.1.1", @@ -171,9 +171,9 @@ } }, "node_modules/@codifycli/plugin-core": { - "version": "1.1.0-beta9", - "resolved": "https://registry.npmjs.org/@codifycli/plugin-core/-/plugin-core-1.1.0-beta9.tgz", - "integrity": "sha512-DP740hLc4vOTHRO/EDittQuKByV97wTNBmemYE8Sz0wm8BONFplzIuP1ELpwEaaASh1RseEaswUQd4/cKwXQpA==", + "version": "1.1.0-beta10", + "resolved": "https://registry.npmjs.org/@codifycli/plugin-core/-/plugin-core-1.1.0-beta10.tgz", + "integrity": "sha512-M87hg3wXQKO/Cgj05PtobVTJ7kirYyGvmIgqcHwdqUrO8wJx92EnHWsrOvpCRVnG4XP05JxKROvcVbjPrW7OWA==", "license": "ISC", "dependencies": { "@codifycli/schemas": "1.1.0-beta3", diff --git a/package.json b/package.json index eaeaf924..c29d0cb8 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "license": "ISC", "type": "module", "dependencies": { - "@codifycli/plugin-core": "1.1.0-beta9", + "@codifycli/plugin-core": "1.1.0-beta10", "@codifycli/schemas": "1.0.0", "ajv": "^8.18.0", "ajv-formats": "^2.1.1", diff --git a/src/resources/java/jenv/java-versions-parameter.ts b/src/resources/java/jenv/java-versions-parameter.ts index 26a07eca..041439dc 100644 --- a/src/resources/java/jenv/java-versions-parameter.ts +++ b/src/resources/java/jenv/java-versions-parameter.ts @@ -218,7 +218,7 @@ export class JenvAddParameter extends ArrayStatefulParameter if (linuxMatch) { const version = linuxMatch[1]; await $.spawn(`jenv remove ${param}`, { interactive: true }) - await $.spawn(`sudo apt-get remove -y openjdk-${version}-jdk`, { interactive: true }) + await $.spawn(`apt-get remove -y openjdk-${version}-jdk`, { interactive: true, requiresRoot: true }) return; } } From 9255b73e5335e300f17ad97b3bd93ff4c71f238c Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 20:52:18 -0400 Subject: [PATCH 96/98] Enabled all tests again --- .../workflows/run-all-unit-tests-linux.yaml | 4 +-- .../workflows/run-all-unit-tests-macos.yaml | 2 +- scripts/cleanup-circleci.ts | 27 ------------------- 3 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 scripts/cleanup-circleci.ts diff --git a/.github/workflows/run-all-unit-tests-linux.yaml b/.github/workflows/run-all-unit-tests-linux.yaml index 730c5a4f..f852f372 100644 --- a/.github/workflows/run-all-unit-tests-linux.yaml +++ b/.github/workflows/run-all-unit-tests-linux.yaml @@ -18,7 +18,7 @@ jobs: matrix: os: [ubuntu-latest] # os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] -# shard: ["1/20", "2/20", "3/20", "4/20", "5/20", "6/20", "7/20", "8/20", "9/20", "10/20", "11/20", "12/20", "13/20", "14/20", "15/20", "16/20", "17/20", "18/20", "19/20", "20/20"] + shard: ["1/20", "2/20", "3/20", "4/20", "5/20", "6/20", "7/20", "8/20", "9/20", "10/20", "11/20", "12/20", "13/20", "14/20", "15/20", "16/20", "17/20", "18/20", "19/20", "20/20"] steps: - uses: actions/checkout@v4 @@ -39,5 +39,5 @@ jobs: - name: Run tests (Linux) if: runner.os == 'Linux' - run: npm run test -- ./test/java --no-file-parallelism --disable-console-intercept # --shard ${{ matrix.shard }} + run: npm run test -- ./test --no-file-parallelism --disable-console-intercept --shard ${{ matrix.shard }} diff --git a/.github/workflows/run-all-unit-tests-macos.yaml b/.github/workflows/run-all-unit-tests-macos.yaml index d872e9fd..b56eee8d 100644 --- a/.github/workflows/run-all-unit-tests-macos.yaml +++ b/.github/workflows/run-all-unit-tests-macos.yaml @@ -4,7 +4,7 @@ name: Test all on Demand (MacOS) on: -# push: + push: # schedule: # - cron: '0 0 * * 0' # Every Sunday at midnight UTC workflow_dispatch: diff --git a/scripts/cleanup-circleci.ts b/scripts/cleanup-circleci.ts deleted file mode 100644 index 2eed5d4f..00000000 --- a/scripts/cleanup-circleci.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { PluginTester, testSpawn } from '@codifycli/plugin-test'; -import path from 'node:path'; - -const pluginPath = path.resolve('./src/index.ts'); - -// Uninstall resources that have Codify resource definitions -await PluginTester.uninstall(pluginPath, [ - { type: 'pyenv' }, - { type: 'rbenv' }, -]); - -// Remove pre-installed tools that don't have Codify resources -// Go -await testSpawn('rm -rf /usr/local/go', { requiresRoot: true }); - -// Google Cloud SDK -await testSpawn('rm -rf /opt/google/google-cloud-sdk', { requiresRoot: true }); - -// Apache Maven -await testSpawn('rm -rf /usr/local/apache-maven', { requiresRoot: true }); - -// Gradle -await testSpawn('rm -rf /usr/local/gradle-*', { requiresRoot: true }); - -// Yarn (installed via ~/.yarn and ~/.config/yarn) -await testSpawn('rm -rf ~/.yarn ~/.config/yarn'); - From 475e45716a90c1d5958168ef97ece7e3ad6a8405 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 21:10:55 -0400 Subject: [PATCH 97/98] Set up tests to only run when merging to release branch and change the cron to run daily --- ...-tests-linux.yaml => run-all-tests-cron-linux.yaml} | 10 ++++++---- ...-tests-macos.yaml => run-all-tests-cron-macos.yaml} | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) rename .github/workflows/{run-all-unit-tests-linux.yaml => run-all-tests-cron-linux.yaml} (90%) rename .github/workflows/{run-all-unit-tests-macos.yaml => run-all-tests-cron-macos.yaml} (91%) diff --git a/.github/workflows/run-all-unit-tests-linux.yaml b/.github/workflows/run-all-tests-cron-linux.yaml similarity index 90% rename from .github/workflows/run-all-unit-tests-linux.yaml rename to .github/workflows/run-all-tests-cron-linux.yaml index f852f372..f6a6ed92 100644 --- a/.github/workflows/run-all-unit-tests-linux.yaml +++ b/.github/workflows/run-all-tests-cron-linux.yaml @@ -1,12 +1,14 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs -name: Test all on Demand (Linux) +name: Test all cron (Linux) on: - push: -# schedule: -# - cron: '0 0 * * 0' # Every Sunday at midnight UTC + pull_request: + branches: + - release + schedule: + - cron: '0 0 * * *' # Every day at midnight UTC workflow_dispatch: jobs: diff --git a/.github/workflows/run-all-unit-tests-macos.yaml b/.github/workflows/run-all-tests-cron-macos.yaml similarity index 91% rename from .github/workflows/run-all-unit-tests-macos.yaml rename to .github/workflows/run-all-tests-cron-macos.yaml index b56eee8d..ae9b74b6 100644 --- a/.github/workflows/run-all-unit-tests-macos.yaml +++ b/.github/workflows/run-all-tests-cron-macos.yaml @@ -1,12 +1,14 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs -name: Test all on Demand (MacOS) +name: Test all cron (MacOS) on: - push: -# schedule: -# - cron: '0 0 * * 0' # Every Sunday at midnight UTC + pull_request: + branches: + - release + schedule: + - cron: '0 0 * * *' # Every day at midnight UTC workflow_dispatch: jobs: From 3c6d0a4ae0c120759244a9fbaa5deb76d273a444 Mon Sep 17 00:00:00 2001 From: kevinwang Date: Wed, 22 Apr 2026 21:32:07 -0400 Subject: [PATCH 98/98] Add action to run claude on test failure --- .github/workflows/claude-fixer.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/claude-fixer.yml diff --git a/.github/workflows/claude-fixer.yml b/.github/workflows/claude-fixer.yml new file mode 100644 index 00000000..d0bfc712 --- /dev/null +++ b/.github/workflows/claude-fixer.yml @@ -0,0 +1,30 @@ +name: Claude Test Fixer +on: + workflow_run: + workflows: ["Test all cron (Linux)", "Test all cron (MacOS)"] + types: [completed] + +jobs: + fix-on-failure: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + permissions: + contents: write + pull-requests: write + actions: read # Allows Claude to read the logs of the failed run + steps: + - uses: actions/checkout@v4 + - name: Claude Fix Failed Tests + uses: anthropics/claude-code-action@v1 + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + prompt: | + The "CI Tests" workflow just failed. + 1. Analyze the logs from the last failed run. + 2. Identify the root cause of the test failure. + 3. Implement a fix and create a new pull request. + + + + additional_permissions: | + actions: read