ChiragAgg5k / ChiragAgg5k/appwrite-cli-go

CLI Go preview audit: 8 findings in v0.7.17-preview

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Summary

A clean-room audit of the Go CLI preview found eight issues. Testing was against staging only; no comparison with the older CLI was made.

Environment: appwrite 0.7.17-preview · Go 1.26.5 · macOS arm64 · FRA staging
Coverage: 593/593 leaf-command help contracts passed; 372 verdict-bearing live invocations; disposable resources and project cleaned up.

Findings

1. Create timeout hides a successful mutation
$ appwrite organization create-project \
    --project-id 'unique()' --name 'CLI Go Preview Audit' \
    --region fra --organization-id <ORG_ID> --json
✗ Error: Post "https://cloud.staging.appwrite.io/v1/organization/projects": \
  context deadline exceeded (Client.Timeout exceeded while awaiting headers)

$ appwrite organization list-projects --organization-id <ORG_ID> --json
# The new project is present with a creation timestamp matching the timed-out call.

This is an uncertain mutation outcome: retrying the reported failure can duplicate side effects. The CLI should reconcile the resource after a timeout or clearly flag the outcome as unknown.

2. Function/site directory auto-packaging is broken

Help says a directory passed to --code is automatically packaged, but both commands try to read it as a file:

$ appwrite functions create-deployment \
    --function-id audit-function --code audit-function \
    --entrypoint main.js --activate
✗ Error: read .../audit-function: is a directory

$ appwrite sites create-deployment \
    --site-id audit-site --code audit-site --activate
✗ Error: read .../audit-site: is a directory

Prebuilding the archive works:

$ tar -czf audit-function.tar.gz -C audit-function .
$ appwrite functions create-deployment \
    --function-id audit-function --code audit-function.tar.gz \
    --entrypoint main.js --activate
# Success
3. Activity/log list endpoints return HTTP 500
$ appwrite activities list-events --verbose
$ appwrite users list-logs --user-id audit-user --verbose
$ appwrite account list-logs --verbose

✗ Error: Server Error
status: 500
{"message":"Server Error","code":500,"type":"general_unknown","version":"1.9.6"}

Other list endpoints using the same authenticated context succeed.

4. TablesDB bulk row creation returns HTTP 500

Single-row create/update/upsert and bulk delete pass, but bulk create fails:

$ appwrite tablesdb create-rows \
    --database-id audit-db --table-id audit-table \
    --rows '{"$id":"row-one","title":"first","score":10}' \
           '{"$id":"row-two","title":"second","score":20}' \
    --verbose

✗ Error: Server Error
status: 500
{"message":"Server Error","code":500,"type":"general_unknown","version":"1.9.6"}

The CLI request encoding should match the bulk endpoint schema; malformed input should produce a useful 4xx rather than a generic 500.

5. Specification discovery disagrees with create validation
$ appwrite functions list-specifications --json
# Includes: {"slug":"s-1vcpu-512mb", ..., "enabled":true}

$ appwrite functions create \
    --function-id audit-function --name Audit --runtime node-22 \
    --build-specification s-1vcpu-512mb \
    --runtime-specification s-1vcpu-512mb --enabled

✗ Error: Invalid `buildSpecification` param: Specification must be one of:
  s-2vcpu-2gb, s-2vcpu-4gb, s-4vcpu-4gb

The same mismatch occurs for sites. Switching both specs to s-2vcpu-2gb succeeds.

6. init skill --force is not headless
$ appwrite init skill --force
ℹ Info: Fetching available Appwrite skills ...
✗ Error: "Which skills would you like to install?" needs an answer \
  but there is no interactive terminal

There is no command-specific --all or repeatable --skill flag. --force should have defined non-interactive behavior, or selection flags should be exposed for CI.

7. GraphQL query help/input contract is misleading
$ appwrite graphql query --help
Execute a GraphQL mutation.

$ appwrite graphql query --query 'query { project { _id name } }'
✗ Error: expected JSON ... invalid character 'q' looking for beginning of value

A JSON envelope succeeds:

$ appwrite graphql query \
    --query '{"query":"query { project { _id name } }"}' --json
# Success

The description should say query, and help should document the envelope—or the CLI should wrap raw GraphQL automatically.

8. Preview update notice points to the stable channel
$ appwrite sessions
⚠️  A newer version is available: 0.7.17-preview → 25.1.0
💡 Run 'appwrite update' to update to the latest version.

Following this prompt can replace the preview build currently under test. Update checks should respect an explicit preview/stable channel or clearly state the channel transition.

Expected outcome

  • Reconcile or explicitly report unknown outcomes for timed-out mutations.
  • Package directory inputs as documented.
  • Remove the reproducible 500s and provide useful validation errors.
  • Keep advertised specs and accepted specs consistent.
  • Document or implement headless, GraphQL, and update-channel behavior.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported failures with the listed CLI entry points, especially functions/sites create-deployment, tablesdb create-rows, graphql query, and init skill --force. Trace each command's request and validation path; done means the eight findings are either fixed or explicitly documented, including safe timeout handling, directory packaging, useful errors, consistent specifications, headless behavior, GraphQL help, and channel-aware updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, cli, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.