Skip to content

[ap/0.9.x] Backport #3820: subscription plan and token update options, --admin-server fix - #3850

Merged
thivindu merged 2 commits into
wso2:ap/0.9.xfrom
thivindu:ap-0.9.x-fixes
Oct 21, 2026
Merged

thivindu merged 2 commits into
wso2:ap/0.9.xfrom
thivindu:ap-0.9.x-fixes

Conversation

@thivindu

Copy link
Copy Markdown
Contributor

Purpose

Backports the ap CLI changes from #3820 to ap/0.9.x so they can be released as CLI 0.9.2. ap/0.9.x was created from the ap/v0.9.1 release tag, so 0.9.2 is 0.9.1 plus these changes only.

Changes

ap gateway subscription

  • create: spec.externalRefId is used as the subscription ID. A non-string value is rejected before the request is sent.
  • update changes only the fields that are passed. --status is no longer required.
    • --subscription-plan-id: move the subscription to another plan.
    • --clear-subscription-plan: remove its plan.
    • --rotate-token: prompts for the new token with hidden input.
    • --subscription-token: passes the new token on the command line. Not recommended, because it ends up in shell history.
  • Blank, conflicting or missing options are rejected before calling the gateway. When the gateway rejects an update, its reason is shown.

Fix: ap gateway add dropped --admin-server
The value was accepted but never saved, so ap gateway health called the management URL and failed with a 404. It is saved again.

Other

  • cli/VERSION is set to 0.9.2-SNAPSHOT. The release workflow releases this version without the -SNAPSHOT suffix.
  • Adds the testutil gateway server helper the new unit tests use. On main it arrived with the GraphQL CLI work.
  • Docs updated in docs/cli/gateway/README.md.

Only the cli/ and docs/cli/ changes from #3820 are included. The test framework changes from that PR stay on main.

Gateway compatibility

The new subscription options need a gateway with the subscription API updates: main after #3804, or Gateway 1.2.0 with the latest U2 update. Older gateways, including the released 1.2.0:

  • accept the plan and token updates with 200 but ignore them;
  • ignore spec.externalRefId and generate the subscription ID themselves.

update --status, get, list, delete and the --admin-server fix work with all gateway versions.

thivindu and others added 2 commits October 20, 2026 22:21
…in-server fix

Backports the CLI changes from wso2#3820 (cli/ and docs/cli/
only) to ap/0.9.x for the 0.9.2 release:

- `ap gateway subscription create` accepts spec.externalRefId, used as the
  subscription ID.
- `ap gateway subscription update` changes the plan (--subscription-plan-id),
  removes it (--clear-subscription-plan) and rotates the token (--rotate-token
  or --subscription-token). Only the requested fields are sent, and blank or
  conflicting options are rejected.
- `ap gateway add` saves --admin-server again, so `ap gateway health` works.

Also adds the testutil gateway server helper the new unit tests use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: wso2/api-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 65df4635-c7b9-4465-85e5-a638bdc0b5db

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@thivindu
thivindu merged commit 961c21c into wso2:ap/0.9.x Oct 21, 2026
1 check passed
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.

2 participants