Skip to content

Wire the deploy page to the platform API - #3365

Open
dakshina99 wants to merge 1 commit into
wso2:mainfrom
dakshina99:apip-deploy-plugin
Open

Wire the deploy page to the platform API#3365
dakshina99 wants to merge 1 commit into
wso2:mainfrom
dakshina99:apip-deploy-plugin

Conversation

@dakshina99

@dakshina99 dakshina99 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

The Deploy page is a self-contained mock: it seeds its own environments, fakes a
deployment with a setTimeout, and invents build ids. Nothing it shows is real,
and nothing it does leaves the browser.

This wires it to the platform API, on top of the revamped page from #3379.

Goals

  • Show what is actually deployed, where, and on which build.
  • Deploy, promote, stop and retry for real, against the project's pipeline.
  • Keep the page's layout and interaction model as revamped; change only what
    real data requires.

Approach

The page consumes the API's own vocabulary. A gateway's deployment state
arrives as the platform's own status and is rendered from that, rather than being
translated into a private set of names on the way in. NOT_DEPLOYED is a state
the server reports for a gateway the API has never reached, so an environment can
list every gateway it has without the client inferring anything. The endpoint a
gateway was deployed with, and which gateway is an environment's default, arrive
on the same listing — so the dialog preselects the same gateway the server would
choose and opens on the endpoint that gateway is actually serving, with no second
call and no shape of its own.

Gateway health and deployment state are kept apart. Whether a gateway can
receive a deployment is its own health, reported by the gateways resource; what is
deployed on it is a different fact. A healthy gateway with nothing on it is
exactly what a first deployment targets, so health gates Deploy and Promote while
the deployment's status drives the row and its pill. Collapsing the two would have
left a brand-new API unable to deploy anywhere.

Deploy means "ship the API as it stands". The server snapshots the definition
and deploys that snapshot, so there is no build step to perform first: the build
area reports what was last built instead of asking for one. Promote carries the
build an environment is already running forward; the server checks it against that
environment's live state, so the page cannot offer a promotion that would be
rejected.

What has no backing is gone, not left seeded. The environment-variables
drawers and per-gateway history showed numbers from the mock, and region was
never anything the API knows — the gateway's host is, so that is what the row and
picker show now. The gateway row's drawer is labelled Endpoint URL, which is what
it opens.

DeployFeature owns the data and the actions; DeployPage and its cards stay
presentational. The view polls only while a deployment is settling and stops as
soon as everything has.

Wiring

Registered against a new page.apiDeploy slot — the same override arrangement
page.gateways already uses, so the native nav entry and route stay in place and
only what renders there changes. The Port carries the API in scope as apiHandle,
which is what an API-scoped feature needs and what nothing else had required yet.

Not registered on the AI Workspace host: deploying is scoped to one API and that
host has no API-scoped placement, so the page could only tell the user to open an
API. The feature package is shared and unchanged.

User stories

  • Open an API's Deploy page and see which gateway runs which build, with the
    endpoint it serves.
  • Deploy the API to a gateway in the first environment, then promote that build on.
  • Retry a failed gateway onto the build it already had, or stop one.

Documentation

N/A — no user-facing documentation exists for this page yet.

Automation tests

  • Unit tests

    None: this is UI wiring with no logic of its own to test in isolation, and the
    package has no test setup. tsc --noEmit passes for cloud-plugins and for
    api-control-plane.

  • Integration tests

    Exercised end to end against a running control plane.

Security checks

Notes: every call goes through the host's apiFetch, which is same-origin and
authenticated by the BFF — this package never sees a token, a base URL or an
organization id. The server owns every rule the page appears to enforce.

Related PRs

Builds on #3379 (the Deploy page revamp this wires up). The endpoints it calls are
added by the cloud extension.

Test environment

Node 22, macOS 15 (darwin/arm64).

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 914d3e88-1b92-42b2-be0a-ec938ac0e86b

📥 Commits

Reviewing files that changed from the base of the PR and between c2a16aa and a092e9b.

📒 Files selected for processing (20)
  • portals/api-control-plane/src/extensions.tsx
  • portals/api-control-plane/src/hostPort.tsx
  • portals/api-control-plane/src/pages/appShell/AppLayout.tsx
  • portals/api-control-plane/src/routes/AppRoutes.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/DeployFeature.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/DeployPage.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/components/BuildAreaCard.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/components/DeployDialog.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/components/DeploymentStatusBar.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/components/EnvironmentCard.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/components/EnvironmentVariablesDrawer.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/components/GatewayRow.tsx
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/deployApi.ts
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/hostPort.ts
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/index.ts
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/mocks/deploy.mock.ts
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/types.ts
  • portals/cloud-plugins/apip-cloud-ui-deploy/src/utils/status.ts
  • portals/cloud-plugins/apip-cloud-ui/src/hosts/ai-workspace.tsx
  • portals/cloud-plugins/apip-cloud-ui/src/hosts/api-control-plane.tsx

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

@dakshina99 dakshina99 changed the title Wire the deploy plugin to the platform API and add an API deploy page override Wire the deploy plugin to the platform API, with a prepare step and an API deploy page override Sep 4, 2026
@dakshina99
dakshina99 force-pushed the apip-deploy-plugin branch 2 times, most recently from 55e3249 to 56b7a26 Compare September 6, 2026 13:26
@dakshina99 dakshina99 changed the title Wire the deploy plugin to the platform API, with a prepare step and an API deploy page override Wire the deploy page to the platform API Sep 6, 2026
Takes the revamped deploy page off its mock and onto real data, through the
host-injected apiFetch. DeployFeature owns the data and the actions; the
page and its cards stay as they were laid out.

The page consumes the API's own vocabulary rather than translating it: a
gateway's deployment state arrives as the platform's status, its endpoint
and default flag arrive with it, and NOT_DEPLOYED is a state the server
reports rather than one the client infers. Gateway health is kept separate
from deployment state - a healthy gateway with nothing on it is exactly
what a first deployment targets, so health gates Deploy and Promote while
the deployment's own status drives the row.

Deploy sends the API as it stands and the server snapshots it, so the build
area reports what was last built instead of asking for one. What has no
backing is gone rather than left showing seeded numbers: environment
variables, per-gateway history, and the region label, which is now the
gateway's host. The gateway row's endpoint drawer is labelled for what it
opens.

Registers against the page.apiDeploy slot, the same override arrangement
the gateways page uses, and carries the API in scope on the Port.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant