Skip to content

Track live a7 CLI validation findings and remaining coverage #15

@guoqqqi

Description

@guoqqqi

Background

We started validating whether the current a7 CLI is stable by connecting the real CLI to a local API7 environment, instead of relying on test framework results or mocks.

Validation environment:

  • API7 control plane: local HTTPS environment
  • Gateway group: product
  • API7 image version: 3.8.23
  • Validation method: create, read, update, and delete resources only through a7, then assert the result through a7 get/list/dump/diff/sync

This issue tracks live CLI findings and remaining coverage. We should finish the full CLI validation first, then split fixes into PRs.

Verified Working CLI Paths

  • context create --tls-skip-verify --use
  • gateway-group list
  • service create/get/list/update/export/delete
  • route create/get/list --service-id/delete
  • route update -f
  • consumer create/get/list/delete
  • credential create -f/list/get/delete
  • config sync can create, update, and delete service + route resources
  • config diff can confirm synced resources as unchanged
  • config dump can read back the current gateway group configuration

Findings

1. context create does not persist a token supplied through A7_TOKEN

Behavior:

  • Run context create with the API token supplied only through A7_TOKEN
  • The context is created successfully
  • Later commands fail unless A7_TOKEN is supplied again:
Error: no API token configured; run 'a7 context create' or set A7_TOKEN

We need to confirm whether this is intended behavior. If environment tokens are intentionally not persisted, the docs and error message should make that clear.

2. route list without --service-id is rejected by the API

Behavior:

Error: API error (status 400): validate request failed: parameter "service_id" in query has an error: value is required but missing

route list --help already says --service-id is required by API7 EE, but the CLI does not validate it locally and lets the API return the error.

Questions:

  • Should route list support listing all routes?
  • If API7 EE requires service_id, the CLI should validate this locally and return a clearer error.

3. service update uses full replacement semantics and can drop fields

Behavior:

  • Create a service with name
  • Run service update <id> --desc ... --labels ... --host ... without --name
  • Run service get; the name field is gone

This suggests the flag-based update path sends a full PUT body without reading and merging the existing object first. That can accidentally remove fields.

We need to check whether other update commands have the same risk.

4. route update --uri does not map to API7 EE paths

Behavior:

  • route create --uri ... succeeds, so create maps uri to paths
  • route update --uri ... fails because the API requires paths

Error:

request body has an error: property "paths" is missing

Current workaround:

  • Use route update -f with an explicit paths payload

5. credential create <id> does not map to the API-required name

Behavior:

  • Run credential create <id> --consumer ... --plugins-json ...
  • The API returns name is missing

Current workaround:

  • Use credential create --consumer ... -f credential.json
  • Include name in the file payload

We need to confirm whether the positional <id> should map to name in the API7 EE credential model, or whether the CLI help/docs should change.

6. secret create flag/positional mode returned resource not found

Behavior:

  • secret list returns an empty list, so the read path is at least reachable
  • secret create ... returned:
Error: resource not found

Need to confirm:

  • Whether the current API7 3.8.23 environment supports secret provider writes
  • Whether the endpoint used by a7 matches the current API7 EE version
  • Whether create/update/delete require a different path or request shape

7. plugin-config list/create returns resource not found

Behavior:

  • plugin-config list returns resource not found
  • plugin-config create returns resource not found

Based on the current PRD, plugin-config is an APISIX reusable plugin configuration resource that routes can reference to reuse plugin settings. The PRD also states that API7 EE Admin API does not expose this resource:

Plugin configs are not exposed via the API7 EE Admin API.
The a7 plugin-config commands exist for APISIX compatibility but will not work against API7 EE.

Decisions needed:

  • Should a7 plugin-config stay as an APISIX compatibility command?
  • If yes, should it return a clearer message in API7 EE environments?
  • Should it be excluded from the default API7 EE E2E/live CLI validation scope?
  • Should declarative config continue ignoring plugin_configs?

Remaining Coverage

Live CLI validation still needs these resources/scenarios:

  • ssl CRUD
  • ssl SNI/SNIs behavior, including multiple SNIs, updating SNI, and readback assertions
  • Full secret provider create/read/update/delete path
  • Global rule / global plugin resource CRUD
  • Plugin metadata CRUD
  • Proto CRUD
  • Stream route CRUD
  • Whether upstream commands still apply to the current API7 EE version
  • Whether consumer group is supported by API7 EE or is an APISIX compatibility resource like plugin-config
  • Service template / gateway group read-only and optional CRUD boundaries
  • Whether other resource updates have the same field-dropping issue as service update
  • Whether flag mode and -f file mode behave consistently for each resource
  • config sync create/update/delete/readback coverage across more resource types

Suggested Follow-Up

Continue the full live CLI validation first. Do not fix everything in this issue directly.

After validation is complete, split fixes by problem type:

  • CLI flag to API7 EE schema mapping issues
  • Update replacement/merge semantics
  • API7 EE unsupported resources or endpoint mismatches
  • Documentation/help/error message clarification
  • E2E or live CLI checklist coverage

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions