Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
63786b8
feat: temp add push to test and disable fail-fast
kevinwang5658 Apr 21, 2026
1e3d908
feat: added circleCI config
kevinwang5658 Apr 21, 2026
1b40b5c
fix: circleCI config
kevinwang5658 Apr 21, 2026
fdce81c
fix: changed macOS config and disabled github actions
kevinwang5658 Apr 21, 2026
fb41ce1
fix: circleci config
kevinwang5658 Apr 21, 2026
4b6bf8f
fix: on linux chowned dirs so that ubuntu can access them without root
kevinwang5658 Apr 21, 2026
1f9a3f8
fix: on linux chowned dirs so that ubuntu can access them without root
kevinwang5658 Apr 21, 2026
05bdb3a
fix: switched user for chown. Added cleanup script
kevinwang5658 Apr 21, 2026
507b873
fix: path in script
kevinwang5658 Apr 21, 2026
0db2620
fix updated rbenv
kevinwang5658 Apr 21, 2026
22adcec
fix added requires root
kevinwang5658 Apr 21, 2026
08a6339
fix remove uv from cleanup
kevinwang5658 Apr 21, 2026
62fabaa
feat: enable all linux tests again
kevinwang5658 Apr 21, 2026
19ec5ac
feat: switch back to github actions
kevinwang5658 Apr 21, 2026
3ac1f18
feat: add ssh
kevinwang5658 Apr 21, 2026
a0429bc
feat: add github actions cleanup
kevinwang5658 Apr 21, 2026
2229728
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
83fbffa
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
51f6e75
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
f80516d
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
7d1d33e
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
8523250
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
b8358c9
feat: add github actions cleanup
kevinwang5658 Apr 22, 2026
b7d0f5a
feat: improve aws cleanup
kevinwang5658 Apr 22, 2026
2fd87a4
feat: enable all tests once more
kevinwang5658 Apr 22, 2026
7f7f301
feat: enable all tests once more
kevinwang5658 Apr 22, 2026
5dc6e58
feat: added command not found
kevinwang5658 Apr 22, 2026
71b6a73
feat: added command not found
kevinwang5658 Apr 22, 2026
820b7b7
feat: added command not found
kevinwang5658 Apr 22, 2026
e5e2106
feat: added command not found
kevinwang5658 Apr 22, 2026
d5976b9
feat: added command not found
kevinwang5658 Apr 22, 2026
eb42ea0
feat: added command not found
kevinwang5658 Apr 22, 2026
131ddf5
feat: added command not found
kevinwang5658 Apr 22, 2026
77f9b21
feat: keep system python3
kevinwang5658 Apr 22, 2026
8217f65
feat: remove ssh
kevinwang5658 Apr 22, 2026
3f98f2c
feat: move apt autoremove down
kevinwang5658 Apr 22, 2026
80b2eb5
feat: add both ubuntus
kevinwang5658 Apr 22, 2026
bdf7e96
feat: enable macOS
kevinwang5658 Apr 22, 2026
e20846b
feat: enable macOS
kevinwang5658 Apr 22, 2026
549e281
feat: enable macOS
kevinwang5658 Apr 22, 2026
04f7cb8
feat: enable macOS
kevinwang5658 Apr 22, 2026
a5da97c
feat: enable macOS
kevinwang5658 Apr 22, 2026
9584c72
feat: enable macOS
kevinwang5658 Apr 22, 2026
c03e96b
feat: enable macOS
kevinwang5658 Apr 22, 2026
45bc619
feat: enable macOS
kevinwang5658 Apr 22, 2026
b4fd9a0
feat: enable macOS
kevinwang5658 Apr 22, 2026
e1c52cb
feat: enable macOS
kevinwang5658 Apr 22, 2026
c1334b8
feat: switch to zsh
kevinwang5658 Apr 22, 2026
60d9afb
feat: add ssh
kevinwang5658 Apr 22, 2026
09f69b7
fix: migrated to the Utils from @codifycli/plugin-core. Supports non-…
kevinwang5658 Apr 22, 2026
0b42ca1
fix: make zsh run a login shell
kevinwang5658 Apr 22, 2026
3c41cfc
Added logging for shell info
kevinwang5658 Apr 22, 2026
8e0c78b
Moved logging
kevinwang5658 Apr 22, 2026
af5b6ad
Moved logging
kevinwang5658 Apr 22, 2026
7f9519e
Trying to change to zsh shell
kevinwang5658 Apr 22, 2026
78b1b77
Trying to change to zsh shell
kevinwang5658 Apr 22, 2026
bc5197b
Trying to change to zsh shell
kevinwang5658 Apr 22, 2026
4a5f73e
Trying to change to zsh shell
kevinwang5658 Apr 22, 2026
e2a4fbf
Fix path tests
kevinwang5658 Apr 22, 2026
5944d31
Add logging
kevinwang5658 Apr 22, 2026
db5b75e
Add logging
kevinwang5658 Apr 22, 2026
7d537ac
Add logging
kevinwang5658 Apr 22, 2026
8f6a877
Print out zshrc as well
kevinwang5658 Apr 22, 2026
3ad9f4a
Print out zshrc as well
kevinwang5658 Apr 22, 2026
8517842
Print out zshrc as well
kevinwang5658 Apr 22, 2026
a6364f7
Added empty zshrc file
kevinwang5658 Apr 22, 2026
5f5a1b8
Disable wrapping for test spawn
kevinwang5658 Apr 22, 2026
7dba656
Bump test library version
kevinwang5658 Apr 22, 2026
dc772d0
Bump library version
kevinwang5658 Apr 22, 2026
1735a8b
Bump library version
kevinwang5658 Apr 22, 2026
267a4dc
Remove java
kevinwang5658 Apr 22, 2026
7bb6ba4
Remove java
kevinwang5658 Apr 22, 2026
b35c6e0
Test java
kevinwang5658 Apr 22, 2026
cadcb21
Test java
kevinwang5658 Apr 22, 2026
3d01bb8
Test java
kevinwang5658 Apr 22, 2026
7a7a48b
Improve path and added logging
kevinwang5658 Apr 22, 2026
032f76a
Improve path and added logging
kevinwang5658 Apr 22, 2026
4bc3c69
Enable ssh
kevinwang5658 Apr 22, 2026
2c6ad85
Fix jenv destroy
kevinwang5658 Apr 22, 2026
a4a5558
Fix comment
kevinwang5658 Apr 22, 2026
ad27052
Fix comment
kevinwang5658 Apr 22, 2026
3546ea4
Fix jenv uninstall
kevinwang5658 Apr 22, 2026
920e243
Run xcode-tools vscode macports
kevinwang5658 Apr 22, 2026
6e78a8a
Run xcode-tools vscode macports
kevinwang5658 Apr 22, 2026
255e97a
Fix downloads
kevinwang5658 Apr 22, 2026
438f3aa
Test asdf
kevinwang5658 Apr 22, 2026
3855905
Test adnroid homebrew custom install
kevinwang5658 Apr 22, 2026
a59e86a
Hard code mount point
kevinwang5658 Apr 22, 2026
59bcc92
Enable all tests except homebrew
kevinwang5658 Apr 22, 2026
57dfb61
Added sharding
kevinwang5658 Apr 23, 2026
9a3f6eb
Added sharding for linux. Enable linux. Split MacOS and Linux tests
kevinwang5658 Apr 23, 2026
f7e3fd6
Remove errorenous logging
kevinwang5658 Apr 23, 2026
c943d19
Test jenv
kevinwang5658 Apr 23, 2026
909e99b
Test jenv
kevinwang5658 Apr 23, 2026
6aee417
Fixes in the library
kevinwang5658 Apr 23, 2026
9255b73
Enabled all tests again
kevinwang5658 Apr 23, 2026
475e457
Set up tests to only run when merging to release branch and change th…
kevinwang5658 Apr 23, 2026
3c6d0a4
Add action to run claude on test failure
kevinwang5658 Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: 2.1

jobs:
test:
parameters:
executor:
type: executor
executor: << parameters.executor >>
steps:
- checkout
- node/install:
node-version: '24'
- run:
name: Enable linger for current user (Linux only)
command: |
if [[ "$OSTYPE" == "linux"* ]]; then
loginctl enable-linger $(whoami)
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
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: '26.4.0'
resource_class: m4pro.medium

#workflows:
# test-all:
# jobs:
# - test:
# matrix:
# parameters:
# executor: [linux-arm]
30 changes: 30 additions & 0 deletions .github/workflows/claude-fixer.yml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions .github/workflows/run-all-tests-cron-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 cron (Linux)

on:
pull_request:
branches:
- release
schedule:
- cron: '0 0 * * *' # Every day 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 --disable-console-intercept --shard ${{ matrix.shard }}

54 changes: 54 additions & 0 deletions .github/workflows/run-all-tests-cron-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 cron (MacOS)

on:
pull_request:
branches:
- release
schedule:
- cron: '0 0 * * *' # Every day at midnight UTC
workflow_dispatch:

jobs:
build-and-test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
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
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: '24.x'
cache: 'npm'

- 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}
run: |
sudo chsh -s $(which zsh) $USER
echo $0

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 --shard ${{ matrix.shard }}

31 changes: 0 additions & 31 deletions .github/workflows/run-all-unit-tests.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="test:integration:dev -- $FilePathRelativeToProjectRoot$" type="js.build_tools.npm" nameIsGenerated="true">
<configuration default="false" name="test:integration:dev -- $FilePathRelativeToProjectRoot$" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"license": "ISC",
"type": "module",
"dependencies": {
"@codifycli/plugin-core": "1.1.0-beta6",
"@codifycli/plugin-core": "1.1.0-beta10",
"@codifycli/schemas": "1.0.0",
"ajv": "^8.18.0",
"ajv-formats": "^2.1.1",
Expand All @@ -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-beta3",
"@fastify/merge-json-schemas": "^0.2.0",
"@oclif/prettier-config": "^0.2.1",
"@oclif/test": "^3",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
33 changes: 33 additions & 0 deletions scripts/cleanup-github-actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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');


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');

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: 'aws-cli' },
]);

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 });

}
9 changes: 5 additions & 4 deletions src/resources/android/android-studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class AndroidStudioResource extends Resource<AndroidStudioConfig> {
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'))!
Expand All @@ -144,15 +144,16 @@ export class AndroidStudioResource extends Resource<AndroidStudioConfig> {

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')
}

Expand Down
3 changes: 1 addition & 2 deletions src/resources/asdf/asdf.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
17 changes: 14 additions & 3 deletions src/resources/aws-cli/cli/aws-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,20 @@ 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 ${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 });
}
}

private async findInstallLocation(): Promise<null | string> {
Expand Down
Loading
Loading