Skip to content

Conversation

@h4x3rotab
Copy link
Contributor

Summary

  • Add new SDK action getAppsList for /apps endpoint that returns only the current user's apps
  • Update CLI cvms list to use /apps endpoint with proper pagination (fetches all pages)
  • Fix SDK tests to use viem's mainnet export instead of hardcoded chain definitions
  • Update error message tests to include 'name' option

Problem

Admin users were seeing all CVMs on the platform when running phala cvms list due to the /cvms/paginated endpoint returning all CVMs for admin users.

Solution

Switch to the /apps endpoint which correctly returns only the current user's apps regardless of admin status.

Test plan

  • SDK unit tests pass (583 tests)
  • CLI E2E full lifecycle tests pass (10 tests)
  • Manual verification with admin user account

🤖 Generated with Claude Code

Admin users were seeing all CVMs on the platform when running
`phala cvms list` due to the /cvms/paginated endpoint returning all CVMs
for admin users.

Changes:
- Add new SDK action `getAppsList` for /apps endpoint
- Update CLI `cvms list` to use /apps endpoint with proper pagination
- Fix SDK tests to use viem's mainnet export instead of hardcoded chain
- Update error message tests to include 'name' option

The /apps endpoint returns only the current user's apps, fixing the
issue for admin users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

📋 Check Results

✨ JS SDK - Code Formatting

Show format check results
✓ No formatting issues found

🔍 JS SDK - TypeScript Type Check

Show type check output
$ tsc --noEmit

🧪 JS SDK - Test Results

Show test output
$ vitest --run --exclude '**/*.e2e.test.ts'

�[7m�[1m�[36m RUN �[39m�[22m�[27m �[36mv1.6.1�[39m �[90m/home/runner/work/phala-cloud/phala-cloud/js�[39m

 �[32m✓�[39m src/client.test.ts �[2m (�[22m�[2m45 tests�[22m�[2m)�[22m�[90m 42�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/blockchains/deploy_app_auth.test.ts �[2m (�[22m�[2m27 tests�[22m�[2m)�[22m�[90m 50�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/blockchains/add_compose_hash.test.ts �[2m (�[22m�[2m34 tests�[22m�[2m)�[22m�[90m 195�[2mms�[22m�[39m
�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould add compose hash successfully with default parameters�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould handle custom timeout�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould use custom schema when provided�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould return raw data when schema is false�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould throw when custom schema validation fails�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould work with wallet client authentication�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould work with both clients provided�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould skip prerequisite checks when configured�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould use retry mechanism when enabled�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mStandard Version�[2m > �[22m�[2mshould handle progress callbacks�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version�[2m > �[22m�[2mshould return success result when operation succeeds�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version�[2m > �[22m�[2mshould work with custom schema�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version�[2m > �[22m�[2mshould return raw data when schema is false�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version�[2m > �[22m�[2mshould work without parameters�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version�[2m > �[22m�[2mshould work with empty parameters object�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSchema Flexibility�[2m > �[22m�[2mshould allow extra fields in transaction receipt for forward compatibility�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSchema Flexibility�[2m > �[22m�[2mshould handle ComposeHashAdded event when present�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mType Inference�[2m > �[22m�[2mshould infer correct types for default schema�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mType Inference�[2m > �[22m�[2mshould infer correct types for custom schema�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mType Inference�[2m > �[22m�[2mshould infer unknown type when schema is false�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version Type Inference�[2m > �[22m�[2mshould infer correct SafeResult types for default schema�[22m�[39m
[]

�[90mstdout�[2m | src/actions/blockchains/add_compose_hash.test.ts�[2m > �[22m�[2maddComposeHash�[2m > �[22m�[2mSafe Version Type Inference�[2m > �[22m�[2mshould infer correct SafeResult types for custom schema�[22m�[39m
[]

 �[32m✓�[39m src/utils/define-action.type.test.ts �[2m (�[22m�[2m20 tests�[22m�[2m)�[22m�[90m 19�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/define-action.test.ts �[2m (�[22m�[2m24 tests�[22m�[2m)�[22m�[90m 33�[2mms�[22m�[39m
 �[32m✓�[39m src/types/cvm_id.test.ts �[2m (�[22m�[2m53 tests�[22m�[2m)�[22m�[90m 38�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/errors.test.ts �[2m (�[22m�[2m28 tests�[22m�[2m)�[22m�[90m 27�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/hostname.test.ts �[2m (�[22m�[2m53 tests�[22m�[2m)�[22m�[90m 25�[2mms�[22m�[39m
 �[32m✓�[39m src/parse_dotenv.test.ts �[2m (�[22m�[2m71 tests�[22m�[2m)�[22m�[90m 27�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/commit_cvm_compose_file_update.test.ts �[2m (�[22m�[2m12 tests�[22m�[2m)�[22m�[90m 27�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/provision_cvm_compose_file_update.test.ts �[2m (�[22m�[2m29 tests�[22m�[2m)�[22m�[90m 43�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/apps/get_apps_list.test.ts �[2m (�[22m�[2m12 tests�[22m�[2m)�[22m�[90m 36�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/watch_cvm_state.test.ts �[2m (�[22m�[2m6 tests�[22m�[2m)�[22m�[90m 73�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/get_cvm_compose_file.test.ts �[2m (�[22m�[2m10 tests�[22m�[2m)�[22m�[90m 22�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/get_cvm_info.test.ts �[2m (�[22m�[2m11 tests�[22m�[2m)�[22m�[90m 34�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/get_current_user.test.ts �[2m (�[22m�[2m10 tests�[22m�[2m)�[22m�[90m 24�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/kms/get_app_env_encrypt_pubkey.test.ts �[2m (�[22m�[2m9 tests�[22m�[2m)�[22m�[90m 20�[2mms�[22m�[39m
 �[32m✓�[39m src/client.extend.type.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 7�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/kms/get_kms_list.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 35�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/get_cvm_list.test.ts �[2m (�[22m�[2m6 tests�[22m�[2m)�[22m�[90m 27�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/kms/get_kms_info.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 18�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/commit_cvm_provision.test.ts �[2m (�[22m�[2m7 tests�[22m�[2m)�[22m�[90m 17�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/get_cvm_stats.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 26�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/validate-parameters.test.ts �[2m (�[22m�[2m9 tests�[22m�[2m)�[22m�[90m 11�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/get_available_nodes.test.ts �[2m (�[22m�[2m6 tests�[22m�[2m)�[22m�[90m 21�[2mms�[22m�[39m
 �[32m✓�[39m src/client.extend.test.ts �[2m (�[22m�[2m6 tests�[22m�[2m)�[22m�[90m 15�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/shutdown_cvm.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 14�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/restart_cvm.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 20�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/get_cvm_containers_stats.test.ts �[2m (�[22m�[2m6 tests�[22m�[2m)�[22m�[90m 10�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/start_cvm.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 20�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/stop_cvm.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 18�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/provision_cvm.test.ts �[2m (�[22m�[2m4 tests�[22m�[2m)�[22m�[90m 9�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/delete_cvm.test.ts �[2m (�[22m�[2m8 tests�[22m�[2m)�[22m�[90m 11�[2mms�[22m�[39m
 �[32m✓�[39m src/actions/cvms/get_cvm_state.test.ts �[2m (�[22m�[2m4 tests�[22m�[2m)�[22m�[90m 12�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/as-hex.test.ts �[2m (�[22m�[2m9 tests�[22m�[2m)�[22m�[90m 9�[2mms�[22m�[39m

�[2m Test Files �[22m �[1m�[32m35 passed�[39m�[22m�[90m (35)�[39m
�[2m      Tests �[22m �[1m�[32m583 passed�[39m�[22m�[90m (583)�[39m
�[2m   Start at �[22m 02:47:11
�[2m   Duration �[22m 8.94s�[2m (transform 1.20s, setup 3ms, collect 12.32s, tests 1.03s, environment 9ms, prepare 5.46s)�[22m

📝 JS SDK - Lint Check

Show lint results
✓ No linting issues found

🌐 JS SDK - Browser Compatibility

Show browser test results

🌐 Browser Compatibility Report

Browser compatibility tests completed across:

  • ✓ Chromium
  • ✓ Firefox
  • ✓ WebKit (Safari)

The SDK has been verified to work in modern browser environments.


Check run: https://github.com/Phala-Network/phala-cloud/actions/runs/19792774874

@Leechael
Copy link
Collaborator

This would be a breaking change for phala cvms ls --json if the users using json mode for scripting. So I think it's not a good idea for the release.

Base automatically changed from feat-cli-pre-release-check to main December 22, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants