wso2 / wso2/api-platform

Implement complete API publication state management for unpublishing flow

Open
#137 1 comment 0 reactions 1 assignee View on GitHub

@DakshithaS is already working on this.

Since Nov 11, 2025.

Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Context

This issue tracks the implementation of complete API publication state management during the unpublishing flow, as deferred from PR #136.

Background

The UnpublishAPIFromDevPortal method in platform-api/src/internal/service/devportal_service.go currently unpublishes an API from the DevPortal backend but does not persist the publication state transitions in the database.

Problem

Without persisting the publication state:

  • The publication record remains in published status indefinitely
  • The state machine lifecycle is broken (should be: Published → Unpublishing → Unpublished)
  • Subsequent publish attempts will fail on the unique key constraint
  • The system cannot track unpublishing history or handle failures

Required Implementation

The unpublishing flow should:

  1. Fetch the publication record from api_publications
  2. Transition to unpublishing state before calling the DevPortal client
  3. Persist the unpublishing state
  4. Call the DevPortal client to unpublish
  5. Transition to unpublished state after successful client call
  6. Persist the unpublished state

Reference

Acceptance Criteria

  • Publication state is fetched before unpublishing
  • State transitions follow the state machine: Published → Unpublishing → Unpublished
  • State changes are persisted in the database
  • Error handling covers both state transition and persistence failures
  • Unit tests cover the state management logic
  • Integration tests verify the end-to-end unpublishing flow

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.